summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorRamil Kalimullin <ramil@mysql.com>2008-10-02 10:56:07 +0500
committerRamil Kalimullin <ramil@mysql.com>2008-10-02 10:56:07 +0500
commit6037e8ec49572eae3a0a079f6b818caf0f96ab1b (patch)
treee274302a462958e8698e43a2a1c90f8fc43e5828 /sql
parent71e061db68fdf47babdd240ae6be57f28067dbac (diff)
parentd3e317d16befe9e6d7ade3e0527dca10609577ad (diff)
downloadmariadb-git-6037e8ec49572eae3a0a079f6b818caf0f96ab1b.tar.gz
Merge
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 cdb71e86694..66d5d55a21e 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -1248,10 +1248,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 cf6610dfa11..a0eda42f0c5 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -126,6 +126,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;