summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/extra/binlog_tests/binlog.test4
-rw-r--r--mysql-test/include/ctype_str_to_date.inc12
-rw-r--r--mysql-test/r/ctype_latin1.result19
-rw-r--r--mysql-test/r/ctype_sjis.result19
-rw-r--r--mysql-test/r/ctype_ucs.result19
-rw-r--r--mysql-test/r/ctype_utf8.result19
-rw-r--r--mysql-test/r/func_equal.result44
-rw-r--r--mysql-test/r/mysqltest.result2
-rw-r--r--mysql-test/r/view.result31
-rw-r--r--mysql-test/suite/mtr2/overlay.inc2
-rw-r--r--mysql-test/suite/mtr2/single.result3
-rw-r--r--mysql-test/suite/mtr2/single.test4
-rw-r--r--mysql-test/suite/sys_vars/r/thread_pool_size_high.result11
-rw-r--r--mysql-test/suite/sys_vars/t/thread_pool_size_basic.opt1
-rw-r--r--mysql-test/suite/sys_vars/t/thread_pool_size_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/thread_pool_size_high.opt1
-rw-r--r--mysql-test/suite/sys_vars/t/thread_pool_size_high.test14
-rw-r--r--mysql-test/t/auto_increment.test6
-rw-r--r--mysql-test/t/auto_increment_ranges.inc56
-rw-r--r--mysql-test/t/ctype_latin1.test1
-rw-r--r--mysql-test/t/ctype_sjis.test1
-rw-r--r--mysql-test/t/ctype_ucs.test1
-rw-r--r--mysql-test/t/ctype_utf8.test1
-rw-r--r--mysql-test/t/func_equal.test52
-rw-r--r--mysql-test/t/replace.test4
-rw-r--r--mysql-test/t/view.test28
26 files changed, 319 insertions, 37 deletions
diff --git a/mysql-test/extra/binlog_tests/binlog.test b/mysql-test/extra/binlog_tests/binlog.test
index a87f1f351cc..190aa9e04b9 100644
--- a/mysql-test/extra/binlog_tests/binlog.test
+++ b/mysql-test/extra/binlog_tests/binlog.test
@@ -216,7 +216,7 @@ reset master;
create table t1 (id tinyint auto_increment primary key);
insert into t1 values(5);
set insert_id=128;
---error 167
+--error HA_ERR_AUTOINC_ERANGE
insert into t1 values(null) /* Not binlogged */;
# The followin insert ignore will be put in binlog
@@ -238,7 +238,7 @@ drop table t1;
create table t1 (id tinyint auto_increment primary key) engine=myisam;
set insert_id=128;
---error 167
+--error HA_ERR_AUTOINC_ERANGE
insert into t1 values(5),(null) /* Insert_id 128 */;
# The followin insert ignore will be put in binlog
diff --git a/mysql-test/include/ctype_str_to_date.inc b/mysql-test/include/ctype_str_to_date.inc
new file mode 100644
index 00000000000..62adb05b094
--- /dev/null
+++ b/mysql-test/include/ctype_str_to_date.inc
@@ -0,0 +1,12 @@
+--echo #
+--echo # MDEV-4842 STR_TO_DATE does not work with UCS2/UTF16/UTF32
+--echo #
+
+SELECT @@character_set_connection, HEX(CAST(_utf8'÷' AS CHAR));
+SELECT STR_TO_DATE(CAST(_utf8'2001÷01÷01' AS CHAR),CAST(_utf8'%Y÷%m÷%d' AS CHAR));
+CREATE TABLE t1 AS SELECT REPEAT(' ', 64) AS subject, REPEAT(' ',64) AS pattern LIMIT 0;
+SHOW COLUMNS FROM t1;
+INSERT INTO t1 VALUES (_utf8'2001÷01÷01',_utf8'%Y÷%m÷%d');
+SELECT HEX(subject),HEX(pattern),STR_TO_DATE(subject, pattern) FROM t1;
+DROP TABLE t1;
+
diff --git a/mysql-test/r/ctype_latin1.result b/mysql-test/r/ctype_latin1.result
index a1a48130454..48ab72a4b8b 100644
--- a/mysql-test/r/ctype_latin1.result
+++ b/mysql-test/r/ctype_latin1.result
@@ -336,6 +336,25 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
+#
+# MDEV-4842 STR_TO_DATE does not work with UCS2/UTF16/UTF32
+#
+SELECT @@character_set_connection, HEX(CAST(_utf8'÷' AS CHAR));
+@@character_set_connection HEX(CAST(_utf8'÷' AS CHAR))
+latin1 F7
+SELECT STR_TO_DATE(CAST(_utf8'2001÷01÷01' AS CHAR),CAST(_utf8'%Y÷%m÷%d' AS CHAR));
+STR_TO_DATE(CAST(_utf8'2001÷01÷01' AS CHAR),CAST(_utf8'%Y÷%m÷%d' AS CHAR))
+2001-01-01
+CREATE TABLE t1 AS SELECT REPEAT(' ', 64) AS subject, REPEAT(' ',64) AS pattern LIMIT 0;
+SHOW COLUMNS FROM t1;
+Field Type Null Key Default Extra
+subject varchar(64) NO
+pattern varchar(64) NO
+INSERT INTO t1 VALUES (_utf8'2001÷01÷01',_utf8'%Y÷%m÷%d');
+SELECT HEX(subject),HEX(pattern),STR_TO_DATE(subject, pattern) FROM t1;
+HEX(subject) HEX(pattern) STR_TO_DATE(subject, pattern)
+32303031F73031F73031 2559F7256DF72564 2001-01-01 00:00:00
+DROP TABLE t1;
SET collation_connection='latin1_bin';
create table t1 select repeat('a',4000) a;
delete from t1;
diff --git a/mysql-test/r/ctype_sjis.result b/mysql-test/r/ctype_sjis.result
index 5dcc25123b3..679b5208cf5 100644
--- a/mysql-test/r/ctype_sjis.result
+++ b/mysql-test/r/ctype_sjis.result
@@ -138,6 +138,25 @@ a hex(b) c
3 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
4 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
DROP TABLE t1;
+#
+# MDEV-4842 STR_TO_DATE does not work with UCS2/UTF16/UTF32
+#
+SELECT @@character_set_connection, HEX(CAST(_utf8'÷' AS CHAR));
+@@character_set_connection HEX(CAST(_utf8'÷' AS CHAR))
+sjis 8180
+SELECT STR_TO_DATE(CAST(_utf8'2001÷01÷01' AS CHAR),CAST(_utf8'%Y÷%m÷%d' AS CHAR));
+STR_TO_DATE(CAST(_utf8'2001÷01÷01' AS CHAR),CAST(_utf8'%Y÷%m÷%d' AS CHAR))
+2001-01-01
+CREATE TABLE t1 AS SELECT REPEAT(' ', 64) AS subject, REPEAT(' ',64) AS pattern LIMIT 0;
+SHOW COLUMNS FROM t1;
+Field Type Null Key Default Extra
+subject varchar(64) NO
+pattern varchar(64) NO
+INSERT INTO t1 VALUES (_utf8'2001÷01÷01',_utf8'%Y÷%m÷%d');
+SELECT HEX(subject),HEX(pattern),STR_TO_DATE(subject, pattern) FROM t1;
+HEX(subject) HEX(pattern) STR_TO_DATE(subject, pattern)
+323030318180303181803031 25598180256D81802564 2001-01-01 00:00:00
+DROP TABLE t1;
SET collation_connection='sjis_bin';
create table t1 select repeat('a',4000) a;
delete from t1;
diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result
index ef29ad0dd0d..26762ff524b 100644
--- a/mysql-test/r/ctype_ucs.result
+++ b/mysql-test/r/ctype_ucs.result
@@ -895,6 +895,25 @@ a hex(b) c
3 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
4 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
DROP TABLE t1;
+#
+# MDEV-4842 STR_TO_DATE does not work with UCS2/UTF16/UTF32
+#
+SELECT @@character_set_connection, HEX(CAST(_utf8'÷' AS CHAR));
+@@character_set_connection HEX(CAST(_utf8'÷' AS CHAR))
+ucs2 00F7
+SELECT STR_TO_DATE(CAST(_utf8'2001÷01÷01' AS CHAR),CAST(_utf8'%Y÷%m÷%d' AS CHAR));
+STR_TO_DATE(CAST(_utf8'2001÷01÷01' AS CHAR),CAST(_utf8'%Y÷%m÷%d' AS CHAR))
+2001-01-01
+CREATE TABLE t1 AS SELECT REPEAT(' ', 64) AS subject, REPEAT(' ',64) AS pattern LIMIT 0;
+SHOW COLUMNS FROM t1;
+Field Type Null Key Default Extra
+subject varchar(64) NO
+pattern varchar(64) NO
+INSERT INTO t1 VALUES (_utf8'2001÷01÷01',_utf8'%Y÷%m÷%d');
+SELECT HEX(subject),HEX(pattern),STR_TO_DATE(subject, pattern) FROM t1;
+HEX(subject) HEX(pattern) STR_TO_DATE(subject, pattern)
+003200300030003100F70030003100F700300031 0025005900F70025006D00F700250064 2001-01-01 00:00:00
+DROP TABLE t1;
SET NAMES latin1;
SET collation_connection='ucs2_bin';
create table t1 select repeat('a',4000) a;
diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result
index 930a19c5179..7342dffa1e0 100644
--- a/mysql-test/r/ctype_utf8.result
+++ b/mysql-test/r/ctype_utf8.result
@@ -1058,6 +1058,25 @@ s 0
ß 1
DROP TABLE t1;
"END ctype_german.inc"
+#
+# MDEV-4842 STR_TO_DATE does not work with UCS2/UTF16/UTF32
+#
+SELECT @@character_set_connection, HEX(CAST(_utf8'÷' AS CHAR));
+@@character_set_connection HEX(CAST(_utf8'÷' AS CHAR))
+utf8 C3B7
+SELECT STR_TO_DATE(CAST(_utf8'2001÷01÷01' AS CHAR),CAST(_utf8'%Y÷%m÷%d' AS CHAR));
+STR_TO_DATE(CAST(_utf8'2001÷01÷01' AS CHAR),CAST(_utf8'%Y÷%m÷%d' AS CHAR))
+2001-01-01
+CREATE TABLE t1 AS SELECT REPEAT(' ', 64) AS subject, REPEAT(' ',64) AS pattern LIMIT 0;
+SHOW COLUMNS FROM t1;
+Field Type Null Key Default Extra
+subject varchar(64) NO
+pattern varchar(64) NO
+INSERT INTO t1 VALUES (_utf8'2001÷01÷01',_utf8'%Y÷%m÷%d');
+SELECT HEX(subject),HEX(pattern),STR_TO_DATE(subject, pattern) FROM t1;
+HEX(subject) HEX(pattern) STR_TO_DATE(subject, pattern)
+32303031C3B73031C3B73031 2559C3B7256DC3B72564 2001-01-01 00:00:00
+DROP TABLE t1;
SET collation_connection='utf8_bin';
create table t1 select repeat('a',4000) a;
delete from t1;
diff --git a/mysql-test/r/func_equal.result b/mysql-test/r/func_equal.result
index 4750af6e8d8..02593529a91 100644
--- a/mysql-test/r/func_equal.result
+++ b/mysql-test/r/func_equal.result
@@ -42,3 +42,47 @@ select * from t1 where a in ('4828532208463511553');
a
4828532208463511553
drop table t1;
+#End of 4.1 tests
+#
+# MDEV-5103: server crashed on singular Item_equal
+#
+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;
+arquivo_id usuario datahora_gmt tipo_arquivo nome_arquivo tamanho_arquivo
+drop table t2, t1;
+#End of 5.3 tests
diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result
index 811861a6d93..7228daa2712 100644
--- a/mysql-test/r/mysqltest.result
+++ b/mysql-test/r/mysqltest.result
@@ -232,7 +232,7 @@ mysqltest: At line 2: Spurious text after `query` expression
mysqltest: At line 1: Missing argument(s) to 'error'
mysqltest: At line 1: Missing argument(s) to 'error'
mysqltest: At line 1: The sqlstate definition must start with an uppercase S
-mysqltest: At line 1: The error name definition must start with an uppercase E or W
+mysqltest: At line 1: The error name definition must start with an uppercase E or W or H
mysqltest: At line 1: Invalid argument to error: '9eeeee' - the errno may only consist of digits[0-9]
mysqltest: At line 1: Invalid argument to error: '1sssss' - the errno may only consist of digits[0-9]
mysqltest: At line 1: The sqlstate must be exactly 5 chars long
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index 4ac3569eafa..a926f975009 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -4919,6 +4919,37 @@ q 1 q
q 1 q
drop view v1;
drop table t1,t2;
+#
+# MDEV-5153: Server crashes in Item_ref::fix_fields on 2nd execution
+# of PS with LEFT JOIN and MERGE view or SELECT SQ
+#
+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;
+i1 c1 i1 c1
+1 foo NULL NULL
+2 bar NULL NULL
+EXECUTE stmt;
+i1 c1 i1 c1
+1 foo NULL NULL
+2 bar NULL NULL
+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;
+i1 c1 i1 c1
+1 foo NULL NULL
+2 bar NULL NULL
+EXECUTE stmt;
+i1 c1 i1 c1
+1 foo NULL NULL
+2 bar NULL NULL
+deallocate prepare stmt;
+drop view v1;
+drop table t1,t2;
# -----------------------------------------------------------------
# -- End of 5.3 tests.
# -----------------------------------------------------------------
diff --git a/mysql-test/suite/mtr2/overlay.inc b/mysql-test/suite/mtr2/overlay.inc
new file mode 100644
index 00000000000..669b8315fcb
--- /dev/null
+++ b/mysql-test/suite/mtr2/overlay.inc
@@ -0,0 +1,2 @@
+select 2;
+
diff --git a/mysql-test/suite/mtr2/single.result b/mysql-test/suite/mtr2/single.result
index 8f7c125196a..b0bd4a256d7 100644
--- a/mysql-test/suite/mtr2/single.result
+++ b/mysql-test/suite/mtr2/single.result
@@ -1,3 +1,6 @@
select 1;
1
1
+select 2;
+2
+2
diff --git a/mysql-test/suite/mtr2/single.test b/mysql-test/suite/mtr2/single.test
index 122e1bb00e4..5acf716d6cb 100644
--- a/mysql-test/suite/mtr2/single.test
+++ b/mysql-test/suite/mtr2/single.test
@@ -5,4 +5,8 @@
# three times - once for the parent suite, and once for each overlay.
# even if the test files are not overlayed.
#
+# overlay.inc is overridden in mtr2-myisam, and there is an rdiff file.
+#
select 1;
+source overlay.inc;
+
diff --git a/mysql-test/suite/sys_vars/r/thread_pool_size_high.result b/mysql-test/suite/sys_vars/r/thread_pool_size_high.result
new file mode 100644
index 00000000000..f581ae8e315
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/thread_pool_size_high.result
@@ -0,0 +1,11 @@
+SELECT @@global.thread_pool_size;
+@@global.thread_pool_size
+200
+SET @@global.thread_pool_size=150;
+SET @@global.thread_pool_size=200;
+SET @@global.thread_pool_size=201;
+Warnings:
+Warning 1292 Truncated incorrect thread_pool_size value: '201'
+SELECT @@global.thread_pool_size;
+@@global.thread_pool_size
+200
diff --git a/mysql-test/suite/sys_vars/t/thread_pool_size_basic.opt b/mysql-test/suite/sys_vars/t/thread_pool_size_basic.opt
new file mode 100644
index 00000000000..7a2696875b8
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/thread_pool_size_basic.opt
@@ -0,0 +1 @@
+--loose-thread-handling=pool-of-threads
diff --git a/mysql-test/suite/sys_vars/t/thread_pool_size_basic.test b/mysql-test/suite/sys_vars/t/thread_pool_size_basic.test
index eeed58956a4..5d432eb9940 100644
--- a/mysql-test/suite/sys_vars/t/thread_pool_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/thread_pool_size_basic.test
@@ -1,6 +1,7 @@
# uint global
--source include/not_windows.inc
--source include/not_embedded.inc
+--source include/have_pool_of_threads.inc
SET @start_global_value = @@global.thread_pool_size;
#
diff --git a/mysql-test/suite/sys_vars/t/thread_pool_size_high.opt b/mysql-test/suite/sys_vars/t/thread_pool_size_high.opt
new file mode 100644
index 00000000000..fe54a37c4ce
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/thread_pool_size_high.opt
@@ -0,0 +1 @@
+--loose-thread-handling=pool-of-threads --loose-thread-pool-size=200
diff --git a/mysql-test/suite/sys_vars/t/thread_pool_size_high.test b/mysql-test/suite/sys_vars/t/thread_pool_size_high.test
new file mode 100644
index 00000000000..761aeee2b0a
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/thread_pool_size_high.test
@@ -0,0 +1,14 @@
+--source include/not_windows.inc
+--source include/not_embedded.inc
+--source include/have_pool_of_threads.inc
+
+SELECT @@global.thread_pool_size;
+
+# Set lower value
+SET @@global.thread_pool_size=150;
+# Set original value
+SET @@global.thread_pool_size=200;
+# Try higher value
+SET @@global.thread_pool_size=201;
+
+SELECT @@global.thread_pool_size;
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 # -----------------------------------------------------------------