Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Not a Bug
-
N/A
-
None
Description
The following erroneous statement
MariaDB [test]> create or replace table t1 (i int) with versioning partition by system_time interval 1 day (partition p0 versioning, partition pn as of current_timestamp); |
naturally ends with a syntax error, however the hint about the error location is not helpful:
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'partition by system_time interval 1 day (partition p0 versioning, partition pn a' at line 1 |
WITH <something> clause is accepted here because we can have a CTE in the CREATE statement
MariaDB [test]> create table t1 (i int) with foo as (select 1) select * from foo; |
Query OK, 1 row affected (0.16 sec)
|
and versioning is accepted as a CTE name (or as any other identifier, for that matter):
MariaDB [test]> with versioning as (select 1) select * from versioning; |
+---+ |
| 1 |
|
+---+ |
| 1 |
|
+---+ |
1 row in set (0.00 sec) |
 |
MariaDB [test]> create table versioning (i int); |
Query OK, 0 rows affected (0.19 sec) |
The standard says VERSIONING is a reserved word, so I'm not sure it should be allowed as an identifier.