@@ -5480,26 +5480,12 @@ func TestAlterTable(t *testing.T, harness Harness) {
54805480 },
54815481 }, checks )
54825482 })
5483-
5484- t .Run ("ALTER TABLE modify with AUTO_INCREMENT" , func (t * testing.T ) {
5485- RunQuery (t , e , harness , "CREATE TABLE t40 (pk int AUTO_INCREMENT PRIMARY KEY, val int)" )
5486- RunQuery (t , e , harness , "INSERT into t40 VALUES (1, 1), (NULL, 2), (NULL, 3)" )
5487-
5488- RunQuery (t , e , harness , "ALTER TABLE t40 MODIFY COLUMN pk int" )
5489- ctx := harness .NewContext ()
5490- TestQueryWithContext (t , ctx , e , harness , "DESCRIBE t40" , []sql.Row {
5491- {"pk" , "int" , "NO" , "PRI" , "NULL" , "" },
5492- {"val" , "int" , "YES" , "" , "NULL" , "" }},
5493- nil , nil )
5494-
5495- AssertErr (t , e , harness , "INSERT INTO t40 VALUES (NULL, 4)" , sql .ErrInsertIntoNonNullableProvidedNull )
5496- RunQuery (t , e , harness , "DROP TABLE t40" )
5497-
5498- RunQuery (t , e , harness , "CREATE TABLE t40 (pk int AUTO_INCREMENT PRIMARY KEY, val int)" )
5499- RunQuery (t , e , harness , "INSERT into t40 VALUES (NULL, 1)" )
5483+ }
55005484
5501- TestQueryWithContext (t , ctx , e , harness , "SELECT * FROM t40" , []sql.Row {{1 , 1 }}, nil , nil )
5502- })
5485+ func TestAlterTableScripts (t * testing.T , harness Harness ) {
5486+ for _ , script := range queries .AlterTableScripts {
5487+ TestScript (t , harness , script )
5488+ }
55035489}
55045490
55055491func NewColumnDefaultValue (expr sql.Expression , outType sql.Type , representsLiteral , isParenthesized , mayReturnNil bool ) * sql.ColumnDefaultValue {
0 commit comments