[Commits] Rev 3874: Merge 5.3->5.5 in file:///home/igor/maria/maria-5.5/

Igor Babaev igor at askmonty.org
Sat Aug 31 18:18:59 EEST 2013


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

------------------------------------------------------------
revno: 3874 [merge]
revision-id: igor at askmonty.org-20130831151825-c7g5evb3jnu77h89
parent: igor at askmonty.org-20130829193209-b88om4lfuodksrqv
parent: igor at askmonty.org-20130830040242-tns2ir3y9rht6n19
committer: Igor Babaev <igor at askmonty.org>
branch nick: maria-5.5
timestamp: Sat 2013-08-31 08:18:25 -0700
message:
  Merge 5.3->5.5
modified:
  mysql-test/r/select.result     sp1f-select.result-20010103001548-znkoalxem6wchsbxizfosjhpfmhfyxuk
  mysql-test/r/select_jcl6.result select_jcl6.result-20091221012908-0kl039gl68crw8rz-1
  mysql-test/r/select_pkeycache.result select_pkeycache.res-20100216163255-sd54514jjhw0yi81-3
  mysql-test/r/subselect_sj2_mat.result subselect_sj2_mat.re-20110203133247-60oo2ydzq1r2g7ib-1
  mysql-test/t/select.test       sp1f-select.test-20010103001548-tbl2ff7qehzh43qnsmf4ejhjqe66f46n
  sql/sql_select.cc              sp1f-sql_select.cc-19700101030959-egb7whpkh76zzvikycs5nsnuviu4fdlb
-------------- next part --------------
=== modified file 'mysql-test/r/select.result'
--- a/mysql-test/r/select.result	2013-08-28 05:19:14 +0000
+++ b/mysql-test/r/select.result	2013-08-31 15:18:25 +0000
@@ -5444,4 +5444,29 @@
 WHERE i1 = i2 AND ( FALSE OR ( j1 > 27 AND j1 < 100 OR j1 <= 3 ) AND j1 = i2 );
 i1	j1	i2
 DROP TABLE t1,t2;
+#
+# Bug mdev-4971: equality propagation after merging degenerate 
+#                disjunction into embedding AND level 
+#
+CREATE TABLE t1 (pk1 int, a1 int, b1 int, PRIMARY KEY(pk1)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1,10,100), (2,20,200) ;
+CREATE TABLE t2 (pk2 int, a2 int, PRIMARY KEY(pk2)) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (1,1);
+SELECT * FROM t1, t2
+WHERE a1 = pk2 AND ( ( b1 = 6 OR a2 > 4 ) AND pk2 = a2 OR pk1 IS NULL );
+pk1	a1	b1	pk2	a2
+EXPLAIN EXTENDED
+SELECT * FROM t1, t2
+WHERE a1 = pk2 AND ( ( b1 = 6 OR a2 > 4 ) AND pk2 = a2 OR pk1 IS NULL );
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	SIMPLE	t2	system	PRIMARY	NULL	NULL	NULL	1	100.00	
+1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	2	100.00	Using where
+Warnings:
+Note	1003	select `test`.`t1`.`pk1` AS `pk1`,`test`.`t1`.`a1` AS `a1`,`test`.`t1`.`b1` AS `b1`,1 AS `pk2`,1 AS `a2` from `test`.`t1` where ((`test`.`t1`.`a1` = 1) and ((`test`.`t1`.`b1` = 6) or 0))
+INSERT INTO t1 VALUES (3,1,6);
+SELECT * FROM t1, t2
+WHERE a1 = pk2 AND ( ( b1 = 6 OR a2 > 4 ) AND pk2 = a2 OR pk1 IS NULL );
+pk1	a1	b1	pk2	a2
+3	1	6	1	1
+DROP TABLE t1,t2;
 End of 5.3 tests

=== modified file 'mysql-test/r/select_jcl6.result'
--- a/mysql-test/r/select_jcl6.result	2013-08-28 05:19:14 +0000
+++ b/mysql-test/r/select_jcl6.result	2013-08-31 15:18:25 +0000
@@ -5455,6 +5455,31 @@
 WHERE i1 = i2 AND ( FALSE OR ( j1 > 27 AND j1 < 100 OR j1 <= 3 ) AND j1 = i2 );
 i1	j1	i2
 DROP TABLE t1,t2;
