mariadb/mysql-test/suite/innodb/t/innodb_bug54044.test
Sergei Golubchik 948056c535 MDEV-5787 Server crashes in in row_mysql_convert_row_to_innobase on CREATE .. SELECT
XtraDB: don't accept MYSQL_TYPE_NULL as a column type
2014-03-19 09:57:57 +01:00

26 lines
809 B
Text

# This is the test for bug #54044. Special handle MYSQL_TYPE_NULL type
# during create table, so it will not trigger assertion failure.
--source include/have_innodb.inc
# This 'create table' operation no longer uses the NULL datatype.
CREATE TEMPORARY TABLE table_54044 ENGINE = INNODB
AS SELECT IF(NULL IS NOT NULL, NULL, NULL);
SHOW CREATE TABLE table_54044;
DROP TABLE table_54044;
CREATE TABLE tmp ENGINE = INNODB AS SELECT COALESCE(NULL, NULL, NULL), GREATEST(NULL, NULL), NULL;
SHOW CREATE TABLE tmp;
DROP TABLE tmp;
# These 'create table' operations should fail because of
# using NULL datatype
CREATE TABLE t1 (a VARCHAR(3)) ENGINE=InnoDB;
INSERT INTO t1 VALUES ('foo'),('bar');
FLUSH TABLES;
--error 1005
CREATE TEMPORARY TABLE tmp ENGINE=InnoDB AS SELECT VALUES(a) FROM t1;
DROP TABLE t1;