David,
Tuesday, June 11, 2002, 3:28:52 PM, you wrote:

DH> I have encountered a strange problem with the enum type in version
DH> 3.23.49. It may be a bug, but I'd be grateful to hear comments.

DH> Here's a short example which illustrates the problem. First, I create
DH> a table with an enum column whose allowed elements are single letters,
DH> including a single space:

DH>     CREATE TABLE cats (
DH>         name VARCHAR(12) NOT NULL,
DH>         gender ENUM(' ', 'F', 'M') NOT NULL,
DH>         PRIMARY KEY(name)
DH>     );

[skip]

DH> Notice that the table definition statement now explicitly states that
DH> the default value for the "gender" column is ' '. I didn't specify
DH> this explicitly when I defined the table originally.

DH> Now, when I try to read the backup file back into MySQL, I get this
DH> error:

DH>     ERROR 1067 at line 12: Invalid default value for 'gender'

DH> But *why* should this happen? MySQL seems to be happy enough to
DH> let me include a single space as an element of the enumeration,
DH> but it won't let me specify it explicitly as the default value.

DH> This behaviour can be replicated at will in versions 3.23.38 and
DH> 3.23.49 of MySQL, running on both Compaq Alpha OSF5.1 and Red
DH> Hat Linux 7.2 for i386.

It was a bug that was fixed. In 4.0.2 and 3.23.51. ' ' is a valid
value, too.

DH> Thanks in advance
DH> David Harper




-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Victoria Reznichenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to