@@ -7531,6 +7531,71 @@ where
75317531 },
75327532 },
75337533 },
7534+ {
7535+ Name : "multi enum return types" ,
7536+ SetUpScript : []string {
7537+ "create table t (i int primary key, e enum('abc', 'def', 'ghi'));" ,
7538+ "insert into t values (1, 'abc'), (2, 'def'), (3, 'ghi');" ,
7539+ },
7540+ Assertions : []ScriptTestAssertion {
7541+ {
7542+ Query : "select i, (case e when 'abc' then e when 'def' then e when 'ghi' then e end) as e from t;" ,
7543+ Expected : []sql.Row {
7544+ {1 , "abc" },
7545+ {2 , "def" },
7546+ {3 , "ghi" },
7547+ },
7548+ },
7549+ {
7550+ // https://github.com/dolthub/dolt/issues/8598
7551+ Skip : true ,
7552+ Query : "select i, (case e when 'abc' then e when 'def' then e when 'ghi' then 'something' end) as e from t;" ,
7553+ Expected : []sql.Row {
7554+ {1 , "abc" },
7555+ {2 , "def" },
7556+ {3 , "something" },
7557+ },
7558+ },
7559+ {
7560+ // https://github.com/dolthub/dolt/issues/8598
7561+ Skip : true ,
7562+ Query : "select i, (case e when 'abc' then e when 'def' then e when 'ghi' then 123 end) as e from t;" ,
7563+ Expected : []sql.Row {
7564+ {1 , "abc" },
7565+ {2 , "def" },
7566+ {3 , "123" },
7567+ },
7568+ },
7569+ },
7570+ },
7571+ {
7572+ // https://github.com/dolthub/dolt/issues/8598
7573+ Name : "enum cast to int and string" ,
7574+ SetUpScript : []string {
7575+ "create table t (i int primary key, e enum('abc', 'def', 'ghi'));" ,
7576+ "insert into t values (1, 'abc'), (2, 'def'), (3, 'ghi');" ,
7577+ },
7578+ Assertions : []ScriptTestAssertion {
7579+ {
7580+ Skip : true ,
7581+ Query : "select i, cast(e as signed) from t;" ,
7582+ Expected : []sql.Row {
7583+ {1 , 1 },
7584+ {2 , 2 },
7585+ {3 , 3 },
7586+ },
7587+ },
7588+ {
7589+ Skip : true ,
7590+ Query : "select i, cast(e as char) from t;" ,
7591+ Expected : []sql.Row {
7592+ {1 , "abc" },
7593+ {2 , "def" },
7594+ {3 , "ghi" },
7595+ },
7596+ },
7597+ },
7598+ },
75347599}
75357600
75367601var SpatialScriptTests = []ScriptTest {
0 commit comments