@@ -9224,7 +9224,6 @@ where
92249224 },
92259225 },
92269226 {
9227- Skip : true ,
92289227 Query : "select e from t where e like 'a%' order by e;" ,
92299228 Expected : []sql.Row {
92309229 {"abc" },
@@ -9389,6 +9388,39 @@ where
93899388 },
93909389 },
93919390 },
9391+ {
9392+ Name : "Convert enum columns to string columns with alter table" ,
9393+ Dialect : "mysql" ,
9394+ SetUpScript : []string {
9395+ "create table t(pk int primary key, c0 enum('a', 'b', 'c'));" ,
9396+ "insert into t values(0, 'a'), (1, 'b'), (2, 'c');" ,
9397+ "alter table t modify column c0 varchar(100);" ,
9398+ },
9399+ Assertions : []ScriptTestAssertion {
9400+ {
9401+ Query : "select * from t" ,
9402+ Expected : []sql.Row {{0 , "a" }, {1 , "b" }, {2 , "c" }},
9403+ },
9404+ },
9405+ },
9406+ {
9407+ // https://github.com/dolthub/dolt/issues/9613
9408+ Skip : true ,
9409+ Name : "Convert enum columns to string columns when copying table" ,
9410+ Dialect : "mysql" ,
9411+ SetUpScript : []string {
9412+ "create table t(pk int primary key, c0 enum('a', 'b', 'c'));" ,
9413+ "insert into t values(0, 'a'), (1, 'b'), (2, 'c');" ,
9414+ "create table tt(pk int primary key, c0 varchar(10))" ,
9415+ "insert into tt select * from t" ,
9416+ },
9417+ Assertions : []ScriptTestAssertion {
9418+ {
9419+ Query : "select * from tt" ,
9420+ Expected : []sql.Row {{0 , "a" }, {1 , "b" }, {2 , "c" }},
9421+ },
9422+ },
9423+ },
93929424 {
93939425 Name : "enums with foreign keys" ,
93949426 Dialect : "mysql" ,
@@ -10001,6 +10033,39 @@ where
1000110033 },
1000210034 },
1000310035 },
10036+ {
10037+ Name : "Convert set columns to string columns with alter table" ,
10038+ Dialect : "mysql" ,
10039+ SetUpScript : []string {
10040+ "create table t(pk int primary key, c0 set('abc', 'def','ghi'))" ,
10041+ "insert into t values(0, 'abc,def'), (1, 'def'), (2, 'ghi');" ,
10042+ "alter table t modify column c0 varchar(100);" ,
10043+ },
10044+ Assertions : []ScriptTestAssertion {
10045+ {
10046+ Query : "select * from t" ,
10047+ Expected : []sql.Row {{0 , "abc,def" }, {1 , "def" }, {2 , "ghi" }},
10048+ },
10049+ },
10050+ },
10051+ {
10052+ // https://github.com/dolthub/dolt/issues/9613
10053+ Skip : true ,
10054+ Name : "Convert set columns to string columns when copying table" ,
10055+ Dialect : "mysql" ,
10056+ SetUpScript : []string {
10057+ "create table t(pk int primary key, c0 set('abc', 'def','ghi'))" ,
10058+ "insert into t values(0, 'abc,def'), (1, 'def'), (2, 'ghi');" ,
10059+ "create table tt(pk int primary key, c0 varchar(10))" ,
10060+ "insert into tt select * from t" ,
10061+ },
10062+ Assertions : []ScriptTestAssertion {
10063+ {
10064+ Query : "select * from tt" ,
10065+ Expected : []sql.Row {{0 , "abc,def" }, {1 , "def" }, {2 , "ghi" }},
10066+ },
10067+ },
10068+ },
1000410069 {
1000510070 Name : "set with duplicates" ,
1000610071 Dialect : "mysql" ,
0 commit comments