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
Fix AS query clause should be after the create table options
According to MySQL[1] and PostgreSQL[2] create table syntax,
the AS query should be sit after the table options. But it
is parsed before table options include CHARSET and COLLATE,
as well as ON COMMIT clause. This PR resolves this issue by
moving the position of AS query, and the issue apache#1274 will be
aslo resolved after this PR.
MySQL:
```
CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name
[(create_definition,...)]
[table_options]
[partition_options]
[IGNORE | REPLACE]
[AS] query_expression
```
PostgreSQL:
```
CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] TABLE [ IF NOT EXISTS ] table_name
[ (column_name [, ...] ) ]
[ USING method ]
[ WITH ( storage_parameter [= value] [, ... ] ) | WITHOUT OIDS ]
[ ON COMMIT { PRESERVE ROWS | DELETE ROWS | DROP } ]
[ TABLESPACE tablespace_name ]
AS query
[ WITH [ NO ] DATA ]
```
[1] https://dev.mysql.com/doc/refman/8.0/en/create-table.html
[2] https://www.postgresql.org/docs/current/sql-createtableas.html
0 commit comments