Bug #17851 DEFAULT can't be processed from QB
Submitted: 2 Mar 2006 8:49 Modified: 5 Jan 2007 12:12
Reporter: Stan Segers Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Query Browser Severity:S3 (Non-critical)
Version:1.1.20 & 1.1.18 OS:Windows (WinXP SP2)
Assigned to: Mike Lischke CPU Architecture:Any
Tags: Source Editors

[2 Mar 2006 8:49] Stan Segers
Description:
When entering a DEFAULT through th GUI and hitting the apply button, no ALTER TABLE statement is generated to add the default. QB reports "The changes you made did not result in the need to alter the table".

When creating the default via an ALTER TABLE statement directly and looking at it via QB, it is shown correctly. When I then try to change the DEFAULT, this ALTER TABLE script generated by QB:

ALTER TABLE `db_name`.`tbl_name` MODIFY COLUMN `col_name` VARCHAR(50) CHARACTER SET latin1 COLLATE latin1_general_ci;
... and the DEFAULT is gone again.

How to repeat:
By following the description.
[2 Mar 2006 15:09] Valeriy Kravchuk
Thank you for a problem report. Sorry, but I can not repeat the problem you described with QB 1.1.20 on XP. It gave me:

ALTER TABLE `test`.`event` MODIFY COLUMN `event.date` VARCHAR(25) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT ''abc'';

when I tried to add default values for the column. What exact version of MySQL server are you working with (5.0.18 in my case)? Can you give a more detailed description of steps to perform to repeat the behaviour you described?
[2 Mar 2006 19:44] Stan Segers
Server version is 5.0.18

Some extra detail, as I ran into the reproduction problem as well. So tried again....

I found that when creating the table and the default graphically there is no problem. But when the table is created with SQL statements, it doesn't accept a default via the table editor. Similar, when the table and default are created using SQL, the default disapears when you try to edit it.

CREATE TABLE t(
a int,
b varchar(50));
ALTER TABLE t
  ALTER COLUMN b SET DEFAULT 'test';
[3 Mar 2006 13:46] Valeriy Kravchuk
Verified just as described in the last comment. The problem is repeatable when you'll try to change existing default value for column using QB.
[5 Dec 2006 12:12] Mike Lischke
I cannot reproduce it with the current source. Could you please check with the latest release of QB? Seems to be fixed already.
[6 Jan 2007 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".