We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug Escaping does not work with reserved keywords in the query.
To Reproduce Steps to reproduce the behavior:
Expected behavior The table is created
Actual behavior
ERROR 1064 (42000): table 't': CREATE TABLE failed: attribute name 'order' is a reserved keyword
Describe the environment:
The text was updated successfully, but these errors were encountered:
Escaping helps in some cases, e.g. for table:
table
mysql> drop table if exists t; create table t(table int); Query OK, 0 rows affected (0.01 sec) ERROR 1064 (42000): P03: syntax error, unexpected TABLE, expecting identifier or tablename or MODIFY or TYPE near 'table int)'
mysql> drop table if exists t; create table t(`table` int); Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec)
but not for some others, e.g. order:
order
mysql> drop table if exists t; create table t(`order` int); Query OK, 0 rows affected (0.00 sec) ERROR 1064 (42000): table 't': CREATE TABLE failed: attribute name 'order' is a reserved keyword
Sorry, something went wrong.
Interesting that it works fine with table when it's escaped:
mysql> drop table if exists t; create table t(table text);; create table t(`table` text); -------------- drop table if exists t -------------- Query OK, 0 rows affected (0.01 sec) -------------- create table t(table text) -------------- ERROR 1064 (42000): P03: syntax error, unexpected TABLE, expecting identifier or tablename or MODIFY or TYPE near 'table text)' ERROR: No query specified -------------- create table t(`table` text) -------------- Query OK, 0 rows affected (0.00 sec)
klirichek
No branches or pull requests
Describe the bug
Escaping does not work with reserved keywords in the query.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The table is created
Actual behavior
Describe the environment:
The text was updated successfully, but these errors were encountered: