summaryrefslogtreecommitdiff
path: root/mysql-test/t/func_equal.test
diff options
context:
space:
mode:
authorunknown <sanja@askmonty.org>2013-11-11 16:40:46 +0200
committerunknown <sanja@askmonty.org>2013-11-11 16:40:46 +0200
commitc85db2c4943b644c34cc4c67a95cfb5e5f0a09a4 (patch)
tree31a00735fded4bba3b8a833c4a7925a607f48559 /mysql-test/t/func_equal.test
parent542ce5a068f2139c5b57ace8ba15b425fb570703 (diff)
downloadmariadb-git-c85db2c4943b644c34cc4c67a95cfb5e5f0a09a4.tar.gz
MDEV-5103: server crashed on singular Item_equal
Singular Item_equal support added. The problem was that during constant table substitution Item_equal become containing only one constant which was not supported internally.
Diffstat (limited to 'mysql-test/t/func_equal.test')
-rw-r--r--mysql-test/t/func_equal.test52
1 files changed, 51 insertions, 1 deletions
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