Skip to content

Commit

Permalink
Merge pull request #1452 from zendesk/ben/issue_1438
Browse files Browse the repository at this point in the history
fixes for issue #1438, defaults can be paren-enclosed in latest mysqls
  • Loading branch information
osheroff authored Mar 25, 2020
2 parents ba5d07c + db71d5e commit e29f3be
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/antlr4/imports/column_definitions.g4
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ charset_def: character_set | ASCII;
character_set: ((CHARACTER SET) | CHARSET) charset_name;

nullability: (NOT NULL | NULL);
default_value: DEFAULT (literal_with_weirdo_multistring | CURRENT_TIMESTAMP current_timestamp_length? | now_function | localtime_function);
default_value: DEFAULT '('? (literal_with_weirdo_multistring | CURRENT_TIMESTAMP current_timestamp_length? | now_function | localtime_function) ')'?;
length: '(' INTEGER_LITERAL ')';
int_flags: ( SIGNED | UNSIGNED | ZEROFILL );
decimal_length: '(' INTEGER_LITERAL ( ',' INTEGER_LITERAL )? ')';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,9 @@ public void testParsingSomeAlters() {
"create table foo.order ( i int )",
"alter table foo.int add column bar varchar(255)",
"alter table something collate = default",
"ALTER TABLE t DROP t.foo"
"ALTER TABLE t DROP t.foo",
"alter table f add column i varchar(255) default ('environment,namespace,table_name')"


};

Expand Down

0 comments on commit e29f3be

Please sign in to comment.