~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field_conv.cc

  • Committer: Brian Aker
  • Date: 2010-11-06 15:43:10 UTC
  • mfrom: (1908.1.1 merge)
  • Revision ID: brian@tangent.org-20101106154310-g1jpjzwbc53pfc4f
Filesort encapsulation, plus modification to copy contructor

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
 
        /* Field_blob is not part of the Field_varstring hierarchy,
692
 
           and casting to varstring for calling pack_length_no_ptr()
693
 
           is always incorrect. Previously the below comparison has
694
 
           always evaluated to false as pack_length_no_ptr() for BLOB
695
 
           will return 4 and varstring can only be <= 2.
696
 
           If your brain slightly bleeds as to why this worked for
697
 
           so many years, you are in no way alone.
698
 
        */
699
 
        if (from->flags & BLOB_FLAG)
700
 
          return do_field_string;
701
 
 
702
 
        if ((static_cast<Field_varstring*>(to))->pack_length_no_ptr() !=
703
 
            (static_cast<Field_varstring*>(from))->pack_length_no_ptr())
 
691
        if (((Field_varstring*) to)->pack_length_no_ptr() !=
 
692
            ((Field_varstring*) from)->pack_length_no_ptr())
704
693
        {
705
694
          return do_field_string;
706
695
        }