提交 ae2ede4b 编写于 作者: S SteNicholas 提交者: Liang Zhang

PostgreSQL parse create table statement keyword datatype (#3347)

* parse postgresql-keyword

* type keyword unreserved
上级 45b56016
......@@ -107,8 +107,7 @@ unreservedWord_
| IMPORT | CONCURRENT | XML | POSITION | SHARE | DUMPFILE | CLONE | AGGREGATE | INSTALL | UNINSTALL
| RESOURCE | FLUSH | RESET | RESTART | HOSTS | RELAY | EXPORT | USER_RESOURCES | SLOW | GENERAL | CACHE
| SUBJECT | ISSUER | OLD | RANDOM | RETAIN | MAX_USER_CONNECTIONS | MAX_CONNECTIONS_PER_HOUR | MAX_UPDATES_PER_HOUR
| MAX_QUERIES_PER_HOUR | REUSE | OPTIONAL | HISTORY | NEVER | EXPIRE
| MAX_QUERIES_PER_HOUR | REUSE | OPTIONAL | HISTORY | NEVER | EXPIRE | TYPE | UNIX_TIMESTAMP | LOWER
;
schemaName
......
......@@ -92,7 +92,8 @@ unreservedWord_
| TEMP | TEMPORARY | TRIGGER | TYPE | UNBOUNDED | UNLOGGED | UPDATE
| USAGE | VALID | VALIDATE | WITHIN | WITHOUT | ZONE | GROUPS
| RECURSIVE | INSTANCE | DEFINER | PRESERVE | SQL | LOCAL | CASCADED
| CLOSE | OPEN | NEXT | NAME | NAMES | INTEGER | REAL | DECIMAL | TYPE
| CLOSE | OPEN | NEXT | NAME | NAMES | INTEGER | REAL | DECIMAL
| BOOLEAN | CHAR | TIME | TIMESTAMP | INTERVAL
;
schemaName
......
......@@ -25,7 +25,16 @@
<table-token start-index="13" table-name="t_log" length="5" />
</tokens>
</parser-result>
<parser-result sql-case-id="create_table_with_keyword">
<tables>
<table name="t_log" />
</tables>
<tokens>
<table-token start-index="26" table-name="t_log" length="5" />
</tokens>
</parser-result>
<parser-result sql-case-id="create_table_if_not_exists">
<tables>
<table name="t_log" />
......
......@@ -19,6 +19,10 @@
<ddl-test-case sql-case-id="create_table">
<assertion table="t_log" expected-data-file="create_table.xml" />
</ddl-test-case>
<ddl-test-case sql-case-id="create_table_with_keyword">
<assertion table="t_log" expected-data-file="create_table.xml" />
</ddl-test-case>
<ddl-test-case sql-case-id="create_table_if_not_exists">
<assertion table="t_log" expected-data-file="create_table.xml" />
......
......@@ -18,6 +18,7 @@
<sql-cases>
<sql-case id="create_table" value="CREATE TABLE t_log(id int PRIMARY KEY, status varchar(10))" />
<sql-case id="create_table_with_keyword" value="CREATE TABLE t_log(id int PRIMARY KEY, status boolean)" db-types="PostgreSQL" />
<sql-case id="create_table_if_not_exists" value="CREATE TABLE IF NOT EXISTS t_log(id int, status varchar(10))" db-types="MySQL,PostgreSQL" />
<sql-case id="create_temporary_table_if_not_exists" value="CREATE TEMPORARY TABLE IF NOT EXISTS t_temp_log(id int, status varchar(10))" db-types="MySQL,PostgreSQL" />
<sql-case id="create_global_temporary_table" value="CREATE GLOBAL TEMPORARY TABLE t_temp_log(id int, status varchar(10))" db-types="Oracle,PostgreSQL" />
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册