[Commits] Rev 3861: Merge fix for MDEV-4942, 5.3->5.5 in file:///data0/psergey/dev2/5.5-pull2/

Sergey Petrunya psergey at askmonty.org
Mon Aug 26 15:23:27 EEST 2013


At file:///data0/psergey/dev2/5.5-pull2/

------------------------------------------------------------
revno: 3861 [merge]
revision-id: psergey at askmonty.org-20130826122314-hmnll6t7dsppg844
parent: igor at askmonty.org-20130823153435-h0x3db9sjxsov8uc
parent: igor at askmonty.org-20130824051702-jp6c9dwdstk3i83u
committer: Sergey Petrunya <psergey at askmonty.org>
branch nick: 5.5-pull2
timestamp: Mon 2013-08-26 16:23:14 +0400
message:
  Merge fix for MDEV-4942, 5.3->5.5
modified:
  mysql-test/r/join_outer.result sp1f-join_outer.result-20001228015633-vk2jshiracfus3ze2d2bim2csnnrc5us
  mysql-test/r/join_outer_jcl6.result join_outer_jcl6.resu-20091221012858-uiftww98yhc31z02-1
  mysql-test/t/join_outer.test   sp1f-join_outer.test-20001228015636-himrcptylaquy6l5d7pl7pawom3ytmtw
  sql/sql_select.cc              sp1f-sql_select.cc-19700101030959-egb7whpkh76zzvikycs5nsnuviu4fdlb
=== modified file 'mysql-test/r/join_outer.result'
--- a/mysql-test/r/join_outer.result	2013-08-19 02:58:51 +0000
+++ b/mysql-test/r/join_outer.result	2013-08-26 12:23:14 +0000
@@ -2138,4 +2138,16 @@ id	select_type	table	type	possible_keys
 1	SIMPLE	t0	ALL	NULL	NULL	NULL	NULL	10	Using where
 1	SIMPLE	t1	eq_ref	PRIMARY	PRIMARY	4	test.t0.a	1	Using index
 drop table t0, t1;
+#
+# Bug mdev-4942: LEFT JOIN with conjunctive 
+#                <non-nullable datetime field> IS NULL in WHERE 
+#                causes an assert failure  
+#
+CREATE TABLE t1 ( i1 int, d1 date );
+INSERT INTO t1 VALUES (1,'2001-06-26'), (2,'2000-11-16');
+CREATE TABLE t2 ( i2 int, d2 date NOT NULL );
+INSERT INTO t2 VALUES (3,'2000-03-06'), (4,'2007-09-25');
+SELECT * FROM t1 LEFT JOIN t2 ON i1 = i2 WHERE d1 IS NULL AND d2 IS NULL;
+i1	d1	i2	d2
+DROP TABLE t1,t2;
 SET optimizer_switch=@save_optimizer_switch;

=== modified file 'mysql-test/r/join_outer_jcl6.result'
--- a/mysql-test/r/join_outer_jcl6.result	2013-08-19 02:58:51 +0000
+++ b/mysql-test/r/join_outer_jcl6.result	2013-08-26 12:23:14 +0000
@@ -2149,6 +2149,18 @@ id	select_type	table	type	possible_keys
 1	SIMPLE	t0	ALL	NULL	NULL	NULL	NULL	10	Using where
 1	SIMPLE	t1	eq_ref	PRIMARY	PRIMARY	4	test.t0.a	1	Using index
 drop table t0, t1;
+#
+# Bug mdev-4942: LEFT JOIN with conjunctive 
+#                <non-nullable datetime field> IS NULL in WHERE 
+#                causes an assert failure  
+#
+CREATE TABLE t1 ( i1 int, d1 date );
+INSERT INTO t1 VALUES (1,'2001-06-26'), (2,'2000-11-16');
+CREATE TABLE t2 ( i2 int, d2 date NOT NULL );
+INSERT INTO t2 VALUES (3,'2000-03-06'), (4,'2007-09-25');
+SELECT * FROM t1 LEFT JOIN t2 ON i1 = i2 WHERE d1 IS NULL AND d2 IS NULL;
+i1	d1	i2	d2
+DROP TABLE t1,t2;
 SET optimizer_switch=@save_optimizer_switch;
 set join_cache_level=default;
 show variables like 'join_cache_level';

=== modified file 'mysql-test/t/join_outer.test'
--- a/mysql-test/t/join_outer.test	2013-07-31 13:24:52 +0000
+++ b/mysql-test/t/join_outer.test	2013-08-26 12:23:14 +0000
@@ -1687,4 +1687,20 @@ explain select * from t1 left join t0 on
 drop table t0, t1;
 
 
+--echo #
+--echo # Bug mdev-4942: LEFT JOIN with conjunctive 
+--echo #                <non-nullable datetime field> IS NULL in WHERE 
+--echo #                causes an assert failure  
+--echo #
+
+CREATE TABLE t1 ( i1 int, d1 date );
+INSERT INTO t1 VALUES (1,'2001-06-26'), (2,'2000-11-16');
+
+CREATE TABLE t2 ( i2 int, d2 date NOT NULL );
+INSERT INTO t2 VALUES (3,'2000-03-06'), (4,'2007-09-25');
+
+SELECT * FROM t1 LEFT JOIN t2 ON i1 = i2 WHERE d1 IS NULL AND d2 IS NULL;
+
+DROP TABLE t1,t2;
+
 SET optimizer_switch=@save_optimizer_switch;

=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc	2013-08-23 14:25:45 +0000
+++ b/sql/sql_select.cc	2013-08-26 12:23:14 +0000
@@ -13642,7 +13642,8 @@ internal_remove_eq_conds(THD *thd, COND
           In these cases the disjunct/conjunct must be merged into the
           argument list of cond.
 	*/
-        if (new_item->type() == Item::COND_ITEM)
+        if (new_item->type() == Item::COND_ITEM &&
+            item->type() == Item::COND_ITEM)
         {
           DBUG_ASSERT(((Item_cond *) cond)->functype() == 
                       ((Item_cond *) new_item)->functype());          



More information about the commits mailing list