[Commits] Rev 3857: Merge in file:///home/igor/maria/maria-5.5/

Igor Babaev igor at askmonty.org
Wed Aug 21 22:35:33 EEST 2013


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

------------------------------------------------------------
revno: 3857 [merge]
revision-id: igor at askmonty.org-20130821193458-ju0edat1o4msyvc9
parent: igor at askmonty.org-20130821182702-2446farfzf9trbk6
parent: sanja at montyprogram.com-20130821144209-iqswms0ua5j8ja9x
committer: Igor Babaev <igor at askmonty.org>
branch nick: maria-5.5
timestamp: Wed 2013-08-21 12:34:58 -0700
message:
  Merge
modified:
  mysql-test/r/subselect_mat.result subselect_mat.result-20100117143924-r0jv32dj80dg3b5h-1
  mysql-test/r/subselect_sj_mat.result subselect_sj_mat.res-20100524221009-pdj0un54npqbnpcr-1
  mysql-test/t/subselect_sj_mat.test subselect_sj_mat.tes-20100524220952-cy056unehps9s8xw-1
  sql/opt_subselect.cc           opt_subselect.cc-20100215190428-nekkl8wisp0k6nlk-1
-------------- next part --------------
=== modified file 'mysql-test/r/subselect_mat.result'
--- a/mysql-test/r/subselect_mat.result	2013-05-02 20:10:43 +0000
+++ b/mysql-test/r/subselect_mat.result	2013-08-21 19:34:58 +0000
@@ -2016,6 +2016,20 @@
 # This must be at the end:
 set optimizer_switch=@subselect_sj_mat_tmp;
 set join_cache_level=@save_join_cache_level;
+#
+# MDEV-4908: Assertion `((Item_cond *) cond)->functype() == 
+# ((Item_cond *) new_item)->functype()' fails on a query with
+# IN and equal conditions, AND/OR, materialization+semijoin
+# 
+SET @save_optimizer_switch=@@optimizer_switch;
+SET optimizer_switch = 'materialization=on,semijoin=on';
+CREATE TABLE t1 (pk INT, a INT, b INT, PRIMARY KEY(pk)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1,3,5),(2,4,6);
+SELECT * FROM t1 WHERE 8 IN ( SELECT MIN(pk) FROM t1 ) AND ( pk = a OR pk = b );
+pk	a	b
+drop table t1;
+SET optimizer_switch=@save_optimizer_switch;
+# End of 5.3 tests
 set @subselect_mat_test_optimizer_switch_value=null;
 set @@optimizer_switch='materialization=on,in_to_exists=off,semijoin=off';
 set optimizer_switch='mrr=on,mrr_sort_keys=on,index_condition_pushdown=on';

=== modified file 'mysql-test/r/subselect_sj_mat.result'
--- a/mysql-test/r/subselect_sj_mat.result	2013-05-02 20:10:43 +0000
+++ b/mysql-test/r/subselect_sj_mat.result	2013-08-21 19:34:58 +0000
@@ -2056,3 +2056,17 @@
 # This must be at the end:
 set optimizer_switch=@subselect_sj_mat_tmp;
 set join_cache_level=@save_join_cache_level;
+#
+# MDEV-4908: Assertion `((Item_cond *) cond)->functype() == 
+# ((Item_cond *) new_item)->functype()' fails on a query with
+# IN and equal conditions, AND/OR, materialization+semijoin
+# 
+SET @save_optimizer_switch=@@optimizer_switch;
+SET optimizer_switch = 'materialization=on,semijoin=on';
+CREATE TABLE t1 (pk INT, a INT, b INT, PRIMARY KEY(pk)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1,3,5),(2,4,6);
+SELECT * FROM t1 WHERE 8 IN ( SELECT MIN(pk) FROM t1 ) AND ( pk = a OR pk = b );
+pk	a	b
+drop table t1;
+SET optimizer_switch=@save_optimizer_switch;
+# End of 5.3 tests

=== modified file 'mysql-test/t/subselect_sj_mat.test'
--- a/mysql-test/t/subselect_sj_mat.test	2013-05-02 20:10:43 +0000
+++ b/mysql-test/t/subselect_sj_mat.test	2013-08-21 19:34:58 +0000
@@ -1700,3 +1700,21 @@
 set optimizer_switch=@subselect_sj_mat_tmp;
 set join_cache_level=@save_join_cache_level;
 
+--echo #
+--echo # MDEV-4908: Assertion `((Item_cond *) cond)->functype() == 
+--echo # ((Item_cond *) new_item)->functype()' fails on a query with
+--echo # IN and equal conditions, AND/OR, materialization+semijoin
+--echo # 
+
+
+SET @save_optimizer_switch=@@optimizer_switch;
+SET optimizer_switch = 'materialization=on,semijoin=on';
+
+CREATE TABLE t1 (pk INT, a INT, b INT, PRIMARY KEY(pk)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1,3,5),(2,4,6);
+SELECT * FROM t1 WHERE 8 IN ( SELECT MIN(pk) FROM t1 ) AND ( pk = a OR pk = b );
+
+drop table t1;
+SET optimizer_switch=@save_optimizer_switch;
+
+--echo # End of 5.3 tests

=== modified file 'sql/opt_subselect.cc'
--- a/sql/opt_subselect.cc	2013-07-16 05:22:17 +0000
+++ b/sql/opt_subselect.cc	2013-08-21 19:34:58 +0000
@@ -5211,10 +5211,12 @@
           {
             eq_cond= new Item_func_eq(subq_pred->left_expr->element_index(i),
                                       new_sink->row[i]);
-            if (!eq_cond || eq_cond->fix_fields(join->thd, &eq_cond))
+            if (!eq_cond)
               DBUG_RETURN(1);
 
-            (*join_where)= and_items(*join_where, eq_cond);
+            if (!((*join_where)= and_items(*join_where, eq_cond)) ||
+                (*join_where)->fix_fields(join->thd, join_where))
+              DBUG_RETURN(1);
           }
         }
         else



More information about the commits mailing list