diff options
author | unknown <ingo@mysql.com> | 2005-09-23 10:49:08 +0200 |
---|---|---|
committer | unknown <ingo@mysql.com> | 2005-09-23 10:49:08 +0200 |
commit | c08721e5fa8e67a2aad8725d4eb9cca43062b445 (patch) | |
tree | de63fb039c1b666c02ce35a3f1b10723072172d8 /myisammrg | |
parent | 727f0b8a1f2fdc3f458f6b5da5ebe3cc73620403 (diff) | |
parent | 674c8165ea4b3430f397d84b0c79642de7b12ce4 (diff) | |
download | mariadb-git-c08721e5fa8e67a2aad8725d4eb9cca43062b445.tar.gz |
Merge mysql.com:/home/mydev/mysql-4.0-4000
into mysql.com:/home/mydev/mysql-4.1-4100
myisam/mi_dbug.c:
Auto merged
myisam/mi_rkey.c:
Auto merged
myisam/mi_search.c:
Auto merged
myisam/myisamdef.h:
Auto merged
myisammrg/myrg_rkey.c:
Bug#9112 - Merge table with composite index producing invalid results with some queries
Manual merge
mysql-test/r/merge.result:
Bug#9112 - Merge table with composite index producing invalid results with some queries
Manual merge
mysql-test/t/merge.test:
Bug#9112 - Merge table with composite index producing invalid results with some queries
Manual merge
Diffstat (limited to 'myisammrg')
-rw-r--r-- | myisammrg/myrg_rkey.c | 17 |
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)); } |