List:Commits« Previous MessageNext Message »
From:eugene Date:July 13 2006 2:18pm
Subject:bk commit into 5.0 tree (evgen:1.2235)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of evgen. When evgen 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@stripped, 2006-07-13 18:18:20+04:00, evgen@stripped +6 -0
  Merge moonbone.local:/work/16302-bug-4.1-opt-mysql
  into  moonbone.local:/work/tmp_merge-5.0-opt-mysql
  MERGE: 1.1616.2658.3

  mysql-test/r/subselect.result@stripped, 2006-07-13 18:18:19+04:00, evgen@stripped +1 -0
    Manual merge
    MERGE: 1.67.1.110

  mysql-test/t/subselect.test@stripped, 2006-07-13 18:18:19+04:00, evgen@stripped +7 -1
    Manual merge
    MERGE: 1.58.1.97

  sql/item_subselect.cc@stripped, 2006-07-13 18:17:00+04:00, evgen@stripped +0 -0
    Auto merged
    MERGE: 1.60.1.81

  sql/sql_class.cc@stripped, 2006-07-13 18:17:00+04:00, evgen@stripped +0 -0
    Auto merged
    MERGE: 1.105.1.103

  sql/sql_class.h@stripped, 2006-07-13 18:17:01+04:00, evgen@stripped +0 -0
    Auto merged
    MERGE: 1.146.52.15

  sql/sql_select.cc@stripped, 2006-07-13 18:17:01+04:00, evgen@stripped +0 -0
    Auto merged
    MERGE: 1.216.125.10

# 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:	evgen
# Host:	moonbone.local
# Root:	/work/tmp_merge-5.0-opt-mysql/RESYNC

--- 1.430/sql/sql_select.cc	2006-07-13 18:18:24 +04:00
+++ 1.431/sql/sql_select.cc	2006-07-13 18:18:24 +04:00
@@ -10608,8 +10608,13 @@
 	{
 	  if (!join->first_record)
 	  {
+            List_iterator_fast<Item> it(*join->fields);
+            Item *item;
 	    /* No matching rows for group function */
 	    join->clear();
+
+            while ((item= it++))
+              item->no_rows_in_result();
 	  }
 	  if (join->having && join->having->val_int() == 0)
 	    error= -1;				// Didn't satisfy having

--- 1.145/mysql-test/r/subselect.result	2006-07-13 18:18:24 +04:00
+++ 1.146/mysql-test/r/subselect.result	2006-07-13 18:18:24 +04:00
@@ -2854,6 +2854,40 @@
 3
 4
 DROP TABLE t1,t2,t3;
+purge master logs before (select adddate(current_timestamp(), interval -4 day));
+CREATE TABLE t1 (f1 INT);
+CREATE TABLE t2 (f2 INT);
+INSERT INTO t1 VALUES (1);
+SELECT * FROM t1 WHERE f1 > ALL (SELECT f2 FROM t2);
+f1
+1
+SELECT * FROM t1 WHERE f1 > ALL (SELECT f2 FROM t2 WHERE 1=0);
+f1
+1
+INSERT INTO t2 VALUES (1);
+INSERT INTO t2 VALUES (2);
+SELECT * FROM t1 WHERE f1 > ALL (SELECT f2 FROM t2 WHERE f2=0);
+f1
+1
+DROP TABLE t1, t2;
+select 1 from dual where 1 < any (select 2);
+1
+1
+select 1 from dual where 1 < all (select 2);
+1
+1
+select 1 from dual where 2 > any (select 1);
+1
+1
+select 1 from dual where 2 > all (select 1);
+1
+1
+select 1 from dual where 1 < any (select 2 from dual);
+1
+1
+select 1 from dual where 1 < all (select 2 from dual where 1!=1);
+1
+1
 create table t1 (df decimal(5,1));
 insert into t1 values(1.1);
 insert into t1 values(2.2);

--- 1.119/mysql-test/t/subselect.test	2006-07-13 18:18:24 +04:00
+++ 1.120/mysql-test/t/subselect.test	2006-07-13 18:18:24 +04:00
@@ -1821,6 +1821,36 @@
 
 DROP TABLE t1,t2,t3;
 
+#
+# BUG #10308: purge log with subselect
+#
+
+purge master logs before (select adddate(current_timestamp(), interval -4 day));
+
+
+#
+# Bug#18503: Queries with a quantified subquery returning empty set may
+# return a wrong result. 
+#
+CREATE TABLE t1 (f1 INT);
+CREATE TABLE t2 (f2 INT);
+INSERT INTO t1 VALUES (1);
+SELECT * FROM t1 WHERE f1 > ALL (SELECT f2 FROM t2);
+SELECT * FROM t1 WHERE f1 > ALL (SELECT f2 FROM t2 WHERE 1=0);
+INSERT INTO t2 VALUES (1);
+INSERT INTO t2 VALUES (2);
+SELECT * FROM t1 WHERE f1 > ALL (SELECT f2 FROM t2 WHERE f2=0);
+DROP TABLE t1, t2;
+
+#
+# Bug#16302: Quantified subquery without any tables gives wrong results
+#
+select 1 from dual where 1 < any (select 2);
+select 1 from dual where 1 < all (select 2);
+select 1 from dual where 2 > any (select 1);
+select 1 from dual where 2 > all (select 1);
+select 1 from dual where 1 < any (select 2 from dual);
+select 1 from dual where 1 < all (select 2 from dual where 1!=1);
 # End of 4.1 tests
 
 #

--- 1.126/sql/item_subselect.cc	2006-07-13 18:18:24 +04:00
+++ 1.127/sql/item_subselect.cc	2006-07-13 18:18:24 +04:00
@@ -802,7 +802,8 @@
     if (!select_lex->group_list.elements &&
         !select_lex->having &&
 	!select_lex->with_sum_func &&
-	!(select_lex->next_select()))
+	!(select_lex->next_select()) &&
+        select_lex->table_list.elements)
     {
       Item_sum_hybrid *item;
       nesting_map save_allow_sum_func;
Thread
bk commit into 5.0 tree (evgen:1.2235)eugene15 Jul