~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/str.cc

Merge.

Show diffs side-by-side

added added

removed removed

Lines of Context:
144
144
  return store(buff, length, charset());
145
145
}
146
146
 
147
 
/* If one of the fields is binary and the other one isn't return 1 else 0 */
148
 
 
149
 
bool Field_str::compare_str_field_flags(CreateField *new_field_ptr,
150
 
                                        uint32_t flag_arg)
151
 
{
152
 
  return (((new_field_ptr->flags & (BINCMP_FLAG | BINARY_FLAG)) &&
153
 
          !(flag_arg & (BINCMP_FLAG | BINARY_FLAG))) ||
154
 
         (!(new_field_ptr->flags & (BINCMP_FLAG | BINARY_FLAG)) &&
155
 
          (flag_arg & (BINCMP_FLAG | BINARY_FLAG))));
156
 
}
157
 
 
158
 
 
159
 
uint32_t Field_str::is_equal(CreateField *new_field_ptr)
160
 
{
161
 
  if (compare_str_field_flags(new_field_ptr, flags))
162
 
    return 0;
163
 
 
164
 
  return ((new_field_ptr->sql_type == real_type()) &&
165
 
          new_field_ptr->charset == field_charset &&
166
 
          new_field_ptr->length == max_display_length());
167
 
}
168
 
 
169
147
 
170
148
bool check_string_copy_error(Field_str *field,
171
149
                             const char *well_formed_error_pos,