Skip to content

Commit f722c60

Browse files
committed
added test for altering column comments
1 parent 2dd4300 commit f722c60

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

enginetest/queries/alter_table_queries.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,6 +1029,23 @@ var AlterTableScripts = []ScriptTest{
10291029
},
10301030
},
10311031
},
1032+
{
1033+
Name: "alter table comments are escaped",
1034+
SetUpScript: []string{
1035+
"create table t (i int);",
1036+
`alter table t modify column i int comment "newline \n | return \r | backslash \\ | NUL \0 \x00"`,
1037+
`alter table t add column j int comment "newline \n | return \r | backslash \\ | NUL \0 \x00"`,
1038+
},
1039+
Assertions: []ScriptTestAssertion{
1040+
{
1041+
Query: "show create table t",
1042+
Expected: []sql.Row{{
1043+
"t",
1044+
"CREATE TABLE `t` (\n `i` int COMMENT 'newline \\n | return \\r | backslash \\\\ | NUL \\0 x00'," +
1045+
"\n `j` int COMMENT 'newline \\n | return \\r | backslash \\\\ | NUL \\0 x00'\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"}},
1046+
},
1047+
},
1048+
},
10321049
}
10331050

10341051
var RenameTableScripts = []ScriptTest{

0 commit comments

Comments
 (0)