Bug #7979 ANSI mode reserved words not listed
Submitted: 18 Jan 2005 2:39 Modified: 18 Aug 2005 15:20
Reporter: Stewart Smith Email Updates:
Status: Won't fix Impact on me:
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:current website OS:
Assigned to: Antony Curtis CPU Architecture:Any

[18 Jan 2005 2:39] Stewart Smith

lists reserved words.

However, some extra words are reserved when in sql_mode=ANSI (e.g. log).

How to repeat:
mysql> set sql_mode=ansi;
mysql> insert into log (entry) values ('foobar');
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 'log (entry) values ('foobar')' at line 1

mysql> set sql_mode=traditional;
Query OK, 0 rows affected (0.01 sec)

mysql> insert into log (entry) values ('foobar');
Query OK, 1 row affected (0.03 sec)

Suggested fix:
The documentation should list these - either here or in the ANSI mode section.
[18 Jan 2005 3:08] Paul Dubois
If the documentation should list them (which it probably
should), we need a way to determine the proper list by
examining source files. Currently, we generate the list
by running a program that examines lex.h and sql_yacc.yy.
Trying to maintain the list by hand and by relying on
developers to remember to tell us what the reserved words
are likely wouldn't work very well.
[10 Mar 2005 23:15] Antony Curtis
The parsing error is not because of LOG being a reserved word... it is actually caused by the sql_mode where the lexer ignores the space between the LOG and the left parentheses - causing the lexer to think it is a function name.

We shouldn't have code in the lexer to determine what is a function, this is currently a very broken/fragile design and should be fixed by removing the portions of the lexer which has this behaviour and put it in its proper place: in the parser.
[22 Apr 2005 0:47] Stewart Smith
Why is this marked "Need Feedback?" I see no real pointer to what kind of feedback should be provided.

especially with the closing of bugs that haven't had feedback for a month.