summaryrefslogtreecommitdiff
path: root/sql/item.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2012-05-17 12:12:33 +0200
committerSergei Golubchik <sergii@pisem.net>2012-05-17 12:12:33 +0200
commit0a8c9b98f60bb1a21c7e67a1bb47166f0acfeddb (patch)
tree7e682617fcbdab399d2eafccb6a4800dfdc71e51 /sql/item.cc
parent97ae1682f185be05276b172919e47fd86e9fd953 (diff)
parentdf905524b218de07dddf5fa394af96edcc4ca483 (diff)
downloadmariadb-git-0a8c9b98f60bb1a21c7e67a1bb47166f0acfeddb.tar.gz
merge with mysql-5.1.63
Diffstat (limited to 'sql/item.cc')
-rw-r--r--sql/item.cc23
1 files changed, 8 insertions, 15 deletions
diff --git a/sql/item.cc b/sql/item.cc
index 55c32ea8f41..c2e208fe10f 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -3098,7 +3098,7 @@ String *Item_param::val_str(String* str)
that binary log contains wrong statement
*/
-const String *Item_param::query_val_str(String* str) const
+const String *Item_param::query_val_str(THD *thd, String* str) const
{
switch (state) {
case INT_VALUE:
@@ -3136,7 +3136,8 @@ const String *Item_param::query_val_str(String* str) const
case LONG_DATA_VALUE:
{
str->length(0);
- append_query_string(value.cs_info.character_set_client, &str_value, str);
+ append_query_string(thd, value.cs_info.character_set_client, &str_value,
+ str);
break;
}
case NULL_VALUE:
@@ -3269,7 +3270,7 @@ void Item_param::print(String *str, enum_query_type query_type)
char buffer[STRING_BUFFER_USUAL_SIZE];
String tmp(buffer, sizeof(buffer), &my_charset_bin);
const String *res;
- res= query_val_str(&tmp);
+ res= query_val_str(current_thd, &tmp);
str->append(*res);
}
}
@@ -6692,20 +6693,12 @@ bool Item_insert_value::fix_fields(THD *thd, Item **items)
}
if (arg->type() == REF_ITEM)
+ arg= static_cast<Item_ref *>(arg)->ref[0];
+ if (arg->type() != FIELD_ITEM)
{
- Item_ref *ref= (Item_ref *)arg;
- if (ref->ref[0]->type() != FIELD_ITEM)
- {
- my_error(ER_BAD_FIELD_ERROR, MYF(0), "", "VALUES() function");
- return TRUE;
- }
- arg= ref->ref[0];
+ my_error(ER_BAD_FIELD_ERROR, MYF(0), "", "VALUES() function");
+ return TRUE;
}
- /*
- According to our SQL grammar, VALUES() function can reference
- only to a column.
- */
- DBUG_ASSERT(arg->type() == FIELD_ITEM);
Item_field *field_arg= (Item_field *)arg;