Commit 51870873 authored by unknown's avatar unknown

Fix for bug#18133: Adding index to unsigned int causes on-line add index not to be used

parent 33d8c89b
......@@ -5970,7 +5970,7 @@ int Field_str::store(double nr)
uint Field::is_equal(create_field *new_field)
{
return (new_field->sql_type == type());
return (new_field->sql_type == real_type());
}
......@@ -5982,7 +5982,7 @@ uint Field_str::is_equal(create_field *new_field)
(flags & (BINCMP_FLAG | BINARY_FLAG))))
return 0; /* One of the fields is binary and the other one isn't */
return ((new_field->sql_type == type()) &&
return ((new_field->sql_type == real_type()) &&
new_field->charset == field_charset &&
new_field->length == max_length());
}
......@@ -6779,7 +6779,7 @@ Field *Field_varstring::new_key_field(MEM_ROOT *root,
uint Field_varstring::is_equal(create_field *new_field)
{
if (new_field->sql_type == type() &&
if (new_field->sql_type == real_type() &&
new_field->charset == field_charset)
{
if (new_field->length == max_length())
......@@ -7938,12 +7938,12 @@ bool Field_num::eq_def(Field *field)
uint Field_num::is_equal(create_field *new_field)
{
return ((new_field->sql_type == type()) &&
return ((new_field->sql_type == real_type()) &&
((new_field->flags & UNSIGNED_FLAG) == (uint) (flags &
UNSIGNED_FLAG)) &&
((new_field->flags & AUTO_INCREMENT_FLAG) ==
(uint) (flags & AUTO_INCREMENT_FLAG)) &&
(new_field->length >= max_length()));
(new_field->length <= max_length()));
}
......
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