List:Internals« Previous MessageNext Message »
From:eugene Date:October 12 2005 10:38pm
Subject:bk commit into 4.1 tree (evgen:1.2458) BUG#7672
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 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
  1.2458 05/10/13 00:38:25 evgen@stripped +3 -0
  item.cc, sql_lex.cc, sql_select.cc:
    Bug #7672 after merge fix

  sql/item.cc
    1.223 05/10/13 00:37:28 evgen@stripped +9 -3
    Bug #7672 after merge fix

  sql/sql_lex.cc
    1.151 05/10/13 00:36:35 evgen@stripped +2 -1
    Bug #7672 after merge fix

  sql/sql_select.cc
    1.439 05/10/13 00:36:01 evgen@stripped +5 -0
    Bug#7672 after merge fix.

# 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/7672-bug-4.1-mysql

--- 1.222/sql/item.cc	2005-10-12 03:32:13 +04:00
+++ 1.223/sql/item.cc	2005-10-13 00:37:28 +04:00
@@ -1760,10 +1760,16 @@
     if ((tmp= find_field_in_tables(thd, this, tables, &where, 0)) ==
 	not_found_field)
     {
-      if (thd->lex.select_lex.is_item_list_lookup)
+      /* Look up in current select's item_list to find aliased fields */
+      if (thd->lex->current_select->is_item_list_lookup)
       {
-        Item** res= find_item_in_list(this, thd->lex.select_lex.item_list);
-        if (res && *res && (*res)->type() == Item::FIELD_ITEM)
+        uint counter;
+        bool not_used;
+        Item** res= find_item_in_list(//this,
thd->lex->current_select->item_list);
+          this, thd->lex->current_select->item_list, &counter,
+                                        REPORT_EXCEPT_NOT_FOUND,
+                                        &not_used);
+        if (res != not_found_item && (*res)->type() == Item::FIELD_ITEM)
         {
           set_field((*((Item_field**)res))->field);
           return 0;

--- 1.150/sql/sql_lex.cc	2005-10-12 03:32:13 +04:00
+++ 1.151/sql/sql_lex.cc	2005-10-13 00:36:35 +04:00
@@ -160,7 +160,6 @@
   lex->duplicates= DUP_ERROR;
   lex->ignore= 0;
   lex->proc_list.first= 0;
-  lex->select_lex.is_item_list_lookup= 0;
 }
 
 void lex_end(LEX *lex)
@@ -1084,6 +1083,7 @@
   prep_where= 0;
   subquery_in_having= explicit_limit= 0;
   parsing_place= NO_MATTER;
+  is_item_list_lookup= 0;
 }
 
 void st_select_lex::init_select()
@@ -1110,6 +1110,7 @@
   select_limit= HA_POS_ERROR;
   offset_limit= 0;
   with_sum_func= 0;
+
 }
 
 /*

--- 1.438/sql/sql_select.cc	2005-10-12 03:32:13 +04:00
+++ 1.439/sql/sql_select.cc	2005-10-13 00:36:01 +04:00
@@ -8348,11 +8348,16 @@
 
     'it' reassigned in if condition because fix_field can change it.
   */
+  thd->lex->current_select->is_item_list_lookup= 1;
   if (!it->fixed &&
       (it->fix_fields(thd, tables, order->item) ||
        (it= *order->item)->check_cols(1) ||
        thd->is_fatal_error))
+  {
+    thd->lex->current_select->is_item_list_lookup= 0;
     return 1;					// Wrong field 
+  }
+  thd->lex->current_select->is_item_list_lookup= 0;
   uint el= all_fields.elements;
   all_fields.push_front(it);		        // Add new field to field list
   ref_pointer_array[el]= it;
Thread
bk commit into 4.1 tree (evgen:1.2458) BUG#7672eugene12 Oct