summaryrefslogtreecommitdiff
path: root/myisammrg
diff options
context:
space:
mode:
authorunknown <ingo@mysql.com>2005-09-23 17:27:07 +0200
committerunknown <ingo@mysql.com>2005-09-23 17:27:07 +0200
commit944db06bbb328288d5e9cfc85de86876895b8b62 (patch)
tree48baa8a8836b9aa39f3616c84580cec8a057ba32 /myisammrg
parent79b79064fafc92b5b5fcb5402ad7b2bace2cdb77 (diff)
parent9c0d809270a1d74ec33711d94cd65930eab11579 (diff)
downloadmariadb-git-944db06bbb328288d5e9cfc85de86876895b8b62.tar.gz
Merge mysql.com:/home/mydev/mysql-4.1-4100
into mysql.com:/home/mydev/mysql-5.0-5000 myisam/mi_dbug.c: Auto merged myisam/mi_rkey.c: Auto merged myisam/mi_search.c: Auto merged myisam/myisamdef.h: Auto merged mysql-test/r/merge.result: Auto merged mysql-test/t/merge.test: Auto merged
Diffstat (limited to 'myisammrg')
-rw-r--r--myisammrg/myrg_rkey.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/myisammrg/myrg_rkey.c b/myisammrg/myrg_rkey.c
index a85ef6a3b5e..f87b264081e 100644
--- a/myisammrg/myrg_rkey.c
+++ b/myisammrg/myrg_rkey.c
@@ -44,11 +44,12 @@ int myrg_rkey(MYRG_INFO *info,byte *buf,int inx, const byte *key,
MYRG_TABLE *table;
MI_INFO *mi;
int err;
+ DBUG_ENTER("myrg_rkey");
LINT_INIT(key_buff);
LINT_INIT(pack_key_length);
if (_myrg_init_queue(info,inx,search_flag))
- return my_errno;
+ DBUG_RETURN(my_errno);
for (table=info->open_tables ; table != info->end_table ; table++)
{
@@ -57,8 +58,9 @@ int myrg_rkey(MYRG_INFO *info,byte *buf,int inx, const byte *key,
if (table == info->open_tables)
{
err=mi_rkey(mi,0,inx,key,key_len,search_flag);
+ /* Get the saved packed key and packed key length. */
key_buff=(byte*) mi->lastkey+mi->s->base.max_key_length;
- pack_key_length=mi->last_rkey_length;
+ pack_key_length=mi->pack_key_length;
}
else
{
@@ -71,17 +73,22 @@ int myrg_rkey(MYRG_INFO *info,byte *buf,int inx, const byte *key,
{
if (err == HA_ERR_KEY_NOT_FOUND)
continue;
- return err;
+ DBUG_PRINT("exit", ("err: %d", err));
+ DBUG_RETURN(err);
}
/* adding to queue */
queue_insert(&(info->by_key),(byte *)table);
}
+ DBUG_PRINT("info", ("tables with matches: %u", info->by_key.elements));
if (!info->by_key.elements)
- return HA_ERR_KEY_NOT_FOUND;
+ DBUG_RETURN(HA_ERR_KEY_NOT_FOUND);
mi=(info->current_table=(MYRG_TABLE *)queue_top(&(info->by_key)))->table;
mi->once_flags|= RRND_PRESERVE_LASTINX;
- return _myrg_mi_read_record(mi,buf);
+ DBUG_PRINT("info", ("using table no: %d",
+ info->current_table - info->open_tables + 1));
+ DBUG_DUMP("result key", (byte*) mi->lastkey, mi->lastkey_length);
+ DBUG_RETURN(_myrg_mi_read_record(mi,buf));
}