File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -590,7 +590,7 @@ pub trait Dialect: Debug + Any {
590
590
false
591
591
}
592
592
593
- /// Returne true if the dialect supports specifying multiple options
593
+ /// Return true if the dialect supports specifying multiple options
594
594
/// in a `CREATE TABLE` statement for the structure of the new table. For example:
595
595
/// `CREATE TABLE t (a INT, b INT) AS SELECT 1 AS b, 2 AS a`
596
596
fn supports_create_table_multi_schema_info_sources ( & self ) -> bool {
Original file line number Diff line number Diff line change @@ -7708,6 +7708,9 @@ impl<'a> Parser<'a> {
7708
7708
7709
7709
while let Some(option) = self.parse_plain_option()? {
7710
7710
options.push(option);
7711
+ // Some dialects support comma-separated options; it shouldn't introduce ambiguity to
7712
+ // consume it for all dialects.
7713
+ let _ = self.consume_token(&Token::Comma);
7711
7714
}
7712
7715
7713
7716
Ok(options)
Original file line number Diff line number Diff line change @@ -1361,6 +1361,13 @@ fn parse_create_table_gencol() {
1361
1361
mysql_and_generic ( ) . verified_stmt ( "CREATE TABLE t1 (a INT, b INT AS (a * 2) STORED)" ) ;
1362
1362
}
1363
1363
1364
+ #[ test]
1365
+ fn parse_create_table_options_comma_separated ( ) {
1366
+ let sql = "CREATE TABLE t (x INT) DEFAULT CHARSET = utf8mb4, ENGINE = InnoDB , AUTO_INCREMENT 1 DATA DIRECTORY '/var/lib/mysql/data'" ;
1367
+ let canonical = "CREATE TABLE t (x INT) DEFAULT CHARSET = utf8mb4 ENGINE = InnoDB AUTO_INCREMENT = 1 DATA DIRECTORY = '/var/lib/mysql/data'" ;
1368
+ mysql_and_generic ( ) . one_statement_parses_to ( sql, canonical) ;
1369
+ }
1370
+
1364
1371
#[ test]
1365
1372
fn parse_quote_identifiers ( ) {
1366
1373
let sql = "CREATE TABLE `PRIMARY` (`BEGIN` INT PRIMARY KEY)" ;
You can’t perform that action at this time.
0 commit comments