List:Commits« Previous MessageNext Message »
From:holyfoot Date:March 22 2007 8:21am
Subject:bk commit into 5.0 tree (holyfoot:1.2488)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of hf. When hf 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, 2007-03-22 12:21:06+04:00, holyfoot@stripped +4 -0
  Merge bk@stripped:mysql-5.0
  into  mysql.com:/home/hf/work/mrg/mysql-5.0-opt
  MERGE: 1.2485.1.7

  sql/item.h@stripped, 2007-03-22 12:21:02+04:00, holyfoot@stripped +0 -0
    Auto merged
    MERGE: 1.222.1.1

  sql/sql_base.cc@stripped, 2007-03-22 12:21:02+04:00, holyfoot@stripped +0 -0
    Auto merged
    MERGE: 1.370.1.1

  sql/sql_select.cc@stripped, 2007-03-22 12:21:03+04:00, holyfoot@stripped +0 -0
    Auto merged
    MERGE: 1.498.1.1

  sql/sql_yacc.yy@stripped, 2007-03-22 12:21:04+04:00, holyfoot@stripped +0 -0
    Auto merged
    MERGE: 1.510.1.1

# 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:	holyfoot
# Host:	hfmain.(none)
# Root:	/home/hf/work/mrg/mysql-5.0-opt/RESYNC

--- 1.223/sql/item.h	2007-03-22 12:21:11 +04:00
+++ 1.224/sql/item.h	2007-03-22 12:21:11 +04:00
@@ -1901,6 +1901,11 @@ public:
   {
     return depended_from ? OUTER_REF_TABLE_BIT : (*ref)->used_tables(); 
   }
+  void update_used_tables() 
+  { 
+    if (!depended_from) 
+      (*ref)->update_used_tables(); 
+  }
   table_map not_null_tables() const { return (*ref)->not_null_tables(); }
   void set_result_field(Field *field)	{ result_field= field; }
   bool is_result_field() { return 1; }

--- 1.371/sql/sql_base.cc	2007-03-22 12:21:11 +04:00
+++ 1.372/sql/sql_base.cc	2007-03-22 12:21:11 +04:00
@@ -4865,6 +4865,7 @@ bool setup_tables_and_check_access(THD *
   TABLE_LIST *leaves_tmp = NULL;
   bool first_table= true;
 
+  thd->leaf_count= 0;
   if (setup_tables (thd, context, from_clause, tables, conds, 
                     &leaves_tmp, select_insert))
     return TRUE;
@@ -4882,6 +4883,7 @@ bool setup_tables_and_check_access(THD *
       return TRUE;
     }
     first_table= false;
+    thd->leaf_count++;
   }
   return FALSE;
 }

--- 1.499/sql/sql_select.cc	2007-03-22 12:21:11 +04:00
+++ 1.500/sql/sql_select.cc	2007-03-22 12:21:11 +04:00
@@ -406,12 +406,15 @@ JOIN::prepare(Item ***rref_pointer_array
 
   /* Check that all tables, fields, conds and order are ok */
 
-  if ((!(select_options & OPTION_SETUP_TABLES_DONE) &&
-       setup_tables_and_check_access(thd, &select_lex->context, join_list,
-                                     tables_list, &conds, 
-                                     &select_lex->leaf_tables, FALSE, 
-                                     SELECT_ACL, SELECT_ACL)) ||
-      setup_wild(thd, tables_list, fields_list, &all_fields, wild_num) ||
+  if (!(select_options & OPTION_SETUP_TABLES_DONE) &&
+      setup_tables_and_check_access(thd, &select_lex->context, join_list,
+                                    tables_list, &conds, 
+                                    &select_lex->leaf_tables, FALSE, 
+                                    SELECT_ACL, SELECT_ACL))
+      DBUG_RETURN(-1);
+  tables= thd->leaf_count;
+
+  if (setup_wild(thd, tables_list, fields_list, &all_fields, wild_num) ||
       select_lex->setup_ref_array(thd, og_num) ||
       setup_fields(thd, (*rref_pointer_array), fields_list, 1,
 		   &all_fields, 1) ||
@@ -516,11 +519,6 @@ JOIN::prepare(Item ***rref_pointer_array
 	DBUG_RETURN(-1);
       }
     }
-    TABLE_LIST *table_ptr;
-    for (table_ptr= select_lex->leaf_tables;
-	 table_ptr;
-	 table_ptr= table_ptr->next_leaf)
-      tables++;
   }
   {
     /* Caclulate the number of groups */
@@ -6461,7 +6459,8 @@ static void update_depend_map(JOIN *join
     order->item[0]->update_used_tables();
     order->depend_map=depend_map=order->item[0]->used_tables();
     // Not item_sum(), RAND() and no reference to table outside of sub select
-    if (!(order->depend_map & (OUTER_REF_TABLE_BIT | RAND_TABLE_BIT)))
+    if (!(order->depend_map & (OUTER_REF_TABLE_BIT | RAND_TABLE_BIT))
+        && !order->item[0]->with_sum_func)
     {
       for (JOIN_TAB **tab=join->map2table;
 	   depend_map ;

--- 1.511/sql/sql_yacc.yy	2007-03-22 12:21:11 +04:00
+++ 1.512/sql/sql_yacc.yy	2007-03-22 12:21:11 +04:00
@@ -9296,7 +9296,7 @@ union_list:
 	UNION_SYM union_option
 	{
 	  LEX *lex=Lex;
-	  if (lex->exchange)
+	  if (lex->result)
 	  {
 	    /* Only the last SELECT can have  INTO...... */
 	    my_error(ER_WRONG_USAGE, MYF(0), "UNION", "INTO");
Thread
bk commit into 5.0 tree (holyfoot:1.2488)holyfoot22 Mar