mirror of
https://github.com/MariaDB/server.git
synced 2026-05-09 00:24:30 +02:00
Fixed bug mdev-3888.
When inserting a record with update on duplicate keys the server calls the ha_index_read_idx_map handler function to look for the record that violates unique key constraints. The third parameter of this call should mark only the base components of the index where the server is searched for the record. Possible hidden components of the primary key are to be unmarked.
This commit is contained in:
parent
b057f95d42
commit
5e345281e3
3 changed files with 69 additions and 1 deletions
|
|
@ -1677,9 +1677,10 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
|
|||
}
|
||||
}
|
||||
key_copy((uchar*) key,table->record[0],table->key_info+key_nr,0);
|
||||
key_part_map keypart_map= (1 << table->key_info[key_nr].key_parts) - 1;
|
||||
if ((error= (table->file->ha_index_read_idx_map(table->record[1],
|
||||
key_nr, (uchar*) key,
|
||||
HA_WHOLE_KEY,
|
||||
keypart_map,
|
||||
HA_READ_KEY_EXACT))))
|
||||
goto err;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue