sql-parser
sql-parser copied to clipboard
Add support for CREATE TABLE tbl AS query_expression
Currently the parser does not recognize CREATE TABLE statements in the form of CREATE TABLE tbl AS (SELECT 1).
Relevant syntax (link):
CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name
[(create_definition,...)]
[table_options]
[partition_options]
[IGNORE | REPLACE]
[AS] query_expression #<<<
phpMyAdmin version: 4.7.4
Confirmed on current master:
$ ./bin/lint-query --query 'CREATE TABLE tbl AS (SELECT 1)'
#1: An opening bracket was expected. (near "AS" at position 17)
#2: At least one column definition was expected. (near " " at position 16)
#3: Unexpected token. (near ")" at position 29)