but mysqldump generates an invalid statement.

mysql> CREATE TABLE TESTBADDUMP (
    ->             e_test enum('0','1') NOT NULL default ''
    ->     );
ERROR 1067: Invalid default value for 'e_test'
mysql>

I think that's what the orignator is trying to show.  That mysqldump is
generating an invalid statement.

thanks,

-- Andrew

----- Original Message -----
From: "Thomas Karcher" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 18, 2001 9:08 AM
Subject: Re: mysqldump bug during regenerate enum field.


> Hi,
>
> > 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 ''
> >             );
>
> If you use "default 0", "0" is an integer. But ENUM only accept strings,
> so try to use "default '0'" when you create the table.
>
> Have a nice day,
> Thomas Karcher
>
> ---------------------------------------------------------------------
> 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
>
>


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