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 {
590590 false
591591 }
592592
593- /// Returne true if the dialect supports specifying multiple options
593+ /// Return true if the dialect supports specifying multiple options
594594 /// in a `CREATE TABLE` statement for the structure of the new table. For example:
595595 /// `CREATE TABLE t (a INT, b INT) AS SELECT 1 AS b, 2 AS a`
596596 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> {
77087708
77097709 while let Some(option) = self.parse_plain_option()? {
77107710 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);
77117714 }
77127715
77137716 Ok(options)
Original file line number Diff line number Diff line change @@ -1361,6 +1361,13 @@ fn parse_create_table_gencol() {
13611361 mysql_and_generic ( ) . verified_stmt ( "CREATE TABLE t1 (a INT, b INT AS (a * 2) STORED)" ) ;
13621362}
13631363
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+
13641371#[ test]
13651372fn parse_quote_identifiers ( ) {
13661373 let sql = "CREATE TABLE `PRIMARY` (`BEGIN` INT PRIMARY KEY)" ;
You can’t perform that action at this time.
0 commit comments