List:General Discussion« Previous MessageNext Message »
From:Basil Hussain Date:February 20 2001 12:15pm
Subject:Re: [problem with creating a user table ]
View as plain text  
Hi all,

> create table user( u_id int(255) not null, name varchar(255));
> Notice the lack of space between user and the ( if you add a space
> in the statment will work.  this problem only seems to happen when the
> table is named user. create table blah( will work fine

It looks like this is occurring because there is a built-in function called
'USER' (which returns the current MySQL user name). The parser is obviously
getting confused by this.

So, it's either trying to evaluate "user( u_id int(255) not null, name
varchar(255))" as a function call and fails, or simply spots that the
function call is out of context. Either way it gives the syntax error.

Maybe something should be changed so that when the parser spots calls to
built-in functions out of context (i.e. in queries other than SELECT,
INSERT, UPDATE, etc.) it should tell the user so, rather than giving a terse
syntax error.

Regards,

------------------------------------------------
Basil Hussain (basil.hussain@stripped)

Thread
[problem with creating a user table ]kill-920 Feb
  • Re: [problem with creating a user table ]Basil Hussain20 Feb