Commit 8f41679c authored by unknown's avatar unknown

Merge dev3-240.dev.cn.tlan:/home/justin.he/mysql/mysql-5.1/mysql-5.1-new-ndb-bj

into  dev3-240.dev.cn.tlan:/home/justin.he/mysql/mysql-5.1/bug25431-5.1-new-ndb-bj

parents c4ecbdc4 ec57e081
......@@ -6159,13 +6159,21 @@ uint Field::is_equal(create_field *new_field)
}
/* If one of the fields is binary and the other one isn't return 1 else 0 */
bool Field_str::compare_str_field_flags(create_field *new_field, uint32 flags)
{
return (((new_field->flags & (BINCMP_FLAG | BINARY_FLAG)) &&
!(flags & (BINCMP_FLAG | BINARY_FLAG))) ||
(!(new_field->flags & (BINCMP_FLAG | BINARY_FLAG)) &&
(flags & (BINCMP_FLAG | BINARY_FLAG))));
}
uint Field_str::is_equal(create_field *new_field)
{
if (((new_field->flags & (BINCMP_FLAG | BINARY_FLAG)) &&
!(flags & (BINCMP_FLAG | BINARY_FLAG))) ||
(!(new_field->flags & (BINCMP_FLAG | BINARY_FLAG)) &&
(flags & (BINCMP_FLAG | BINARY_FLAG))))
return 0; /* One of the fields is binary and the other one isn't */
if (compare_str_field_flags(new_field, flags))
return 0;
return ((new_field->sql_type == real_type()) &&
new_field->charset == field_charset &&
......@@ -7671,6 +7679,18 @@ uint Field_blob::max_packed_col_length(uint max_length)
}
uint Field_blob::is_equal(create_field *new_field)
{
if (compare_str_field_flags(new_field, flags))
return 0;
return ((new_field->sql_type == get_blob_type_from_length(max_data_length()))
&& new_field->charset == field_charset &&
((Field_blob *)new_field->field)->max_data_length() ==
max_data_length());
}
#ifdef HAVE_SPATIAL
void Field_geom::get_key_image(char *buff, uint length, imagetype type_arg)
......
......@@ -473,6 +473,7 @@ class Field_str :public Field {
friend class create_field;
my_decimal *val_decimal(my_decimal *);
virtual bool str_needs_quotes() { return TRUE; }
bool compare_str_field_flags(create_field *new_field, uint32 flags);
uint is_equal(create_field *new_field);
};
......@@ -1325,6 +1326,7 @@ class Field_blob :public Field_longstr {
bool has_charset(void) const
{ return charset() == &my_charset_bin ? FALSE : TRUE; }
uint32 max_display_length();
uint is_equal(create_field *new_field);
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment