Skip to content

Commit 8145826

Browse files
authored
NULL to nil (#2433)
1 parent bea58f6 commit 8145826

File tree

9 files changed

+253
-225
lines changed

9 files changed

+253
-225
lines changed

enginetest/enginetests.go

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2607,13 +2607,13 @@ func TestCreateTable(t *testing.T, harness Harness) {
26072607
RunQueryWithContext(t, e, harness, ctx, "CREATE TABLE test2 like test")
26082608

26092609
RunQueryWithContext(t, e, harness, ctx, "ALTER TABLE test2 modify pk int")
2610-
TestQueryWithContext(t, ctx, e, harness, "DESCRIBE test2", []sql.Row{{"pk", "int", "NO", "PRI", "NULL", ""},
2611-
{"val", "int", "YES", "", "NULL", ""}}, nil, nil)
2610+
TestQueryWithContext(t, ctx, e, harness, "DESCRIBE test2", []sql.Row{{"pk", "int", "NO", "PRI", nil, ""},
2611+
{"val", "int", "YES", "", nil, ""}}, nil, nil)
26122612

26132613
RunQueryWithContext(t, e, harness, ctx, "ALTER TABLE test2 drop primary key")
26142614

2615-
TestQueryWithContext(t, ctx, e, harness, "DESCRIBE test2", []sql.Row{{"pk", "int", "NO", "", "NULL", ""},
2616-
{"val", "int", "YES", "", "NULL", ""}}, nil, nil)
2615+
TestQueryWithContext(t, ctx, e, harness, "DESCRIBE test2", []sql.Row{{"pk", "int", "NO", "", nil, ""},
2616+
{"val", "int", "YES", "", nil, ""}}, nil, nil)
26172617
})
26182618

26192619
for _, tt := range queries.BrokenCreateTableQueries {
@@ -2818,8 +2818,8 @@ func TestRenameColumn(t *testing.T, harness Harness) {
28182818
TestQueryWithContext(t, ctx, e, harness, "select database()", []sql.Row{{nil}}, nil, nil)
28192819
TestQueryWithContext(t, ctx, e, harness, "ALTER TABLE mydb.tabletest RENAME COLUMN s TO i1", []sql.Row{{types.NewOkResult(0)}}, nil, nil)
28202820
TestQueryWithContext(t, ctx, e, harness, "SHOW FULL COLUMNS FROM mydb.tabletest", []sql.Row{
2821-
{"i", "int", nil, "NO", "PRI", "NULL", "", "", ""},
2822-
{"i1", "varchar(20)", "utf8mb4_0900_bin", "NO", "", "NULL", "", "", ""},
2821+
{"i", "int", nil, "NO", "PRI", nil, "", "", ""},
2822+
{"i1", "varchar(20)", "utf8mb4_0900_bin", "NO", "", nil, "", "", ""},
28232823
}, nil, nil)
28242824
})
28252825
}
@@ -2843,14 +2843,14 @@ func TestAddColumn(t *testing.T, harness Harness) {
28432843
TestQueryWithContext(t, ctx, e, harness, "ALTER TABLE mydb.mytable ADD COLUMN s10 VARCHAR(26)", []sql.Row{{types.NewOkResult(0)}}, nil, nil)
28442844
TestQueryWithContext(t, ctx, e, harness, "SHOW FULL COLUMNS FROM mydb.mytable", []sql.Row{
28452845
{"s3", "varchar(25)", "utf8mb4_0900_bin", "YES", "", "'yay'", "", "", "hello"},
2846-
{"s4", "varchar(1)", "utf8mb4_0900_bin", "NO", "", "NULL", "", "", ""},
2847-
{"i", "bigint", nil, "NO", "PRI", "NULL", "", "", ""},
2848-
{"s2", "text", "utf8mb4_0900_bin", "YES", "", "NULL", "", "", "hello"},
2849-
{"s", "varchar(20)", "utf8mb4_0900_bin", "NO", "UNI", "NULL", "", "", "column s"},
2846+
{"s4", "varchar(1)", "utf8mb4_0900_bin", "NO", "", nil, "", "", ""},
2847+
{"i", "bigint", nil, "NO", "PRI", nil, "", "", ""},
2848+
{"s2", "text", "utf8mb4_0900_bin", "YES", "", nil, "", "", "hello"},
2849+
{"s", "varchar(20)", "utf8mb4_0900_bin", "NO", "UNI", nil, "", "", "column s"},
28502850
{"i2", "int", nil, "YES", "", "42", "", "", "hello"},
2851-
{"s5", "varchar(26)", "utf8mb4_0900_bin", "YES", "", "NULL", "", "", ""},
2852-
{"s6", "varchar(27)", "utf8mb4_0900_bin", "YES", "", "NULL", "", "", ""},
2853-
{"s10", "varchar(26)", "utf8mb4_0900_bin", "YES", "", "NULL", "", "", ""},
2851+
{"s5", "varchar(26)", "utf8mb4_0900_bin", "YES", "", nil, "", "", ""},
2852+
{"s6", "varchar(27)", "utf8mb4_0900_bin", "YES", "", nil, "", "", ""},
2853+
{"s10", "varchar(26)", "utf8mb4_0900_bin", "YES", "", nil, "", "", ""},
28542854
}, nil, nil)
28552855
})
28562856
}
@@ -2873,9 +2873,9 @@ func TestModifyColumn(t *testing.T, harness Harness) {
28732873
TestQueryWithContext(t, ctx, e, harness, "select database()", []sql.Row{{nil}}, nil, nil)
28742874
TestQueryWithContext(t, ctx, e, harness, "ALTER TABLE mydb.mytable MODIFY COLUMN s VARCHAR(21) NULL COMMENT 'changed again'", []sql.Row{{types.NewOkResult(0)}}, nil, nil)
28752875
TestQueryWithContext(t, ctx, e, harness, "SHOW FULL COLUMNS FROM mydb.mytable", []sql.Row{
2876-
{"i", "bigint", nil, "NO", "PRI", "NULL", "", "", "ok"},
2877-
{"s", "varchar(21)", "utf8mb4_0900_bin", "YES", "", "NULL", "", "", "changed again"},
2878-
{"i2", "bigint", nil, "YES", "", "NULL", "", "", ""},
2876+
{"i", "bigint", nil, "NO", "PRI", nil, "", "", "ok"},
2877+
{"s", "varchar(21)", "utf8mb4_0900_bin", "YES", "", nil, "", "", "changed again"},
2878+
{"i2", "bigint", nil, "YES", "", nil, "", "", ""},
28792879
}, nil, nil)
28802880
})
28812881
}
@@ -2898,7 +2898,7 @@ func TestDropColumn(t *testing.T, harness Harness) {
28982898

28992899
TestQueryWithContext(t, ctx, e, harness, "select database()", []sql.Row{{nil}}, nil, nil)
29002900
TestQueryWithContext(t, ctx, e, harness, "ALTER TABLE mydb.tabletest DROP COLUMN s", []sql.Row{{types.NewOkResult(0)}}, nil, nil)
2901-
TestQueryWithContext(t, ctx, e, harness, "SHOW FULL COLUMNS FROM mydb.tabletest", []sql.Row{{"i", "int", nil, "NO", "PRI", "NULL", "", "", ""}}, nil, nil)
2901+
TestQueryWithContext(t, ctx, e, harness, "SHOW FULL COLUMNS FROM mydb.tabletest", []sql.Row{{"i", "int", nil, "NO", "PRI", nil, "", "", ""}}, nil, nil)
29022902
})
29032903
}
29042904

@@ -2920,7 +2920,7 @@ func TestDropColumnKeylessTables(t *testing.T, harness Harness) {
29202920

29212921
TestQueryWithContext(t, ctx, e, harness, "select database()", []sql.Row{{nil}}, nil, nil)
29222922
TestQueryWithContext(t, ctx, e, harness, "ALTER TABLE mydb.tabletest DROP COLUMN s", []sql.Row{{types.NewOkResult(0)}}, nil, nil)
2923-
TestQueryWithContext(t, ctx, e, harness, "SHOW FULL COLUMNS FROM mydb.tabletest", []sql.Row{{"i", "int", nil, "NO", "PRI", "NULL", "", "", ""}}, nil, nil)
2923+
TestQueryWithContext(t, ctx, e, harness, "SHOW FULL COLUMNS FROM mydb.tabletest", []sql.Row{{"i", "int", nil, "NO", "PRI", nil, "", "", ""}}, nil, nil)
29242924
})
29252925
}
29262926

0 commit comments

Comments
 (0)