@@ -2914,6 +2914,20 @@ var ScriptTests = []ScriptTest{
29142914 "insert into set_tbl values (6, 'b,c');" ,
29152915 "insert into set_tbl values (7, 'a,c');" ,
29162916 "insert into set_tbl values (8, 'a,b,c');" ,
2917+
2918+ "create table collate_tbl (i int primary key, s varchar(10) collate utf8mb4_0900_ai_ci);" ,
2919+ "insert into collate_tbl values (0, '');" ,
2920+ "insert into collate_tbl values (1, 'a');" ,
2921+ "insert into collate_tbl values (2, 'b');" ,
2922+ "insert into collate_tbl values (3, 'c');" ,
2923+ "insert into collate_tbl values (4, 'a,b');" ,
2924+ "insert into collate_tbl values (6, 'b,c');" ,
2925+ "insert into collate_tbl values (7, 'a,c');" ,
2926+ "insert into collate_tbl values (8, 'a,b,c');" ,
2927+
2928+ "create table enum_tbl (i int primary key, s enum('a','b','c'));" ,
2929+ "insert into enum_tbl values (0, 'a'), (1, 'b'), (2, 'c');" ,
2930+ "select i, s, find_in_set('a', s) from enum_tbl;" ,
29172931 },
29182932 Assertions : []ScriptTestAssertion {
29192933 {
@@ -2929,22 +2943,6 @@ var ScriptTests = []ScriptTest{
29292943 {8 , 1 },
29302944 },
29312945 },
2932- },
2933- },
2934- {
2935- Name : "find_in_set tests" ,
2936- SetUpScript : []string {
2937- "create table collate_tbl (i int primary key, s varchar(10) collate utf8mb4_0900_ai_ci);" ,
2938- "insert into collate_tbl values (0, '');" ,
2939- "insert into collate_tbl values (1, 'a');" ,
2940- "insert into collate_tbl values (2, 'b');" ,
2941- "insert into collate_tbl values (3, 'c');" ,
2942- "insert into collate_tbl values (4, 'a,b');" ,
2943- "insert into collate_tbl values (6, 'b,c');" ,
2944- "insert into collate_tbl values (7, 'a,c');" ,
2945- "insert into collate_tbl values (8, 'a,b,c');" ,
2946- },
2947- Assertions : []ScriptTestAssertion {
29482946 {
29492947 Query : "select i, find_in_set('A', s) from collate_tbl;" ,
29502948 Expected : []sql.Row {
@@ -2958,6 +2956,14 @@ var ScriptTests = []ScriptTest{
29582956 {8 , 1 },
29592957 },
29602958 },
2959+ {
2960+ Query : "select i, find_in_set('a', s) from enum_tbl;" ,
2961+ Expected : []sql.Row {
2962+ {0 , 1 },
2963+ {1 , 0 },
2964+ {2 , 0 },
2965+ },
2966+ },
29612967 },
29622968 },
29632969}
0 commit comments