List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:July 27 1999 4:46pm
Subject:Re: MySQL Bug?
View as plain text  
At 9:37 AM -0700 7/27/99, Stephen Uczekaj wrote:
>Is there a required ordering for table column attributes upon table creation?
>MySQL 3.22.23b-sun-solaris2.6-sparc gave me the following error which I
>'finally' fixed by reordering the spec..
>
>mysql> create table test2(ID int not null unsigned);
>ERROR 1064: You have an error in your SQL syntax near 'unsigned)' at line 1
>mysql> create table test2(ID int unsigned not null);
>Query OK, 0 rows affected (0.10 sec)
>
>
>It did not like 'not null' declared before 'unsigned'.  This is not intutitive
>and makes me wonder what other gotchas there are, and whether there is
>documentation somewhere pointing them out.


Follow the syntax described in the MySQL Reference Manual.  There are actually
some variations on that syntax that the parser will accept, but you won't
go wrong by using the documented order.

If you *really* want to know what's accepted and what's not, you'll
have to look at sql/sql_yacc.yy. :-)

-- 
Paul DuBois, paul@stripped
Thread
MySQL Bug?Stephen Uczekaj27 Jul
  • Re: MySQL Bug?Paul DuBois27 Jul