diff options
Diffstat (limited to 'mysql-test/t')
-rw-r--r-- | mysql-test/t/auto_increment.test | 6 | ||||
-rw-r--r-- | mysql-test/t/auto_increment_ranges.inc | 56 | ||||
-rw-r--r-- | mysql-test/t/ctype_latin1.test | 1 | ||||
-rw-r--r-- | mysql-test/t/ctype_sjis.test | 1 | ||||
-rw-r--r-- | mysql-test/t/ctype_ucs.test | 1 | ||||
-rw-r--r-- | mysql-test/t/ctype_utf8.test | 1 | ||||
-rw-r--r-- | mysql-test/t/func_equal.test | 52 | ||||
-rw-r--r-- | mysql-test/t/replace.test | 4 | ||||
-rw-r--r-- | mysql-test/t/view.test | 28 |
9 files changed, 116 insertions, 34 deletions
diff --git a/mysql-test/t/auto_increment.test b/mysql-test/t/auto_increment.test index 15156b89d8e..7f0ab5dc169 100644 --- a/mysql-test/t/auto_increment.test +++ b/mysql-test/t/auto_increment.test @@ -104,7 +104,7 @@ explain extended select last_insert_id(); --error ER_DUP_ENTRY insert into t1 set i = 254; select last_insert_id(); ---error 167 +--error HA_ERR_AUTOINC_ERANGE insert into t1 set i = null; select last_insert_id(); drop table t1; @@ -113,7 +113,7 @@ create table t1 (i tinyint unsigned not null auto_increment, key (i)); insert into t1 set i = 254; insert into t1 set i = null; select last_insert_id(); ---error 167 +--error HA_ERR_AUTOINC_ERANGE insert into t1 set i = null; select last_insert_id(); drop table t1; @@ -354,7 +354,7 @@ INSERT INTO t1 VALUES (18446744073709551601); SET @@SESSION.AUTO_INCREMENT_INCREMENT=10; SELECT @@SESSION.AUTO_INCREMENT_OFFSET; ---error 167 +--error HA_ERR_AUTOINC_ERANGE INSERT INTO t1 VALUES (NULL), (NULL), (NULL); SELECT * FROM t1; diff --git a/mysql-test/t/auto_increment_ranges.inc b/mysql-test/t/auto_increment_ranges.inc index a94aa46d38e..1540be0828e 100644 --- a/mysql-test/t/auto_increment_ranges.inc +++ b/mysql-test/t/auto_increment_ranges.inc @@ -13,25 +13,25 @@ let $range_max=32767; eval create table t1 (a $type primary key auto_increment); eval insert into t1 values($range_max); ---error 167 +--error HA_ERR_AUTOINC_ERANGE insert into t1 values(NULL); truncate table t1; eval insert into t1 values($range_max-1); insert into t1 values(NULL); ---error 167 +--error HA_ERR_AUTOINC_ERANGE insert into t1 values(NULL); select * from t1; truncate table t1; ---error 167 +--error HA_ERR_AUTOINC_ERANGE eval insert into t1 values($range_max),(NULL); select * from t1; truncate table t1; ---error 167 +--error HA_ERR_AUTOINC_ERANGE eval insert into t1 values($range_max-1),(NULL),(NULL); truncate table t1; eval insert into t1 values($range_max+1); select * from t1; ---error 167 +--error HA_ERR_AUTOINC_ERANGE eval insert into t1 values(NULL); drop table t1; @@ -44,25 +44,25 @@ let $range_max=65535; eval create table t1 (a $type primary key auto_increment); eval insert into t1 values($range_max); ---error 167 +--error HA_ERR_AUTOINC_ERANGE insert into t1 values(NULL); truncate table t1; eval insert into t1 values($range_max-1); insert into t1 values(NULL); ---error 167 +--error HA_ERR_AUTOINC_ERANGE insert into t1 values(NULL); select * from t1; truncate table t1; ---error 167 +--error HA_ERR_AUTOINC_ERANGE eval insert into t1 values($range_max),(NULL); select * from t1; truncate table t1; ---error 167 +--error HA_ERR_AUTOINC_ERANGE eval insert into t1 values($range_max-1),(NULL),(NULL); truncate table t1; eval insert into t1 values($range_max+1); select * from t1; ---error 167 +--error HA_ERR_AUTOINC_ERANGE eval insert into t1 values(NULL); drop table t1; @@ -75,25 +75,25 @@ let $range_max=2147483647; eval create table t1 (a $type primary key auto_increment); eval insert into t1 values($range_max); ---error 167 +--error HA_ERR_AUTOINC_ERANGE insert into t1 values(NULL); truncate table t1; eval insert into t1 values($range_max-1); insert into t1 values(NULL); ---error 167 +--error HA_ERR_AUTOINC_ERANGE insert into t1 values(NULL); select * from t1; truncate table t1; ---error 167 +--error HA_ERR_AUTOINC_ERANGE eval insert into t1 values($range_max),(NULL); select * from t1; truncate table t1; ---error 167 +--error HA_ERR_AUTOINC_ERANGE eval insert into t1 values($range_max-1),(NULL),(NULL); truncate table t1; eval insert into t1 values($range_max+1); select * from t1; ---error 167 +--error HA_ERR_AUTOINC_ERANGE eval insert into t1 values(NULL); drop table t1; @@ -106,25 +106,25 @@ let $range_max=4294967295; eval create table t1 (a $type primary key auto_increment); eval insert into t1 values($range_max); ---error 167 +--error HA_ERR_AUTOINC_ERANGE insert into t1 values(NULL); truncate table t1; eval insert into t1 values($range_max-1); insert into t1 values(NULL); ---error 167 +--error HA_ERR_AUTOINC_ERANGE insert into t1 values(NULL); select * from t1; truncate table t1; ---error 167 +--error HA_ERR_AUTOINC_ERANGE eval insert into t1 values($range_max),(NULL); select * from t1; truncate table t1; ---error 167 +--error HA_ERR_AUTOINC_ERANGE eval insert into t1 values($range_max-1),(NULL),(NULL); truncate table t1; eval insert into t1 values($range_max+1); select * from t1; ---error 167 +--error HA_ERR_AUTOINC_ERANGE eval insert into t1 values(NULL); drop table t1; @@ -137,25 +137,25 @@ let $range_max=cast(9223372036854775807 as unsigned); eval create table t1 (a $type primary key auto_increment); eval insert into t1 values($range_max); ---error 167 +--error HA_ERR_AUTOINC_ERANGE insert into t1 values(NULL); truncate table t1; eval insert into t1 values($range_max-1); insert into t1 values(NULL); ---error 167 +--error HA_ERR_AUTOINC_ERANGE insert into t1 values(NULL); select * from t1; truncate table t1; ---error 167 +--error HA_ERR_AUTOINC_ERANGE eval insert into t1 values($range_max),(NULL); select * from t1; truncate table t1; ---error 167 +--error HA_ERR_AUTOINC_ERANGE eval insert into t1 values($range_max-1),(NULL),(NULL); truncate table t1; eval insert into t1 values($range_max+1); select * from t1; ---error 167 +--error HA_ERR_AUTOINC_ERANGE eval insert into t1 values(NULL); drop table t1; @@ -200,7 +200,7 @@ set @org_mode=@@sql_mode; set @@sql_mode='ansi,traditional'; insert ignore into t1 values(32766),(NULL),(NULL); truncate table t1; ---error 167 +--error HA_ERR_AUTOINC_ERANGE insert into t1 values(32766),(NULL),(NULL); set @@sql_mode=@org_mode; drop table t1; @@ -223,7 +223,7 @@ DROP TABLE t1; CREATE TABLE t1 (a smallint AUTO_INCREMENT, PRIMARY KEY (a)); INSERT INTO t1 VALUES (2); INSERT INTO t1 VALUES (32768); ---error 167 +--error HA_ERR_AUTOINC_ERANGE INSERT INTO t1 VALUES (NULL); SELECT * FROM t1; DROP TABLE t1; @@ -235,6 +235,6 @@ DROP TABLE t1; create table t1 (a smallint primary key auto_increment); insert into t1 values(32766),(NULL); delete from t1 where a=32767; ---error 167 +--error HA_ERR_AUTOINC_ERANGE insert into t1 values(NULL); drop table t1; diff --git a/mysql-test/t/ctype_latin1.test b/mysql-test/t/ctype_latin1.test index 390325529e7..d893b9d9458 100644 --- a/mysql-test/t/ctype_latin1.test +++ b/mysql-test/t/ctype_latin1.test @@ -82,6 +82,7 @@ select 'a' regexp 'A' collate latin1_bin; SET collation_connection='latin1_swedish_ci'; -- source include/ctype_filesort.inc -- source include/ctype_like_escape.inc +-- source include/ctype_str_to_date.inc SET collation_connection='latin1_bin'; -- source include/ctype_filesort.inc -- source include/ctype_like_escape.inc diff --git a/mysql-test/t/ctype_sjis.test b/mysql-test/t/ctype_sjis.test index 4041af4d6ad..4b0535fa418 100644 --- a/mysql-test/t/ctype_sjis.test +++ b/mysql-test/t/ctype_sjis.test @@ -69,6 +69,7 @@ SET collation_connection='sjis_japanese_ci'; -- source include/ctype_innodb_like.inc -- source include/ctype_like_escape.inc -- source include/ctype_like_range_f1f2.inc +-- source include/ctype_str_to_date.inc SET collation_connection='sjis_bin'; -- source include/ctype_filesort.inc -- source include/ctype_innodb_like.inc diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test index edc30a1e679..09294b60a04 100644 --- a/mysql-test/t/ctype_ucs.test +++ b/mysql-test/t/ctype_ucs.test @@ -379,6 +379,7 @@ SET collation_connection='ucs2_general_ci'; -- source include/ctype_like_escape.inc -- source include/ctype_german.inc -- source include/ctype_like_range_f1f2.inc +-- source include/ctype_str_to_date.inc SET NAMES latin1; SET collation_connection='ucs2_bin'; -- source include/ctype_filesort.inc diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index 0f64c0ea9c1..6f2222b8e45 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -714,6 +714,7 @@ SET collation_connection='utf8_general_ci'; -- source include/ctype_filesort.inc -- source include/ctype_like_escape.inc -- source include/ctype_german.inc +-- source include/ctype_str_to_date.inc SET collation_connection='utf8_bin'; -- source include/ctype_filesort.inc -- source include/ctype_like_escape.inc diff --git a/mysql-test/t/func_equal.test b/mysql-test/t/func_equal.test index 1c219af0254..990b6d8e74e 100644 --- a/mysql-test/t/func_equal.test +++ b/mysql-test/t/func_equal.test @@ -43,4 +43,54 @@ select * from t1 where a = '4828532208463511553'; select * from t1 where a in ('4828532208463511553'); drop table t1; -# End of 4.1 tests +--echo #End of 4.1 tests + +--echo # +--echo # MDEV-5103: server crashed on singular Item_equal +--echo # + +CREATE TABLE `t1` ( + `tipo` enum('p','r') NOT NULL DEFAULT 'r', + `arquivo_id` bigint(20) unsigned NOT NULL DEFAULT '0', + `arquivo_md5` char(32) NOT NULL, + `conteudo` longblob NOT NULL, + `usuario` varchar(15) NOT NULL, + `datahora_gmt` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `tipo_arquivo` varchar(255) NOT NULL, + `nome_arquivo` varchar(255) NOT NULL, + `tamanho_arquivo` bigint(20) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`tipo`,`arquivo_id`), + UNIQUE KEY `tipo` (`tipo`,`arquivo_md5`) +) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1; + +INSERT INTO `t1` (`tipo`, `arquivo_id`, `arquivo_md5`, `conteudo`, `usuario`, `datahora_gmt`, `tipo_arquivo`, `nome_arquivo`, `tamanho_arquivo`) VALUES + ('r', 1, 'ad18832202b199728921807033a8a515', '', 'rspadim', '2013-10-05 13:55:50', '001_cbr643', 'CBR6431677410201314132.ret', 21306); + + +CREATE TABLE `t2` ( + `tipo` enum('p','r') NOT NULL DEFAULT 'p', + `arquivo_id` bigint(20) NOT NULL DEFAULT '0', + `usuario` varchar(25) NOT NULL, + `datahora` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `erros` longblob NOT NULL, + `importados` bigint(20) unsigned NOT NULL DEFAULT '0', + `n_importados` bigint(20) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`tipo`,`arquivo_id`,`datahora`) +) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1; + +INSERT INTO `t2` (`tipo`, `arquivo_id`, `usuario`, `datahora`, `erros`, `importados`, `n_importados`) VALUES + ('r', 1, 'rspadim', '2013-10-05 14:25:30', '', 32, 0); + +SELECT +arquivo_id,usuario,datahora_gmt,tipo_arquivo,nome_arquivo,tamanho_arquivo + FROM t1 AS a + WHERE datahora_gmt>='0000-00-00 00:00:00' AND + datahora_gmt<='2013-10-07 02:59:59' AND tipo='r' AND + (tipo_arquivo,arquivo_id) NOT IN + (SELECT tipo_arquivo,arquivo_id + FROM t2 + WHERE (tipo_arquivo,arquivo_id)=(a.tipo_arquivo,a.arquivo_id)) + ORDER BY arquivo_id DESC; + +drop table t2, t1; +--echo #End of 5.3 tests diff --git a/mysql-test/t/replace.test b/mysql-test/t/replace.test index 3d32a8c0da6..3f2569b0c62 100644 --- a/mysql-test/t/replace.test +++ b/mysql-test/t/replace.test @@ -25,9 +25,9 @@ drop table t1; create table t1 (a tinyint not null auto_increment primary key, b char(20) default "default_value"); insert into t1 values (126,"first"),(63, "middle"),(0,"last"); ---error 167 +--error HA_ERR_AUTOINC_ERANGE insert into t1 values (0,"error"); ---error 167 +--error HA_ERR_AUTOINC_ERANGE replace into t1 values (0,"error"); replace into t1 values (126,"first updated"); replace into t1 values (63,default); diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index 42fab56baac..5cb9d920c0c 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -4845,6 +4845,34 @@ SELECT * FROM t2 LEFT JOIN v1 ON ( c=b AND a IN ( 1,6 ) ); drop view v1; drop table t1,t2; +--echo # +--echo # MDEV-5153: Server crashes in Item_ref::fix_fields on 2nd execution +--echo # of PS with LEFT JOIN and MERGE view or SELECT SQ +--echo # + +CREATE TABLE t1 (i1 INT, c1 VARCHAR(6)) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1,'foo'),(2,'bar'); + +CREATE TABLE t2 (c2 VARCHAR(6)) ENGINE=MyISAM; +INSERT INTO t2 VALUES ('foobar'),('qux'); + +CREATE ALGORITHM=MERGE VIEW v1 AS SELECT * FROM t1 WHERE ( c1 ) IN ( SELECT c2 FROM t2 ) AND i1 <= 2 ; + +PREPARE stmt FROM 'SELECT * FROM t1 LEFT JOIN v1 ON (v1.i1 = t1.i1)'; + +EXECUTE stmt; +EXECUTE stmt; + +drop view v1; +CREATE ALGORITHM=MERGE VIEW v1 AS SELECT * FROM t1 WHERE ( c1, c1 ) IN ( SELECT c2, c2 FROM t2 ) AND i1 <= 2 ; + +EXECUTE stmt; +EXECUTE stmt; + +deallocate prepare stmt; +drop view v1; +drop table t1,t2; + --echo # ----------------------------------------------------------------- --echo # -- End of 5.3 tests. --echo # ----------------------------------------------------------------- |