Skip to content

Commit bdeaafc

Browse files
committed
add alter table tests
1 parent d0ea2cc commit bdeaafc

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

enginetest/queries/script_queries.go

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9002,12 +9002,30 @@ where
90029002
{
90039003
Name: "enums with auto increment",
90049004
Dialect: "mysql",
9005-
SetUpScript: []string{},
9005+
SetUpScript: []string{
9006+
"CREATE TABLE t (e enum('a', 'b', 'c') PRIMARY KEY)",
9007+
},
90069008
Assertions: []ScriptTestAssertion{
90079009
{
9008-
Query: "create table t (e enum('a', 'b', 'c') primary key auto_increment);",
9010+
Query: "CREATE TABLE t2 (e enum('a', 'b', 'c') PRIMARY KEY AUTO_INCREMENT)",
9011+
ExpectedErrStr: "Incorrect column specifier for column 'e'",
9012+
},
9013+
{
9014+
Query: "ALTER TABLE t MODIFY e enum('a', 'b', 'c') AUTO_INCREMENT",
9015+
ExpectedErrStr: "Incorrect column specifier for column 'e'",
9016+
},
9017+
{
9018+
Query: "ALTER TABLE t MODIFY COLUMN e enum('a', 'b', 'c') AUTO_INCREMENT",
90099019
ExpectedErrStr: "Incorrect column specifier for column 'e'",
90109020
},
9021+
{
9022+
Query: "ALTER TABLE t CHANGE e e enum('a', 'b', 'c') AUTO_INCREMENT",
9023+
ExpectedErrStr: "Incorrect column specifier for column 'e'",
9024+
},
9025+
{
9026+
Query: "ALTER TABLE t CHANGE COLUMN e e enum('a', 'b', 'c') AUTO_INCREMENT",
9027+
ExpectedErrStr: "Incorrect column specifier for column 'e'",
9028+
}
90119029
},
90129030
},
90139031
{

0 commit comments

Comments
 (0)