[EMAIL PROTECTED] writes:
> mysqldump regenerates a bad sql statement from a bad initial create table.
> 
> When you create this table for example (ok it's not a really nice definition):
> 
> CREATE TABLE TESTBADDUMP (
>             e_test enum('0','1') NOT NULL default 0
>           );
> 
> desc TESTBADDUMP;
> +--------+---------------+------+-----+---------+-------+
> | Field  | Type          | Null | Key | Default | Extra |
> +--------+---------------+------+-----+---------+-------+
> | e_test | enum('0','1') |      |     |         |       |
> +--------+---------------+------+-----+---------+-------+
> 
> and use mysqldump to regenerate the sql statement, you obtain:
> 
> CREATE TABLE TESTBADDUMP (
>             e_test enum('0','1') NOT NULL default ''
>           );
> 
> this new declaration is not correct and refused by MySQL.
> MySQL accept the value '' for insert but not for create table.
> 
> I'm not sure if it's normal to authorize empty values in enum.
> If this is normal, the bug is in mysqldump.
> 
> 


Hi!

The above is expected behaviour.

ENUM and SET types can take values only in the form of literals. If
you supply non-literal, like integer 0, MySQL tries it's best to find
the most approximate value.

Internally, MySQL does store both types as integers, but can insert /
update / display only it's representations of literals or set of
literals. 


-- 
Regards,
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Mr. Sinisa Milivojevic <[EMAIL PROTECTED]>
 / /|_/ / // /\ \/ /_/ / /__   MySQL AB, FullTime Developer
/_/  /_/\_, /___/\___\_\___/   Larnaca, Cyprus
       <___/   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