+#
+# Bug mdev-4971: equality propagation after merging degenerate 
+#                disjunction into embedding AND level 
+#
+CREATE TABLE t1 (pk1 int, a1 int, b1 int, PRIMARY KEY(pk1)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1,10,100), (2,20,200) ;
+CREATE TABLE t2 (pk2 int, a2 int, PRIMARY KEY(pk2)) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (1,1);
+SELECT * FROM t1, t2
+WHERE a1 = pk2 AND ( ( b1 = 6 OR a2 > 4 ) AND pk2 = a2 OR pk1 IS NULL );
+pk1	a1	b1	pk2	a2
+EXPLAIN EXTENDED
+SELECT * FROM t1, t2
+WHERE a1 = pk2 AND ( ( b1 = 6 OR a2 > 4 ) AND pk2 = a2 OR pk1 IS NULL );
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	SIMPLE	t2	system	PRIMARY	NULL	NULL	NULL	1	100.00	
+1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	2	100.00	Using where
+Warnings:
+Note	1003	select `test`.`t1`.`pk1` AS `pk1`,`test`.`t1`.`a1` AS `a1`,`test`.`t1`.`b1` AS `b1`,1 AS `pk2`,1 AS `a2` from `test`.`t1` where ((`test`.`t1`.`a1` = 1) and ((`test`.`t1`.`b1` = 6) or 0))
+INSERT INTO t1 VALUES (3,1,6);
+SELECT * FROM t1, t2
+WHERE a1 = pk2 AND ( ( b1 = 6 OR a2 > 4 ) AND pk2 = a2 OR pk1 IS NULL );
+pk1	a1	b1	pk2	a2
+3	1	6	1	1
+DROP TABLE t1,t2;
 End of 5.3 tests
 set join_cache_level=default;
 show variables like 'join_cache_level';

=== modified file 'mysql-test/r/select_pkeycache.result'
--- a/mysql-test/r/select_pkeycache.result	2013-08-28 05:19:14 +0000
+++ b/mysql-test/r/select_pkeycache.result	2013-08-31 15:18:25 +0000
@@ -5444,4 +5444,29 @@
 WHERE i1 = i2 AND ( FALSE OR ( j1 > 27 AND j1 < 100 OR j1 <= 3 ) AND j1 = i2 );
 i1	j1	i2
 DROP TABLE t1,t2;
+#
+# Bug mdev-4971: equality propagation after merging degenerate 
+#                disjunction into embedding AND level 
+#
+CREATE TABLE t1 (pk1 int, a1 int, b1 int, PRIMARY KEY(pk1)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1,10,100), (2,20,200) ;
+CREATE TABLE t2 (pk2 int, a2 int, PRIMARY KEY(pk2)) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (1,1);
+SELECT * FROM t1, t2
+WHERE a1 = pk2 AND ( ( b1 = 6 OR a2 > 4 ) AND pk2 = a2 OR pk1 IS NULL );
+pk1	a1	b1	pk2	a2
+EXPLAIN EXTENDED
+SELECT * FROM t1, t2
+WHERE a1 = pk2 AND ( ( b1 = 6 OR a2 > 4 ) AND pk2 = a2 OR pk1 IS NULL );
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	SIMPLE	t2	system	PRIMARY	NULL	NULL	NULL	1	100.00	
+1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	2	100.00	Using where
+Warnings:
+Note	1003	select `test`.`t1`.`pk1` AS `pk1`,`test`.`t1`.`a1` AS `a1`,`test`.`t1`.`b1` AS `b1`,1 AS `pk2`,1 AS `a2` from `test`.`t1` where ((`test`.`t1`.`a1` = 1) and ((`test`.`t1`.`b1` = 6) or 0))
+INSERT INTO t1 VALUES (3,1,6);
+SELECT * FROM t1, t2
+WHERE a1 = pk2 AND ( ( b1 = 6 OR a2 > 4 ) AND pk2 = a2 OR pk1 IS NULL );
+pk1	a1	b1	pk2	a2
+3	1	6	1	1
+DROP TABLE t1,t2;
 End of 5.3 tests

