List:Commits« Previous MessageNext Message »
From:Alexey Kopytov Date:November 23 2009 10:16am
Subject:bzr push into mysql-pe branch (Alexey.Kopytov:3704 to 3706)
View as plain text  
 3706 Alexey Kopytov	2009-11-23 [merge]
      Automerge.

 3705 Alexey Kopytov	2009-11-23 [merge]
      Automerge.

    modified:
      mysql-test/r/group_min_max.result
      mysql-test/t/group_min_max.test
      sql/opt_range.cc
 3704 Li-Bing.Song@stripped	2009-11-22 [merge]
      Manual Merge

    added:
      mysql-test/suite/rpl/r/rpl_row_trunc_temp.result
      mysql-test/suite/rpl/t/rpl_row_trunc_temp.test
    modified:
      sql/sql_delete.cc
=== modified file 'mysql-test/r/group_min_max.result'
--- a/mysql-test/r/group_min_max.result	2009-10-23 06:24:37 +0000
+++ b/mysql-test/r/group_min_max.result	2009-11-23 10:06:22 +0000
@@ -2501,6 +2501,17 @@ SELECT a, MAX(b) FROM t WHERE b > 0 AND 
 a	MAX(b)
 2	1
 DROP TABLE t;
+#
+# Bug #48472: Loose index scan inappropriately chosen for some WHERE
+#             conditions
+# 
+CREATE TABLE t (a INT, b INT, INDEX (a,b));
+INSERT INTO t VALUES (2,0), (2,0), (2,1), (2,1);
+INSERT INTO t SELECT * FROM t;
+SELECT a, MAX(b) FROM t WHERE 0=b+0 GROUP BY a;
+a	MAX(b)
+2	0
+DROP TABLE t;
 End of 5.0 tests
 #
 # Bug #46607: Assertion failed: (cond_type == Item::FUNC_ITEM) results in

=== modified file 'mysql-test/t/group_min_max.test'
--- a/mysql-test/t/group_min_max.test	2009-10-12 09:08:34 +0000
+++ b/mysql-test/t/group_min_max.test	2009-11-23 10:06:22 +0000
@@ -1016,6 +1016,18 @@ SELECT a, MAX(b) FROM t WHERE b > 0 AND 
 
 DROP TABLE t;
 
+--echo #
+--echo # Bug #48472: Loose index scan inappropriately chosen for some WHERE
+--echo #             conditions
+--echo # 
+
+CREATE TABLE t (a INT, b INT, INDEX (a,b));
+INSERT INTO t VALUES (2,0), (2,0), (2,1), (2,1);
+INSERT INTO t SELECT * FROM t;                                   
+
+SELECT a, MAX(b) FROM t WHERE 0=b+0 GROUP BY a;
+
+DROP TABLE t;
 
 --echo End of 5.0 tests
 

=== modified file 'sql/opt_range.cc'
--- a/sql/opt_range.cc	2009-11-20 13:50:24 +0000
+++ b/sql/opt_range.cc	2009-11-23 10:10:11 +0000
@@ -10182,7 +10182,11 @@ check_group_min_max_predicates(COND *con
     }
     else if (cur_arg->const_item())
     {
-      DBUG_RETURN(TRUE);
+      /*
+        For predicates of the form "const OP expr" we also have to check 'expr'
+        to make a decision.
+      */
+      continue;
     }
     else
       DBUG_RETURN(FALSE);


Attachment: [text/bzr-bundle] bzr/alexey.kopytov@sun.com-20091123101011-4gxu3ipb2f92t12d.bundle
Thread
bzr push into mysql-pe branch (Alexey.Kopytov:3704 to 3706)Alexey Kopytov23 Nov