summaryrefslogtreecommitdiff
path: root/sql/item.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/item.cc')
-rw-r--r--sql/item.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/item.cc b/sql/item.cc
index 0371f5e891f..6f68ba37603 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -1058,6 +1058,7 @@ Item_splocal::Item_splocal(const LEX_STRING &sp_var_name,
maybe_null= TRUE;
m_type= sp_map_item_type(sp_var_type);
+ m_field_type= sp_var_type;
m_result_type= sp_map_result_type(sp_var_type);
}
@@ -3558,7 +3559,8 @@ Item_field::fix_outer_field(THD *thd, Field **from_field, Item **reference)
prev_subselect_item->const_item_cache= 0;
set_field(*from_field);
if (!last_checked_context->select_lex->having_fix_field &&
- select->group_list.elements)
+ select->group_list.elements &&
+ (place == SELECT_LIST || place == IN_HAVING))
{
Item_outer_ref *rf;
/*
@@ -4731,7 +4733,6 @@ inline uint char_val(char X)
Item_hex_string::Item_hex_string(const char *str, uint str_length)
{
- name=(char*) str-2; // Lex makes this start with 0x
max_length=(str_length+1)/2;
char *ptr=(char*) sql_alloc(max_length+1);
if (!ptr)
@@ -4842,7 +4843,6 @@ Item_bin_string::Item_bin_string(const char *str, uint str_length)
uchar bits= 0;
uint power= 1;
- name= (char*) str - 2;
max_length= (str_length + 7) >> 3;
char *ptr= (char*) sql_alloc(max_length + 1);
if (!ptr)