Package: mysql-admin
Version: 1.0.19-1
Severity: normal

The mysql-admin "Table Editor" incorrectly parses columns with a SET or
ENUM type. The bug appears the same way with SET and ENUM, so I'll just
describe the ENUM case below.

In the mysql-admin "Table Editor", create a table with an ENUM column.
This results in this SQL statement:

CREATE TABLE `test`.`testtbl` (
  `col` ENUM('foo','bar')  NOT NULL DEFAULT 'bar'
)
TYPE = MYISAM;

Now quit the table editor, and click on "Refresh" in the main window
so that the newly created table becomes visible. (BTW, why can't that
refresh happen every time I have just created a table in the "Table
Editor"? :-)

Now edit the testtbl table in the "Table Editor". The default value will
now be "bar" _without_ quotes, both in the column list and in the "Column
Details" at the bottom of the "Table Editor".

Now press "Apply Changes" and this SQL statement is generated (line feed
added by me):

ALTER TABLE `test`.`testtbl`
MODIFY COLUMN `col` ENUM('foo','bar') NOT NULL DEFAULT bar AUTO_INCREMENT;

Note the "DEFAULT bar", where "bar" is unquoted, just it is shown in
the "Table Editor". This is clearly incorrect SQL, as it should be
"DEFAULT 'bar'".

If I fix the unquoted "bar" in the "Table Editor" dialog to "'bar'"
(with quotes), then the quoted version is inserted into the SQL
statement, and the resulting SQL statement works:

ALTER TABLE `test`.`testtbl`
MODIFY COLUMN `col` ENUM('foo','bar') NOT NULL DEFAULT 'bar' AUTO_INCREMENT;

The place to fix this is probably somewhere in the parsing of the column
types and the corresponding generation of column data for the GUI.

-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (990, 'testing'), (800, 'unstable'), (100, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.8-2-686
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages mysql-admin depends on:
ii  libatk1.0-0                 1.8.0-4      The ATK accessibility toolkit
ii  libc6                       2.3.2.ds1-20 GNU C Library: Shared libraries an
ii  libgcc1                     1:3.4.3-6    GCC support library
ii  libglade2-0                 1:2.4.1-1    Library to load .glade files at ru
ii  libglib2.0-0                2.4.8-1      The GLib library of C routines
ii  libgtk2.0-0                 2.4.14-2     The GTK+ graphical user interface 
ii  libgtkmm2.0-1c102           2.2.12-1.1   C++ wrappers for GTK+ 2.0 (shared 
ii  libmysqlclient14            4.1.8a-1     mysql database client library
ii  libpango1.0-0               1.6.0-3      Layout and rendering of internatio
ii  libpcre3                    4.5-1.1      Perl 5 Compatible Regular Expressi
ii  libsigc++-1.2-5c102         1.2.5-1      Type-safe Signal Framework for C++
ii  libstdc++5                  1:3.3.5-5    The GNU Standard C++ Library v3
ii  libxml2                     2.6.11-5     GNOME XML library
ii  mysql-admin-common          1.0.19-1     Architecture independent files for
ii  zlib1g                      1:1.2.2-3    compression library - runtime

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to