[Commits] Rev 3683: Fixed bug mdev-4942. in file:///home/igor/maria/maria-5.3/

Igor Babaev igor at askmonty.org
Sat Aug 24 08:17:03 EEST 2013


At file:///home/igor/maria/maria-5.3/

------------------------------------------------------------
revno: 3683
revision-id: igor at askmonty.org-20130824051702-jp6c9dwdstk3i83u
parent: bar at mariadb.org-20130822112027-wew8m2o6f38qqukw
committer: Igor Babaev <igor at askmonty.org>
branch nick: maria-5.3
timestamp: Fri 2013-08-23 22:17:02 -0700
message:
  Fixed bug mdev-4942.
  Made sure that degenerate conjunctions/disjunctions are obtained from
  AND/OR conditions.
-------------- next part --------------
=== modified file 'mysql-test/r/join_outer.result'
--- a/mysql-test/r/join_outer.result	2013-08-17 05:01:47 +0000
+++ b/mysql-test/r/join_outer.result	2013-08-24 05:17:02 +0000
@@ -1836,4 +1836,16 @@
 WHERE a.modified > b.modified or b.modified IS NULL;
 id	modified
 DROP TABLE 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-17 05:01:47 +0000
+++ b/mysql-test/r/join_outer_jcl6.result	2013-08-24 05:17:02 +0000
@@ -1847,6 +1847,18 @@
 WHERE a.modified > b.modified or b.modified IS NULL;
 id	modified
 DROP TABLE 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-05-04 05:46:45 +0000
+++ b/mysql-test/t/join_outer.test	2013-08-24 05:17:02 +0000
@@ -1376,4 +1376,20 @@
 
 DROP TABLE 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-20 20:47:13 +0000
+++ b/sql/sql_select.cc	2013-08-24 05:17:02 +0000
@@ -13350,7 +13350,8 @@
           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