You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Altering a table by adding a new column named period will fail. period is not a reserved name, but the combination of add and period is a reserved name (another operation).
ref: MariaDB documentation for ADD PERIOD
ALTERTABLE the_table ADD period INT DEFAULT 30NOT NULL;
Error:
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your
SQL syntax; check the manual that corresponds to your MariaDB server version for t
he right syntax to use near 'INT DEFAULT 30 NOT NULL' at line 1
How to reproduce
Use MariaDB 10.6
Create a table
Alter the table by adding a column named period
Expected behaviour
The column name should be quoted to prevent this issue, so the generated SQL should look like:
Bug Report
Summary
Altering a table by adding a new column named
period
will fail.period
is not a reserved name, but the combination ofadd
andperiod
is a reserved name (another operation).ref: MariaDB documentation for ADD PERIOD
Example:
Current behaviour
Generated SQL:
Error:
How to reproduce
period
Expected behaviour
The column name should be quoted to prevent this issue, so the generated SQL should look like:
The text was updated successfully, but these errors were encountered: