diff options
author | Igor Babaev <igor@askmonty.org> | 2013-11-21 15:19:25 -0800 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2013-11-21 15:19:25 -0800 |
commit | c0f31dc9f3e0a42911beb6655a40601d2fddfe8e (patch) | |
tree | eceda1a471f3179d772999bf15a77d282e226c45 /mysql-test/t/subselect4.test | |
parent | f8a6ee59acb082678cf601a10cbe9c1152748242 (diff) | |
download | mariadb-git-c0f31dc9f3e0a42911beb6655a40601d2fddfe8e.tar.gz |
Another attempt to fix bug mdev-5103.
The earlier pushed fix for the bug was incomplete. It did not remove
the main cause of the problem: the function remove_eq_conds()
removed always true multiple equalities from any conjunct, but did not
adjust the list of them stored in Item_cond_and::cond_equal.current_level.
Simplified the test case for the bug and moved it to another test file.
The fix triggered changes in EXPLAIN EXTENDED for some queries.
Diffstat (limited to 'mysql-test/t/subselect4.test')
-rw-r--r-- | mysql-test/t/subselect4.test | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/mysql-test/t/subselect4.test b/mysql-test/t/subselect4.test index 51247e2c3ea..ad0e135f37e 100644 --- a/mysql-test/t/subselect4.test +++ b/mysql-test/t/subselect4.test @@ -1910,7 +1910,31 @@ WHERE b IS NULL OR a < 'u'; drop table t1,t2; set @@optimizer_switch = @optimizer_switch_MDEV4056; +--echo # +--echo # MDEV-5103: server crashed on singular Item_equal +--echo # + +CREATE TABLE t1 ( + a enum('p','r') NOT NULL DEFAULT 'r', + b int NOT NULL DEFAULT '0', + c char(32) NOT NULL, + d varchar(255) NOT NULL, + PRIMARY KEY (a, b), UNIQUE KEY idx(a, c) +); +INSERT INTO t1 VALUES ('r', 1, 'ad18832202b199728921807033a8a515', '001_cbr643'); + +CREATE TABLE t2 ( + a enum('p','r') NOT NULL DEFAULT 'r', + b int NOT NULL DEFAULT '0', + e datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (a, b, e) +); +INSERT INTO t2 VALUES ('r', 1, '2013-10-05 14:25:30'); + +SELECT * FROM t1 AS t + WHERE a='r' AND (c,b) NOT IN (SELECT c,b FROM t2 WHERE (c,b)=(t.c,t.b)); +DROP TABLE t1, t2; SET optimizer_switch= @@global.optimizer_switch; set @@tmp_table_size= @@global.tmp_table_size; |