Commit 6e0fb8f6 authored by unknown's avatar unknown

a fix (bug #4198: Incorrect key file for table).

parent b99ac15c
......@@ -120,3 +120,13 @@ a b
0 10
1 11
drop table t11, t12, t2;
create table t1 (a int, b int, unique key (a), key (b));
insert into t1 values (3, 3), (7, 7);
delete t1 from t1 where a = 3;
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
select * from t1;
a b
7 7
drop table t1;
......@@ -98,3 +98,14 @@ select * from t11;
delete ignore from t11 where t11.b <> (select b from t2 where t11.a < t2.a);
select * from t11;
drop table t11, t12, t2;
#
# Bug #4198: deletion and KEYREAD
#
create table t1 (a int, b int, unique key (a), key (b));
insert into t1 values (3, 3), (7, 7);
delete t1 from t1 where a = 3;
check table t1;
select * from t1;
drop table t1;
......@@ -5972,7 +5972,8 @@ join_read_const_table(JOIN_TAB *tab, POSITION *pos)
else
{
if (!table->key_read && table->used_keys.is_set(tab->ref.key) &&
!table->no_keyread)
!table->no_keyread &&
(int) table->reginfo.lock_type <= (int) TL_READ_HIGH_PRIORITY)
{
table->key_read=1;
table->file->extra(HA_EXTRA_KEYREAD);
......
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