diff --git a/src/cst/CreateTable.ts b/src/cst/CreateTable.ts index 0ec9507e..d8b77304 100644 --- a/src/cst/CreateTable.ts +++ b/src/cst/CreateTable.ts @@ -114,7 +114,8 @@ type TableOptionNameMysql = | Keyword<"STATS_PERSISTENT"> | Keyword<"STATS_SAMPLE_PAGES"> | Keyword<"TABLESPACE"> - | Keyword<"STORAGE">; + | Keyword<"STORAGE"> + | Keyword<"UNION">; type TableOptionValueMysql = Keyword< | "DEFAULT" diff --git a/src/parser.pegjs b/src/parser.pegjs index 226691b1..45bcab3a 100644 --- a/src/parser.pegjs +++ b/src/parser.pegjs @@ -3622,11 +3622,13 @@ mysql_table_opt_name / STATS_SAMPLE_PAGES / TABLESPACE / STORAGE + / UNION mysql_table_opt_value = string_literal / number_literal / ident + / paren$list$entity_name // for UNION / DEFAULT / DYNAMIC / FIXED / COMPRESSED / REDUNDANT / COMPACT // for ROW_FORMAT / NO / FIRST / LAST // for INSERT_METHOD diff --git a/test/ddl/create_table_mysql.test.ts b/test/ddl/create_table_mysql.test.ts index 856e5df1..2eddc56a 100644 --- a/test/ddl/create_table_mysql.test.ts +++ b/test/ddl/create_table_mysql.test.ts @@ -42,6 +42,7 @@ describe("create table (MySQL)", () => { // The STORAGE option is linked to TABLESPACE option before it according to MySQL docs, // but really the syntax seems to allow any order, including separating them with commas. ["STORAGE", ["DISK", "MEMORY"]], + ["UNION", ["(t1, t2, my_schema.t3)"]], ] as [string, string[]][] ).forEach(([name, values]) => { values.forEach((value) => {