=== modified file 'mysql-test/r/subselect_sj2_mat.result'
--- a/mysql-test/r/subselect_sj2_mat.result	2013-08-19 02:58:51 +0000
+++ b/mysql-test/r/subselect_sj2_mat.result	2013-08-31 15:18:25 +0000
@@ -1399,7 +1399,7 @@
 2	MATERIALIZED	t2	ALL	NULL	NULL	NULL	NULL	2	100.00	Using where
 2	MATERIALIZED	t3	hash_ALL	NULL	#hash#$hj	5	test.t2.i2	3	100.00	Using where; Using join buffer (flat, BNLH join)
 Warnings:
-Note	1003	select `test`.`t1`.`i1` AS `i1` from `test`.`t1` semi join (`test`.`t2` join `test`.`t3`) where ((`test`.`t3`.`i3` = `test`.`t2`.`i2`) and (`test`.`t1`.`i1` = `test`.`t2`.`i2`) and (`test`.`t3`.`i3` > 0))
+Note	1003	select `test`.`t1`.`i1` AS `i1` from `test`.`t1` semi join (`test`.`t2` join `test`.`t3`) where ((`test`.`t3`.`i3` = `test`.`t2`.`i2`) and (`test`.`t1`.`i1` = `test`.`t2`.`i2`) and (`test`.`t2`.`i2` > 0))
 SELECT * FROM t1 
 WHERE i1 IN (SELECT i3 FROM t2, t3 WHERE i3 > 0 AND i3 = i2 OR 1=2);
 i1

=== modified file 'mysql-test/t/select.test'
--- a/mysql-test/t/select.test	2013-08-28 05:19:14 +0000
+++ b/mysql-test/t/select.test	2013-08-31 15:18:25 +0000
@@ -4582,5 +4582,28 @@
 
 DROP TABLE t1,t2;
 
+--echo #
+--echo # Bug mdev-4971: equality propagation after merging degenerate 
+--echo #                disjunction into embedding AND level 
+--echo #
+
+CREATE TABLE t1 (pk1 int, a1 int, b1 int, PRIMARY KEY(pk1)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1,10,100), (2,20,200) ;
+
+CREATE TABLE t2 (pk2 int, a2 int, PRIMARY KEY(pk2)) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (1,1);
+
+SELECT * FROM t1, t2
+  WHERE a1 = pk2 AND ( ( b1 = 6 OR a2 > 4 ) AND pk2 = a2 OR pk1 IS NULL );
+EXPLAIN EXTENDED
+SELECT * FROM t1, t2
+  WHERE a1 = pk2 AND ( ( b1 = 6 OR a2 > 4 ) AND pk2 = a2 OR pk1 IS NULL );
+
+INSERT INTO t1 VALUES (3,1,6);
+SELECT * FROM t1, t2
+  WHERE a1 = pk2 AND ( ( b1 = 6 OR a2 > 4 ) AND pk2 = a2 OR pk1 IS NULL );
+
+DROP TABLE t1,t2;
+
 --echo End of 5.3 tests
 

=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc	2013-08-29 19:32:09 +0000
+++ b/sql/sql_select.cc	2013-08-31 15:18:25 +0000
@@ -13481,7 +13481,8 @@
     {
       Item_cond_and *cond_and= (Item_cond_and *) cond; 
       List<Item_equal> *cond_equalities= &cond_and->cond_equal.current_level;
-      inherited= cond_and->cond_equal.upper_levels;
+      cond_and->cond_equal.upper_levels= inherited;
+      inherited= &cond_and->cond_equal;
       if (!cond_equalities->is_empty() && cond_equalities != new_equalities)
       {
         Item_equal *equal_item;
@@ -13516,6 +13517,7 @@
     Item_equal *equal_item;
     List_iterator<Item_equal> it(*new_equalities);
     Item_equal *equality= (Item_equal *) cond;
+    equality->upper_levels= inherited;
     while ((equal_item= it++))
     {
       equality->merge_with_check(equal_item, true);



More information about the commits mailing list