|
Posted by Geoff Berrow on 06/09/07 11:30
Message-ID: <qfij63189p1ige0fq2vm5ic7rkgaf0r5o6@4ax.com> from Gilles
Ganault contained the following:
>On Fri, 08 Jun 2007 21:19:11 -0000, ZeldorBlat <zeldorblat@gmail.com>
>wrote:
>>Remove the quotes around 0.
>
>It doesn't work any better:
>
>mysql> CREATE TABLE authlib_data (id int(11) DEFAULT 0 NOT NULL
>auto_increment,age int(3) DEFAULT 0 NOT NULL, PRIMARY KEY (id));
>
>ERROR 1067 (42000): Invalid default value for 'id'
Sheesh, I'm no sql whizz but even I can work out why that is nonsense.
auto_increment works in a similar way as DEFAULT adding a value if one
is not set in the sql except with auto_increment (and the clue is in the
name folks) a new unique number is added to the new row. Having both
must surely conflict and besides, DEFAULT would be redundant
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
[Back to original message]
|