summaryrefslogtreecommitdiff
path: root/mysql-test/main/sp.result
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/main/sp.result')
-rw-r--r--mysql-test/main/sp.result104
1 files changed, 104 insertions, 0 deletions
diff --git a/mysql-test/main/sp.result b/mysql-test/main/sp.result
index 582ea33d903..f6f34318584 100644
--- a/mysql-test/main/sp.result
+++ b/mysql-test/main/sp.result
@@ -8571,3 +8571,107 @@ affected rows: 5
DROP PROCEDURE p1;
DROP PROCEDURE p2;
drop table t1;
+#
+# MDEV-15957 Unexpected "Data too long" when doing CREATE..SELECT with stored functions
+#
+CREATE TABLE t1 (a INT(3));
+INSERT INTO t1 VALUES (-999);
+CREATE FUNCTION f1(a INT(3)) RETURNS INT(3) RETURN a;
+CREATE TABLE t2 AS SELECT CONCAT(a) AS c1, CONCAT(COALESCE(a)) AS c2, CONCAT(f1(a)) AS c3 FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `c1` varchar(11) DEFAULT NULL,
+ `c2` varchar(11) DEFAULT NULL,
+ `c3` varchar(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1,t2;
+DROP FUNCTION f1;
+CREATE FUNCTION f1() RETURNS TINYTEXT CHARACTER SET latin1 RETURN '';
+CREATE TABLE t1 AS SELECT f1() AS c1, COALESCE(f1()) AS c2, CONCAT(f1()) AS c3;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` tinytext DEFAULT NULL,
+ `c2` tinytext DEFAULT NULL,
+ `c3` varchar(255) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+DROP FUNCTION f1;
+CREATE FUNCTION f1() RETURNS TEXT CHARACTER SET latin1 RETURN '';
+CREATE TABLE t1 AS SELECT f1() AS c1, COALESCE(f1()) AS c2, CONCAT(f1()) AS c3;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` text DEFAULT NULL,
+ `c2` text DEFAULT NULL,
+ `c3` text DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+DROP FUNCTION f1;
+CREATE FUNCTION f1() RETURNS MEDIUMTEXT CHARACTER SET latin1 RETURN '';
+CREATE TABLE t1 AS SELECT f1() AS c1, COALESCE(f1()) AS c2, CONCAT(f1()) AS c3;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` mediumtext DEFAULT NULL,
+ `c2` mediumtext DEFAULT NULL,
+ `c3` mediumtext DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+DROP FUNCTION f1;
+CREATE FUNCTION f1() RETURNS LONGTEXT CHARACTER SET latin1 RETURN '';
+CREATE TABLE t1 AS SELECT f1() AS c1, COALESCE(f1()) AS c2, CONCAT(f1()) AS c3;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` longtext DEFAULT NULL,
+ `c2` longtext DEFAULT NULL,
+ `c3` longtext DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+DROP FUNCTION f1;
+CREATE FUNCTION f1() RETURNS TINYTEXT CHARACTER SET utf8 RETURN '';
+CREATE TABLE t1 AS SELECT f1() AS c1, COALESCE(f1()) AS c2, CONCAT(f1()) AS c3;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` tinytext CHARACTER SET utf8 DEFAULT NULL,
+ `c2` text CHARACTER SET utf8 DEFAULT NULL,
+ `c3` varchar(255) CHARACTER SET utf8 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+DROP FUNCTION f1;
+CREATE FUNCTION f1() RETURNS TEXT CHARACTER SET utf8 RETURN '';
+CREATE TABLE t1 AS SELECT f1() AS c1, COALESCE(f1()) AS c2, CONCAT(f1()) AS c3;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` text CHARACTER SET utf8 DEFAULT NULL,
+ `c2` mediumtext CHARACTER SET utf8 DEFAULT NULL,
+ `c3` mediumtext CHARACTER SET utf8 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+DROP FUNCTION f1;
+CREATE FUNCTION f1() RETURNS MEDIUMTEXT CHARACTER SET utf8 RETURN '';
+CREATE TABLE t1 AS SELECT f1() AS c1, COALESCE(f1()) AS c2, CONCAT(f1()) AS c3;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` mediumtext CHARACTER SET utf8 DEFAULT NULL,
+ `c2` longtext CHARACTER SET utf8 DEFAULT NULL,
+ `c3` longtext CHARACTER SET utf8 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+DROP FUNCTION f1;
+CREATE FUNCTION f1() RETURNS LONGTEXT CHARACTER SET utf8 RETURN '';
+CREATE TABLE t1 AS SELECT f1() AS c1, COALESCE(f1()) AS c2, CONCAT(f1()) AS c3;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` longtext CHARACTER SET utf8 DEFAULT NULL,
+ `c2` longtext CHARACTER SET utf8 DEFAULT NULL,
+ `c3` longtext CHARACTER SET utf8 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+DROP FUNCTION f1;