List:Commits« Previous MessageNext Message »
From:kgeorge Date:January 31 2007 3:12pm
Subject:bk commit into 5.0 tree (gkodinov:1.2393)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of kgeorge. When kgeorge 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-01-31 16:12:47+02:00, gkodinov@stripped +5 -0
  Merge gkodinov@stripped:/home/bk/mysql-5.0-opt
  into  rakia.gmz:/home/kgeorge/mysql/autopush/B25575-5.0-opt
  MERGE: 1.2341.74.1

  sql/mysql_priv.h@stripped, 2007-01-31 16:12:41+02:00, gkodinov@stripped +0 -0
    Auto merged
    MERGE: 1.425.4.1

  sql/sql_lex.h@stripped, 2007-01-31 16:12:41+02:00, gkodinov@stripped +0 -0
    Auto merged
    MERGE: 1.235.1.2

  sql/sql_parse.cc@stripped, 2007-01-31 16:12:41+02:00, gkodinov@stripped +0 -0
    Auto merged
    MERGE: 1.593.2.1

  sql/sql_yacc.yy@stripped, 2007-01-31 16:12:42+02:00, gkodinov@stripped +0 -0
    Auto merged
    MERGE: 1.499.1.1

  sql/table.cc@stripped, 2007-01-31 16:12:42+02:00, gkodinov@stripped +0 -0
    Auto merged
    MERGE: 1.240.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:	gkodinov
# Host:	rakia.gmz
# Root:	/home/kgeorge/mysql/autopush/B25575-5.0-opt/RESYNC

--- 1.431/sql/mysql_priv.h	2007-01-24 18:11:14 +02:00
+++ 1.432/sql/mysql_priv.h	2007-01-31 16:12:41 +02:00
@@ -985,7 +985,8 @@ bool push_new_name_resolution_context(TH
                                       TABLE_LIST *left_op,
                                       TABLE_LIST *right_op);
 void add_join_on(TABLE_LIST *b,Item *expr);
-void add_join_natural(TABLE_LIST *a,TABLE_LIST *b,List<String> *using_fields);
+void add_join_natural(TABLE_LIST *a,TABLE_LIST *b,List<String> *using_fields,
+                      SELECT_LEX *lex);
 bool add_proc_to_list(THD *thd, Item *item);
 TABLE *unlink_open_table(THD *thd,TABLE *list,TABLE *find);
 void update_non_unique_table_error(TABLE_LIST *update,

--- 1.239/sql/sql_lex.h	2007-01-24 18:11:15 +02:00
+++ 1.240/sql/sql_lex.h	2007-01-31 16:12:41 +02:00
@@ -586,6 +586,20 @@ public:
   int cur_pos_in_select_list;
 
   List<udf_func>     udf_list;                  /* udf function calls stack */
+  /* 
+    This is a copy of the original JOIN USING list that comes from
+    the parser. The parser :
+      1. Sets the natural_join of the second TABLE_LIST in the join
+         and the st_select_lex::prev_join_using.
+      2. Makes a parent TABLE_LIST and sets its is_natural_join/
+       join_using_fields members.
+      3. Uses the wrapper TABLE_LIST as a table in the upper level.
+    We cannot assign directly to join_using_fields in the parser because
+    at stage (1.) the parent TABLE_LIST is not constructed yet and
+    the assignment will override the JOIN USING fields of the lower level
+    joins on the right.
+  */
+  List<String> *prev_join_using;
 
   void init_query();
   void init_select();

--- 1.601/sql/sql_parse.cc	2007-01-18 19:37:41 +02:00
+++ 1.602/sql/sql_parse.cc	2007-01-31 16:12:41 +02:00
@@ -6432,11 +6432,8 @@ TABLE_LIST *st_select_lex::nest_last_joi
         If this is a JOIN ... USING, move the list of joined fields to the
         table reference that describes the join.
       */
-      if (table->join_using_fields)
-      {
-        ptr->join_using_fields= table->join_using_fields;
-        table->join_using_fields= NULL;
-      }
+      if (prev_join_using)
+        ptr->join_using_fields= prev_join_using;
     }
   }
   join_list->push_front(ptr);
@@ -6692,6 +6689,7 @@ void add_join_on(TABLE_LIST *b, Item *ex
     a			Left join argument
     b			Right join argument
     using_fields        Field names from USING clause
+    lex                 The current st_select_lex
   
   IMPLEMENTATION
     This function marks that table b should be joined with a either via
@@ -6720,10 +6718,11 @@ void add_join_on(TABLE_LIST *b, Item *ex
     None
 */
 
-void add_join_natural(TABLE_LIST *a, TABLE_LIST *b, List<String> *using_fields)
+void add_join_natural(TABLE_LIST *a, TABLE_LIST *b, List<String> *using_fields,
+                      SELECT_LEX *lex)
 {
   b->natural_join= a;
-  b->join_using_fields= using_fields;
+  lex->prev_join_using= using_fields;
 }
 
 

--- 1.503/sql/sql_yacc.yy	2007-01-19 03:37:49 +02:00
+++ 1.504/sql/sql_yacc.yy	2007-01-31 16:12:42 +02:00
@@ -5466,11 +5466,11 @@ join_table:
             YYERROR_UNLESS($1 && $3);
 	  }
 	  '(' using_list ')'
-          { add_join_natural($1,$3,$7); $$=$3; }
+          { add_join_natural($1,$3,$7,Select); $$=$3; }
 	| table_ref NATURAL JOIN_SYM table_factor
 	  {
             YYERROR_UNLESS($1 && ($$=$4));
-            add_join_natural($1,$4,NULL);
+            add_join_natural($1,$4,NULL,Select);
           }
 
 /* LEFT JOIN variants */
@@ -5497,11 +5497,15 @@ join_table:
             YYERROR_UNLESS($1 && $5);
 	  }
 	  USING '(' using_list ')'
-          { add_join_natural($1,$5,$9); $5->outer_join|=JOIN_TYPE_LEFT; $$=$5; }
+          { 
+            add_join_natural($1,$5,$9,Select); 
+            $5->outer_join|=JOIN_TYPE_LEFT; 
+            $$=$5; 
+          }
 	| table_ref NATURAL LEFT opt_outer JOIN_SYM table_factor
 	  {
             YYERROR_UNLESS($1 && $6);
- 	    add_join_natural($1,$6,NULL);
+ 	    add_join_natural($1,$6,NULL,Select);
 	    $6->outer_join|=JOIN_TYPE_LEFT;
 	    $$=$6;
 	  }
@@ -5535,12 +5539,12 @@ join_table:
 	    LEX *lex= Lex;
             if (!($$= lex->current_select->convert_right_join()))
               YYABORT;
-            add_join_natural($$,$5,$9);
+            add_join_natural($$,$5,$9,Select);
           }
 	| table_ref NATURAL RIGHT opt_outer JOIN_SYM table_factor
 	  {
             YYERROR_UNLESS($1 && $6);
-	    add_join_natural($6,$1,NULL);
+	    add_join_natural($6,$1,NULL,Select);
 	    LEX *lex= Lex;
             if (!($$= lex->current_select->convert_right_join()))
               YYABORT;

--- 1.241/sql/table.cc	2007-01-24 23:22:47 +02:00
+++ 1.242/sql/table.cc	2007-01-31 16:12:42 +02:00
@@ -2630,6 +2630,7 @@ Field *Natural_join_column::field()
 
 const char *Natural_join_column::table_name()
 {
+  DBUG_ASSERT(table_ref);
   return table_ref->alias;
 }
 
Thread
bk commit into 5.0 tree (gkodinov:1.2393)kgeorge31 Jan