Le Mon, Jun 18, 2001 at 04:04:52PM +0300, Sinisa Milivojevic a écrit:
> [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. 

ok so it's a failure from mysqldump.

I know this declaration is not really correct but mysqldump must regenerate a correct 
sql statement (good when pipe in mysql client i mean at least ;) ).
It's not the case.

Regards,
--
Guillaume FOUGNIES
Research & Development                       Profile For You Ltd.

---------------------------------------------------------------------
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