Skip to content

Commit 976e3b5

Browse files
committed
Comma is optional in table options of ALTER
1 parent 2731a0b commit 976e3b5

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

mysql/MySqlParser.g4

+1-1
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ alterView
578578
// details
579579

580580
alterSpecification
581-
: tableOption #alterByTableOption
581+
: tableOption (','? tableOption)* #alterByTableOption
582582
| ADD COLUMN? uid columnDefinition (FIRST | AFTER uid)? #alterByAddColumn
583583
| ADD COLUMN?
584584
'('

mysql/examples/ddl_alter.sql

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ alter table with_check add constraint c2 check (c1 in (1, 2, 3, 4));
1818
alter table with_check add check (c1 in (1, 2, 3, 4));
1919
alter table with_partition add partition (partition p201901 values less than (737425) engine = InnoDB);
2020
alter table with_partition add partition (partition p1 values less than (837425) engine = InnoDB, partition p2 values less than (MAXVALUE) engine = InnoDB);
21-
21+
alter table t1 stats_auto_recalc=default stats_sample_pages=50;
22+
alter table t1 stats_auto_recalc=default, stats_sample_pages=50;
2223
#end
2324
#begin
2425
-- Alter database

0 commit comments

Comments
 (0)