Skip to content

Commit 340f3c8

Browse files
committed
add tests
1 parent 83decf7 commit 340f3c8

File tree

1 file changed

+63
-1
lines changed

1 file changed

+63
-1
lines changed

enginetest/queries/script_queries.go

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9224,7 +9224,7 @@ where
92249224
},
92259225
},
92269226
{
9227-
Skip: true,
9227+
// Skip: true,
92289228
Query: "select e from t where e like 'a%' order by e;",
92299229
Expected: []sql.Row{
92309230
{"abc"},
@@ -9389,6 +9389,37 @@ where
93899389
},
93909390
},
93919391
},
9392+
{
9393+
Name: "Convert enum columns to string columns with alter table",
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+
SetUpScript: []string{
9411+
"create table t(pk int primary key, c0 enum('a', 'b', 'c'));",
9412+
"insert into t values(0, 'a'), (1, 'b'), (2, 'c');",
9413+
"create table tt(pk int primary key, c0 varchar(10))",
9414+
"insert into tt select * from t",
9415+
},
9416+
Assertions: []ScriptTestAssertion{
9417+
{
9418+
Query: "select * from tt",
9419+
Expected: []sql.Row{{0, "a"}, {1, "b"}, {2, "c"}},
9420+
},
9421+
},
9422+
},
93929423
{
93939424
Name: "enums with foreign keys",
93949425
Dialect: "mysql",
@@ -10001,6 +10032,37 @@ where
1000110032
},
1000210033
},
1000310034
},
10035+
{
10036+
Name: "Convert set columns to string columns with alter table",
10037+
SetUpScript: []string{
10038+
"create table t(pk int primary key, c0 set('abc', 'def','ghi'))",
10039+
"insert into t values(0, 'abc,def'), (1, 'def'), (2, 'ghi');",
10040+
"alter table t modify column c0 varchar(100);",
10041+
},
10042+
Assertions: []ScriptTestAssertion{
10043+
{
10044+
Query: "select * from t",
10045+
Expected: []sql.Row{{0, "abc,def"}, {1, "def"}, {2, "ghi"}},
10046+
},
10047+
},
10048+
},
10049+
{
10050+
// https://github.com/dolthub/dolt/issues/9613
10051+
Skip: true,
10052+
Name: "Convert set columns to string columns when copying table",
10053+
SetUpScript: []string{
10054+
"create table t(pk int primary key, c0 set('abc', 'def','ghi'))",
10055+
"insert into t values(0, 'abc,def'), (1, 'def'), (2, 'ghi');",
10056+
"create table tt(pk int primary key, c0 varchar(10))",
10057+
"insert into tt select * from t",
10058+
},
10059+
Assertions: []ScriptTestAssertion{
10060+
{
10061+
Query: "select * from tt",
10062+
Expected: []sql.Row{{0, "abc,def"}, {1, "def"}, {2, "ghi"}},
10063+
},
10064+
},
10065+
},
1000410066
{
1000510067
Name: "set with duplicates",
1000610068
Dialect: "mysql",

0 commit comments

Comments
 (0)