Commit fe65567e authored by unknown's avatar unknown

Fixed bug #34830: mixed table and field names in Item_ref

                  and Item_direct_ref constructor calls.

Order of ref->field_name and ref->table_name arguments
is of Item_ref and Item_direct_ref in the fix_inner_refs
function is inverted.


sql/sql_select.cc:
  Fixed bug #34830: mixed table and field names in Item_ref
                    and Item_direct_ref constructor calls.
  
  Order of ref->field_name and ref->table_name arguments
  is of Item_ref and Item_direct_ref in the fix_inner_refs
  function is inverted. See definitions:
  
    Item_ref(Name_resolution_context *context_arg, Item **item,
             const char *table_name_arg, const char *field_name_arg,
             bool alias_name_used_arg= FALSE)
    and
  
    Item_direct_ref(Name_resolution_context *context_arg, Item **item,
                    const char *table_name_arg,
                    const char *field_name_arg,
                    bool alias_name_used_arg= FALSE)
parent e427a847
...@@ -360,10 +360,10 @@ fix_inner_refs(THD *thd, List<Item> &all_fields, SELECT_LEX *select, ...@@ -360,10 +360,10 @@ fix_inner_refs(THD *thd, List<Item> &all_fields, SELECT_LEX *select,
} }
} }
new_ref= direct_ref ? new_ref= direct_ref ?
new Item_direct_ref(ref->context, item_ref, ref->field_name, new Item_direct_ref(ref->context, item_ref, ref->table_name,
ref->table_name, ref->alias_name_used) : ref->field_name, ref->alias_name_used) :
new Item_ref(ref->context, item_ref, ref->field_name, new Item_ref(ref->context, item_ref, ref->table_name,
ref->table_name, ref->alias_name_used); ref->field_name, ref->alias_name_used);
if (!new_ref) if (!new_ref)
return TRUE; return TRUE;
ref->outer_ref= new_ref; ref->outer_ref= new_ref;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment