Bug #2038 CREATE TABLE x(a INT) refused by parser; space required between x and (
Submitted: 7 Dec 2003 14:10 Modified: 10 Dec 2003 15:24
Reporter: Guilhem Bichot Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1.1 OS:Linux (Linux)
Assigned to: Antony Curtis CPU Architecture:Any

[7 Dec 2003 14:10] Guilhem Bichot
Description:
See how-to-repeat. It's a bug as x(a INT) works fine in 4.0.16.

How to repeat:
mysql> create table x(a int);
ERROR 1064 (42000): You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near 'x(a int)' at line 1
mysql> create table x (a int);
Query OK, 0 rows affected (0.00 sec)
[9 Dec 2003 11:49] Brian Aker
I personally question whether or not this is a bug.
[9 Dec 2003 17:39] Antony Curtis
This is due to current lexer... with no space before a parenthesis, it is automatically assumed to be a UDF.
[10 Dec 2003 0:55] Guilhem Bichot
I would say it's a true bug, as it works in 4.0.16.
[10 Dec 2003 15:22] Antony Curtis
There is a function called X, so when the lexer sees "X(" it automatically assumes it is referring to the function.

Resolving functions names must be deferred in to the parser.

As an example:

mysql> create table W(a int);
Query OK, 0 rows affected (0.00 sec)

mysql> create table X(a int);
ERROR 1064 (42000): You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near 'X(a int)' at line 1
mysql> create table Y(a int);
ERROR 1064 (42000): You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near 'Y(a int)' at line 1
mysql> create table Z(a int);
Query OK, 0 rows affected (0.00 sec)