Context
I encounter a bug in our application related to MySQL table names. Our application generates table names as a 24 hexadecimal digits number (i.e.: 5e09c9c09e9ba0cceccb3701
).
Everything went fine for a while, but suddenly we started to see SQL syntax errors with certain table names. The bug was easy to fix : we needed to protect the table name.
SQL syntax error :
select * from 5e09c9c09e9ba0cceccb3701;
No error :
select * from `5e09c9c09e9ba0cceccb3701`;
Question
Why table names starting with 5e09
need to be protected ?
I went through the MySQL documentation for reserved words or hexadecimal literal notation, but I cannot find any explanation for the special interpretation of 5e09
in a SQL statement.
And, if anyone knows, what other special prefix might also break the syntax of an SQL statement ?