Skip to content

Commit 057517b

Browse files
author
Yuki Eto
committed
fix test
1 parent fbd1e16 commit 057517b

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
vendor
2+
.idea

sqlparser/sqlparser_test.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
}

0 commit comments

Comments
 (0)