Commit 19616945 authored by sergefp@mysql.com's avatar sergefp@mysql.com

Coding style fixes

parent 892d859f
...@@ -756,43 +756,42 @@ bool Item_param::set_from_user_var(THD *thd, const user_var_entry *entry) ...@@ -756,43 +756,42 @@ bool Item_param::set_from_user_var(THD *thd, const user_var_entry *entry)
if (entry && entry->value) if (entry && entry->value)
{ {
item_result_type= entry->type; item_result_type= entry->type;
switch (entry->type) switch (entry->type) {
case REAL_RESULT:
set_double(*(double*)entry->value);
break;
case INT_RESULT:
set_int(*(longlong*)entry->value, 21);
break;
case STRING_RESULT:
{ {
case REAL_RESULT: CHARSET_INFO *fromcs= entry->collation.collation;
set_double(*(double*)entry->value); CHARSET_INFO *tocs= thd->variables.collation_connection;
break; uint32 dummy_offset;
case INT_RESULT:
set_int(*(longlong*)entry->value, 21); value.cs_info.character_set_client= fromcs;
break; /*
case STRING_RESULT: Setup source and destination character sets so that they
{ are different only if conversion is necessary: this will
CHARSET_INFO *fromcs= entry->collation.collation; make later checks easier.
CHARSET_INFO *tocs= thd->variables.collation_connection; */
uint32 dummy_offset; value.cs_info.final_character_set_of_str_value=
String::needs_conversion(0, fromcs, tocs, &dummy_offset) ?
value.cs_info.character_set_client= fromcs; tocs : fromcs;
/* /*
Setup source and destination character sets so that they Exact value of max_length is not known unless data is converted to
are different only if conversion is necessary: this will charset of connection, so we have to set it later.
make later checks easier. */
*/ item_type= Item::STRING_ITEM;
value.cs_info.final_character_set_of_str_value= item_result_type= STRING_RESULT;
String::needs_conversion(0, fromcs, tocs, &dummy_offset) ?
tocs : fromcs; if (set_str((const char *)entry->value, entry->length))
/* DBUG_RETURN(1);
Exact value of max_length is not known unless data is converted to break;
charset of connection, so we have to set it later. }
*/ default:
item_type= Item::STRING_ITEM; DBUG_ASSERT(0);
item_result_type= STRING_RESULT; set_null();
if (set_str((const char *)entry->value, entry->length))
DBUG_RETURN(1);
}
break;
default:
DBUG_ASSERT(0);
set_null();
} }
} }
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment