I'm getting warmed up with my new Mac and one of the things I have run into with my fresh setup is that enum values now come in as Sets instead of strings. So whereas I used to get 'green' in Python, now I get Set(['green']).
My table is this:
mysql> describe Foo;
+-----------+----------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-----------+----------------------------+------+-----+---------+----------------+
| serialNum | int(11) | | PRI | NULL | auto_increment |
| e | enum('red','green','blue') | YES | | NULL | |
+-----------+----------------------------+------+-----+---------+----------------+
2 rows in set (0.03 sec)
My versions are: Python 2.5 MySQL-python 1.2.2b2 MySQL 4.1.x MacOS X 10.4.x
Is this normal/expected? I thought an enum could only hold one of the values (red or green or blue) so Set() does not seem applicable. However, if it is for some reason, I'll update my software to deal with it.
Thanks,
-Chuck
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I'm getting warmed up with my new Mac and one of the things I have run into with my fresh setup is that enum values now come in as Sets instead of strings. So whereas I used to get 'green' in Python, now I get Set(['green']).
My table is this:
mysql> describe Foo;
+-----------+----------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-----------+----------------------------+------+-----+---------+----------------+
| serialNum | int(11) | | PRI | NULL | auto_increment |
| e | enum('red','green','blue') | YES | | NULL | |
+-----------+----------------------------+------+-----+---------+----------------+
2 rows in set (0.03 sec)
My versions are:
Python 2.5
MySQL-python 1.2.2b2
MySQL 4.1.x
MacOS X 10.4.x
Is this normal/expected? I thought an enum could only hold one of the values (red or green or blue) so Set() does not seem applicable. However, if it is for some reason, I'll update my software to deal with it.
Thanks,
-Chuck
Will enums be included in the regression test suite for MySQLdb?
That all depends on if someone writes one.
enums are just strings anyway as far as the MySQL C API is concerned.
No, it's not right. Might be a new bug, but see #1561190.
Get the current MySQLdb-1.2 branch; it has the fix and will be in 1.2.2b3.