mirror of
https://github.com/MariaDB/server.git
synced 2026-05-03 13:45:34 +02:00
5.2 merge
This commit is contained in:
commit
7f6f53a8df
117 changed files with 2796 additions and 340 deletions
23
sql/item.cc
23
sql/item.cc
|
|
@ -3362,7 +3362,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:
|
||||
|
|
@ -3400,7 +3400,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:
|
||||
|
|
@ -3533,7 +3534,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);
|
||||
}
|
||||
}
|
||||
|
|
@ -7756,20 +7757,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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue