summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-rw-r--r--sql/item.cc8
-rw-r--r--sql/sp_head.cc3
2 files changed, 8 insertions, 3 deletions
diff --git a/sql/item.cc b/sql/item.cc
index 84eac3a58cf..f247f49293d 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -1217,10 +1217,12 @@ Item_name_const::Item_name_const(Item *name_arg, Item *val):
if (!(valid_args= name_item->basic_const_item() &&
(value_item->basic_const_item() ||
((value_item->type() == FUNC_ITEM) &&
- (((Item_func *) value_item)->functype() ==
- Item_func::NEG_FUNC) &&
+ ((((Item_func *) value_item)->functype() ==
+ Item_func::COLLATE_FUNC) ||
+ ((((Item_func *) value_item)->functype() ==
+ Item_func::NEG_FUNC) &&
(((Item_func *) value_item)->key_item()->type() !=
- FUNC_ITEM)))))
+ FUNC_ITEM)))))))
my_error(ER_WRONG_ARGUMENTS, MYF(0), "NAME_CONST");
Item::maybe_null= TRUE;
}
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index 5ce24aecebd..3ec6dd5cf06 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -123,6 +123,9 @@ sp_get_item_value(THD *thd, Item *item, String *str)
if (cs->escape_with_backslash_is_dangerous)
buf.append(' ');
append_query_string(cs, result, &buf);
+ buf.append(" COLLATE '");
+ buf.append(item->collation.collation->name);
+ buf.append('\'');
str->copy(buf);
return str;