Bug with ENUM?

Bob Aman
2005-02-18T15:21:50Z

I ran into some very strange behavior just a second ago.

I have an ENUM field which I named "dummy"

CREATE TABLE `foobars` (
  `id` int(6) unsigned NOT NULL auto_increment,
  `dummy`
enum(''foo'',''bar'',''baz'',''quux'')
NOT NULL default ''foo'',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE `foobars` (
  `id` int(6) unsigned NOT NULL auto_increment,
  `dummy`
enum(''acquaintance'',''foo'',''bar'',''baz'',''quux'')
NOT NULL default ''foo'',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

When you display the associated pages, the first foobar gives what you
would expect.
However, on the second table foobar.dummy always returns 0, regardless
of the actual values of the rows in the database.  If you change the
"acquaintance" value in any way, make it longer, shorter, change a
letter to something else, doesn''t matter, then it goes back to
working.

This seems..... wrong.... somehow.
--
Bob Aman