~stewart/drizzle/rename-embedded-innodb-to-haildb

« back to all changes in this revision

Viewing changes to drizzled/field_conv.cc

  • Committer: Stewart Smith
  • Date: 2010-09-30 05:47:49 UTC
  • mfrom: (1787.3.15 drizzle)
  • Revision ID: stewart@flamingspork.com-20100930054749-s1szrpe6wm2z8532
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
688
688
        return do_field_string;
689
689
      else if (to->real_type() == DRIZZLE_TYPE_VARCHAR)
690
690
      {
691
 
        if (((Field_varstring*) to)->length_bytes !=
692
 
            ((Field_varstring*) from)->length_bytes)
 
691
        if (((Field_varstring*) to)->pack_length_no_ptr() !=
 
692
            ((Field_varstring*) from)->pack_length_no_ptr())
693
693
        {
694
694
          return do_field_string;
695
695
        }
696
696
        
697
697
        if (to_length != from_length)
698
698
        {
699
 
          return (((Field_varstring*) to)->length_bytes == 1 ?
 
699
          return (((Field_varstring*) to)->pack_length_no_ptr() == 1 ?
700
700
                  (from->charset()->mbmaxlen == 1 ? do_varstring1 :
701
701
                                                    do_varstring1_mb) :
702
702
                  (from->charset()->mbmaxlen == 1 ? do_varstring2 :
769
769
        from->charset() == to->charset() &&
770
770
        to->getTable()->getShare()->db_low_byte_first == from->getTable()->getShare()->db_low_byte_first &&
771
771
        (!(to->getTable()->in_use->variables.sql_mode & (MODE_NO_ZERO_DATE | MODE_INVALID_DATES)) || (to->type() != DRIZZLE_TYPE_DATE && to->type() != DRIZZLE_TYPE_DATETIME)) &&
772
 
        (from->real_type() != DRIZZLE_TYPE_VARCHAR || ((Field_varstring*)from)->length_bytes == ((Field_varstring*)to)->length_bytes))
 
772
        (from->real_type() != DRIZZLE_TYPE_VARCHAR || ((Field_varstring*)from)->pack_length_no_ptr() == ((Field_varstring*)to)->pack_length_no_ptr()))
773
773
    {                                           // Identical fields
774
774
      /* This may happen if one does 'UPDATE ... SET x=x' */
775
775
      if (to->ptr != from->ptr)