1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Bug #37742: HA_EXTRA_KEYREAD flag is set when key contains only prefix of requested

column
      
When the storage engine uses secondary keys clustered with the primary key MySQL was
adding the primary key parts to each secondary key.
In doing so it was not checking whether the index was on full columns and this
resulted in the secondary keys being added to the list of covering keys even if 
they have partial columns.
Fixed by not adding a primary key part to the list of columns that can be used 
for index read of the secondary keys when the primary key part is a partial key part.
This commit is contained in:
Georgi Kodinov
2008-11-29 15:36:17 +02:00
parent f309f847e4
commit f486bfbbdb
3 changed files with 123 additions and 1 deletions

View File

@ -1416,7 +1416,9 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
*/
if (ha_option & HA_PRIMARY_KEY_IN_READ_INDEX)
{
field->part_of_key= share->keys_in_use;
if (field->key_length() == key_part->length &&
!(field->flags & BLOB_FLAG))
field->part_of_key= share->keys_in_use;
if (field->part_of_sortkey.is_set(key))
field->part_of_sortkey= share->keys_in_use;
}