Commit d17093b2 authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-12293 Assertion `table->no_keyread ||...

MDEV-12293 Assertion `table->no_keyread || !table->covering_keys.is_set(tab->index) || table->file->keyread == tab->index' failed

sometimes the optimizer starts a keyread on some index
and later (but before any actual index accesses) changes
it to a keyread on a different index
parent 54e24fcb
create table t1 (f1 int not null, f2 int, f3 int, primary key (f1,f2), key(f2,f3)) engine=innodb;
create view v1 as select * from t1 where f2 = 1;
select distinct f1 from v1;
f1
drop view v1;
drop table t1;
--source include/have_innodb.inc
#
# MDEV-12293 Assertion `table->no_keyread || !table->covering_keys.is_set(tab->index) || table->file->keyread == tab->index' failed
#
create table t1 (f1 int not null, f2 int, f3 int, primary key (f1,f2), key(f2,f3)) engine=innodb;
create view v1 as select * from t1 where f2 = 1;
select distinct f1 from v1;
drop view v1;
drop table t1;
......@@ -2858,10 +2858,9 @@ class handler :public Sql_alloc
bool keyread_enabled() { return keyread < MAX_KEY; }
int ha_start_keyread(uint idx)
{
if (keyread_enabled())
return 0;
int res= keyread_enabled() ? 0 : extra(HA_EXTRA_KEYREAD);
keyread= idx;
return extra(HA_EXTRA_KEYREAD);
return res;
}
int ha_end_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