summaryrefslogtreecommitdiff
path: root/mysql-test/main/type_enum.test
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2022-07-08 15:29:23 +0400
committerAlexander Barkov <bar@mariadb.com>2022-07-08 15:29:23 +0400
commit380874549cb70a0c51ddf16e37c036c0d0138e58 (patch)
tree20e06d40a03a759fec434089223ddbb19978cb2a /mysql-test/main/type_enum.test
parenta5f78505d798ff973daed8cfec1e8486c89a23ed (diff)
downloadmariadb-git-380874549cb70a0c51ddf16e37c036c0d0138e58.tar.gz
MDEV-29062 Wrong result set metadata for a mix of INT+ENUM
Diffstat (limited to 'mysql-test/main/type_enum.test')
-rw-r--r--mysql-test/main/type_enum.test28
1 files changed, 28 insertions, 0 deletions
diff --git a/mysql-test/main/type_enum.test b/mysql-test/main/type_enum.test
index 6ff3e257feb..2d6938c27ae 100644
--- a/mysql-test/main/type_enum.test
+++ b/mysql-test/main/type_enum.test
@@ -551,3 +551,31 @@ SHOW CREATE TABLE t2;
SELECT * FROM t2;
DROP TABLE t2;
DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV-29062 Wrong result set metadata for a mix of INT+ENUM
+--echo #
+
+CREATE TABLE t1
+(
+ c_int INT,
+ c_enum ENUM('1')
+);
+
+CREATE TABLE t2 AS SELECT c_int FROM t1 UNION SELECT c_enum FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+
+CREATE OR REPLACE TABLE t2 AS SELECT COALESCE(c_int, c_enum) FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+
+--disable_ps_protocol
+--enable_metadata
+SELECT c_int FROM t1 UNION SELECT c_enum FROM t1;
+SELECT COALESCE(c_int, c_enum) FROM t1;
+--disable_metadata
+--enable_ps_protocol
+
+DROP TABLE t1;