List:Commits« Previous MessageNext Message »
From:igor Date:April 5 2006 9:01pm
Subject:bk commit into 5.1 tree (igor:1.2292)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of igor. When igor does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2292 06/04/05 14:00:54 igor@stripped +3 -0
  Merge rurik.mysql.com:/home/igor/dev/mysql-5.0-0
  into  rurik.mysql.com:/home/igor/dev/mysql-5.1-0

  sql/opt_sum.cc
    1.48 06/04/05 14:00:46 igor@stripped +0 -0
    Auto merged

  mysql-test/t/view.test
    1.142 06/04/05 14:00:46 igor@stripped +0 -0
    Auto merged

  mysql-test/r/view.result
    1.154 06/04/05 14:00:46 igor@stripped +0 -0
    Auto merged

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	igor
# Host:	rurik.mysql.com
# Root:	/home/igor/dev/mysql-5.1-0/RESYNC

--- 1.47/sql/opt_sum.cc	2006-01-06 23:26:13 -08:00
+++ 1.48/sql/opt_sum.cc	2006-04-05 14:00:46 -07:00
@@ -96,8 +96,14 @@
   */
   for (TABLE_LIST *tl= tables; tl; tl= tl->next_leaf)
   {
+    TABLE_LIST *embedded;
+    for (embedded= tl ; embedded; embedded= embedded->embedding)
+    {
+      if (embedded->on_expr)
+        break;
+    }
+    if (embedded)
     /* Don't replace expression on a table that is part of an outer join */
-    if (tl->on_expr)
     {
       outer_tables|= tl->table->map;
 

--- 1.153/mysql-test/r/view.result	2006-03-27 18:30:32 -08:00
+++ 1.154/mysql-test/r/view.result	2006-04-05 14:00:46 -07:00
@@ -2562,3 +2562,20 @@
 1.4142135623731
 DROP VIEW v1;
 DROP TABLE t1;
+CREATE TABLE t1 (id int PRIMARY KEY);
+CREATE TABLE t2 (id int PRIMARY KEY);
+INSERT INTO t1 VALUES (1), (3);
+INSERT INTO t2 VALUES (1), (2), (3);
+CREATE VIEW v2 AS SELECT * FROM t2;
+SELECT COUNT(*) FROM t1 LEFT JOIN t2 ON t1.id=t2.id;
+COUNT(*)
+2
+SELECT * FROM t1 LEFT JOIN t2 ON t1.id=t2.id;
+id	id
+1	1
+3	3
+SELECT COUNT(*) FROM t1 LEFT JOIN v2 ON t1.id=v2.id;
+COUNT(*)
+2
+DROP VIEW v2;
+DROP TABLE t1, t2;

--- 1.141/mysql-test/t/view.test	2006-03-27 18:30:32 -08:00
+++ 1.142/mysql-test/t/view.test	2006-04-05 14:00:46 -07:00
@@ -2418,3 +2418,24 @@
 
 DROP VIEW v1;
 DROP TABLE t1;
+
+#
+# Bug #18237: invalid count optimization applied to an outer join with a view 
+#             
+
+CREATE TABLE t1 (id int PRIMARY KEY);
+CREATE TABLE t2 (id int PRIMARY KEY);
+
+INSERT INTO t1 VALUES (1), (3);
+INSERT INTO t2 VALUES (1), (2), (3);
+
+CREATE VIEW v2 AS SELECT * FROM t2;
+
+SELECT COUNT(*) FROM t1 LEFT JOIN t2 ON t1.id=t2.id;
+SELECT * FROM t1 LEFT JOIN t2 ON t1.id=t2.id;
+
+SELECT COUNT(*) FROM t1 LEFT JOIN v2 ON t1.id=v2.id;
+
+DROP VIEW v2;
+
+DROP TABLE t1, t2;
Thread
bk commit into 5.1 tree (igor:1.2292)igor5 Apr