708
Convert string from client character set to the character set of
712
bool Item_param::convert_str_value(Session *session)
715
if (state == STRING_VALUE || state == LONG_DATA_VALUE)
718
Check is so simple because all charsets were set up properly
719
in setup_one_conversion_function, where typecode of
720
placeholder was also taken into account: the variables are different
721
here only if conversion is really necessary.
723
if (value.cs_info.final_character_set_of_str_value !=
724
value.cs_info.character_set_of_placeholder)
726
rc= session->convert_string(&str_value,
727
value.cs_info.character_set_of_placeholder,
728
value.cs_info.final_character_set_of_str_value);
731
str_value.set_charset(value.cs_info.final_character_set_of_str_value);
732
/* Here str_value is guaranteed to be in final_character_set_of_str_value */
734
max_length= str_value.length();
737
str_value_ptr is returned from val_str(). It must be not alloced
738
to prevent it's modification by val_str() invoker.
740
str_value_ptr.set(str_value.ptr(), str_value.length(),
741
str_value.charset());
742
/* Synchronize item charset with value charset */
743
collation.set(str_value.charset(), DERIVATION_COERCIBLE);
749
707
bool Item_param::basic_const_item() const
751
709
if (state == NO_VALUE || state == TIME_VALUE)