~posulliv/drizzle/memcached_applier

« back to all changes in this revision

Viewing changes to drizzled/item/param.cc

Merged trunk and resolved conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
704
704
}
705
705
 
706
706
 
707
 
/**
708
 
  Convert string from client character set to the character set of
709
 
  connection.
710
 
*/
711
 
 
712
 
bool Item_param::convert_str_value(Session *session)
713
 
{
714
 
  bool rc= false;
715
 
  if (state == STRING_VALUE || state == LONG_DATA_VALUE)
716
 
  {
717
 
    /*
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.
722
 
    */
723
 
    if (value.cs_info.final_character_set_of_str_value !=
724
 
        value.cs_info.character_set_of_placeholder)
725
 
    {
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);
729
 
    }
730
 
    else
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 */
733
 
 
734
 
    max_length= str_value.length();
735
 
    decimals= 0;
736
 
    /*
737
 
      str_value_ptr is returned from val_str(). It must be not alloced
738
 
      to prevent it's modification by val_str() invoker.
739
 
    */
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);
744
 
  }
745
 
  return rc;
746
 
}
747
 
 
748
 
 
749
707
bool Item_param::basic_const_item() const
750
708
{
751
709
  if (state == NO_VALUE || state == TIME_VALUE)