~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/varstring.cc

  • Committer: lbieber
  • Date: 2010-09-23 15:49:15 UTC
  • mfrom: (1788.1.3 build)
  • Revision ID: lbieber@orisndriz08-20100923154915-mshh9pwln0igdwrn
Merge Brian - Rollup patch of enum + style on varchar. This modifies enum to always being the same value.
Merge Stewart - Fix embedded_innodb plugin now that TIMESTAMP is 8 bytes. 
Merge Shrews - fix bug 643630 -  Transaction_reader not handling CHAR values that include quotes properly

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
                                 unsigned char null_bit_arg,
58
58
                                 const char *field_name_arg,
59
59
                                 TableShare *share,
60
 
                                 const CHARSET_INFO * const cs)
61
 
  :Field_str(ptr_arg,
62
 
             len_arg,
63
 
             null_ptr_arg,
64
 
             null_bit_arg,
65
 
             field_name_arg, cs),
66
 
   length_bytes(length_bytes_arg)
 
60
                                 const CHARSET_INFO * const cs) :
 
61
  Field_str(ptr_arg,
 
62
            len_arg,
 
63
            null_ptr_arg,
 
64
            null_bit_arg,
 
65
            field_name_arg, cs),
 
66
length_bytes(length_bytes_arg)
67
67
{
68
68
  share->varchar_fields++;
69
69
}
72
72
                                 bool maybe_null_arg,
73
73
                                 const char *field_name_arg,
74
74
                                 TableShare *share,
75
 
                                 const CHARSET_INFO * const cs)
76
 
  :Field_str((unsigned char*) 0,
77
 
             len_arg,
78
 
             maybe_null_arg ? (unsigned char*) "": 0,
79
 
             0,
80
 
             field_name_arg,
81
 
             cs),
82
 
   length_bytes(len_arg < 256 ? 1 :2)
 
75
                                 const CHARSET_INFO * const cs) :
 
76
  Field_str((unsigned char*) 0,
 
77
            len_arg,
 
78
            maybe_null_arg ? (unsigned char*) "": 0,
 
79
            0,
 
80
            field_name_arg,
 
81
            cs),
 
82
  length_bytes(len_arg < 256 ? 1 :2)
83
83
{
84
84
  share->varchar_fields++;
85
85
}
120
120
  char buff[64];
121
121
  uint32_t  length;
122
122
  length= (uint32_t) (field_charset->cset->int64_t10_to_str)(field_charset,
123
 
                                                          buff,
124
 
                                                          sizeof(buff),
125
 
                                                          (unsigned_val ? 10:
126
 
                                                           -10),
127
 
                                                           nr);
 
123
                                                             buff,
 
124
                                                             sizeof(buff),
 
125
                                                             (unsigned_val ? 10: -10),
 
126
                                                             nr);
128
127
  return Field_varstring::store(buff, length, field_charset);
129
128
}
130
129
 
224
223
  uint32_t local_char_length= max_key_length / field_charset->mbmaxlen;
225
224
 
226
225
  local_char_length= my_charpos(field_charset, ptr + length_bytes,
227
 
                          ptr + length_bytes + length, local_char_length);
 
226
                                ptr + length_bytes + length, local_char_length);
228
227
  set_if_smaller(length, local_char_length);
229
228
  return field_charset->coll->strnncollsp(field_charset,
230
229
                                          ptr + length_bytes,
269
268
  }
270
269
 
271
270
  tot_length= my_strnxfrm(field_charset,
272
 
                          to, length, ptr + length_bytes,
273
 
                          tot_length);
 
271
                          to, length, ptr + length_bytes,
 
272
                          tot_length);
274
273
  assert(tot_length == length);
275
274
}
276
275