From the mysql certification guide’s example questions …
question
Will the following SQL statement succeed or result in an error? Assume that the table to be created doesn't already exist. CREATE TABLE MD5 (id INT);
answer
The statement results in an error if the IGNORE_SPACE SQL mode is enabled. In that case, all function names become reserved words and the statement would return an error because MD5 is a function name. If the IGNORE_SPACE SQL mode is not enabled, the statement succeeds: mysql> CREATE TABLE MD5 (id INT); Query OK, 0 rows affected Note that the IGNORE_SPACE SQL mode is part of the ANSI SQL mode.
Why do they talk about spaces? Anyone got any idea? What will be the correct answer? It fails because a function is a reserved word? Will it succeed when quoted, eg. with backtick… right?
IGNORE_SPACEmode allows spaces between function name and the following parenthesis. If it’s enabled, all function names become reserved words because it becomes impossible for MySQL to determine whether you’re calling a function or declaring (using) an identifier.Hence, if it’s enabled, your
CREATE TABLEwill fail and the following:will work. If
IGNORE_SPACEis disabled, the opposite will happen (CREATE TABLEwill work and aboveSELECTwill not because there is a space between function name and the parenthesis).