File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11vendor
2+ .idea
Original file line number Diff line number Diff line change @@ -32,3 +32,23 @@ func TestCreateTableParsing(t *testing.T) {
3232 ` )
3333 checkErr (t , err )
3434}
35+
36+ func TestCreateTableWithPartition (t * testing.T ) {
37+ _ , err := Parse (`
38+ CREATE TABLE histories (
39+ id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
40+ user_id bigint(20) unsigned NOT NULL,
41+ note text NOT NULL,
42+ created_at datetime NOT NULL,
43+ updated_at datetime NOT NULL,
44+ PRIMARY KEY (id,created_at)
45+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
46+ /*!50500 PARTITION BY RANGE COLUMNS(created_at)
47+ (PARTITION p201812 VALUES LESS THAN ('2019-01-01') ENGINE = InnoDB,
48+ PARTITION p201901 VALUES LESS THAN ('2019-02-01') ENGINE = InnoDB,
49+ PARTITION p201902 VALUES LESS THAN ('2019-03-01') ENGINE = InnoDB,
50+ PARTITION p201903 VALUES LESS THAN ('2019-04-01') ENGINE = InnoDB) */;
51+ ` )
52+
53+ checkErr (t , err )
54+ }
You can’t perform that action at this time.
0 commit comments