mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
A fix (bug #6142: SELECT DISTINCT on key field crashes server)
sql/opt_range.cc: A fix (bug #6142: SELECT DISTINCT on key field crashes server) Code clean-up.
This commit is contained in:
@ -7040,17 +7040,16 @@ get_constant_key_infix(KEY *index_info, SEL_ARG *index_range_tree,
|
||||
static inline uint
|
||||
get_field_keypart(KEY *index, Field *field)
|
||||
{
|
||||
KEY_PART_INFO *part= index->key_part;
|
||||
KEY_PART_INFO *part, *end;
|
||||
uint key_part_num= 0;
|
||||
|
||||
while (part != part + index->key_parts)
|
||||
for (part= index->key_part, end= part + index->key_parts; part < end; part++)
|
||||
{
|
||||
key_part_num++;
|
||||
if (field->eq(part->field))
|
||||
return key_part_num;
|
||||
part++;
|
||||
}
|
||||
return key_part_num;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user