Commit 85be6a0a authored by unknown's avatar unknown

Bugfix for HEAP table rb-index scan.

parent 8484e6f7
...@@ -38,7 +38,7 @@ int heap_rkey(HP_INFO *info, byte *record, int inx, const byte *key, ...@@ -38,7 +38,7 @@ int heap_rkey(HP_INFO *info, byte *record, int inx, const byte *key,
custom_arg.keyseg= info->s->keydef[inx].seg; custom_arg.keyseg= info->s->keydef[inx].seg;
custom_arg.key_length= info->lastkey_len= custom_arg.key_length= info->lastkey_len=
hp_rb_pack_key(keyinfo, (uchar*) info->recbuf, hp_rb_pack_key(keyinfo, (uchar*) info->lastkey,
(uchar*) key, key_len); (uchar*) key, key_len);
custom_arg.search_flag= SEARCH_FIND | SEARCH_SAME; custom_arg.search_flag= SEARCH_FIND | SEARCH_SAME;
/* for next rkey() after deletion */ /* for next rkey() after deletion */
...@@ -48,7 +48,7 @@ int heap_rkey(HP_INFO *info, byte *record, int inx, const byte *key, ...@@ -48,7 +48,7 @@ int heap_rkey(HP_INFO *info, byte *record, int inx, const byte *key,
info->last_find_flag= HA_READ_KEY_OR_PREV; info->last_find_flag= HA_READ_KEY_OR_PREV;
else else
info->last_find_flag= find_flag; info->last_find_flag= find_flag;
if (!(pos= tree_search_key(&keyinfo->rb_tree, info->recbuf, info->parents, if (!(pos= tree_search_key(&keyinfo->rb_tree, info->lastkey, info->parents,
&info->last_pos, find_flag, &custom_arg))) &info->last_pos, find_flag, &custom_arg)))
{ {
info->update= 0; info->update= 0;
......
...@@ -24,8 +24,8 @@ a b ...@@ -24,8 +24,8 @@ a b
alter table t1 add c int not null, add key using BTREE (c,a); alter table t1 add c int not null, add key using BTREE (c,a);
drop table t1; drop table t1;
create table t1 (a int not null,b int not null, primary key using BTREE (a)) type=heap comment="testing heaps"; create table t1 (a int not null,b int not null, primary key using BTREE (a)) type=heap comment="testing heaps";
insert into t1 values(1,1),(2,2),(3,3),(4,4); insert into t1 values(-2,-2),(-1,-1),(0,0),(1,1),(2,2),(3,3),(4,4);
delete from t1 where a > 0; delete from t1 where a > -3;
select * from t1; select * from t1;
a b a b
drop table t1; drop table t1;
......
...@@ -21,8 +21,8 @@ alter table t1 add c int not null, add key using BTREE (c,a); ...@@ -21,8 +21,8 @@ alter table t1 add c int not null, add key using BTREE (c,a);
drop table t1; drop table t1;
create table t1 (a int not null,b int not null, primary key using BTREE (a)) type=heap comment="testing heaps"; create table t1 (a int not null,b int not null, primary key using BTREE (a)) type=heap comment="testing heaps";
insert into t1 values(1,1),(2,2),(3,3),(4,4); insert into t1 values(-2,-2),(-1,-1),(0,0),(1,1),(2,2),(3,3),(4,4);
delete from t1 where a > 0; delete from t1 where a > -3;
select * from t1; select * from t1;
drop table t1; drop table t1;
......
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