diff options
author | unknown <ingo@mysql.com> | 2005-09-23 10:15:11 +0200 |
---|---|---|
committer | unknown <ingo@mysql.com> | 2005-09-23 10:15:11 +0200 |
commit | 674c8165ea4b3430f397d84b0c79642de7b12ce4 (patch) | |
tree | cc4780b69204be49c89964f8598a382e90523fe0 /myisam/mi_rkey.c | |
parent | a89807336f8fa8b39bd519198f26db6c2b1fb247 (diff) | |
download | mariadb-git-674c8165ea4b3430f397d84b0c79642de7b12ce4.tar.gz |
Bug#9112 - Merge table with composite index producing invalid results with some queries
The problem was an ab-use of last_rkey_length.
Formerly we saved the packed key length (of the search key)
in this element. But in certain cases it got replaced by
the (packed) result key length.
Now we use a new element of MI_INFO to save the packed key
length of the search key.
myisam/mi_dbug.c:
Bug#9112 - Merge table with composite index producing invalid results with some queries
Fixed the recognition of NULL values in _mi_print_key().
myisam/mi_rkey.c:
Bug#9112 - Merge table with composite index producing invalid results with some queries
Saved the packed key length in a new element of MI_INFO.
myisam/mi_search.c:
Bug#9112 - Merge table with composite index producing invalid results with some queries
Added a comment and trace prints.
myisam/myisamdef.h:
Bug#9112 - Merge table with composite index producing invalid results with some queries
Added a new element to store the packed key length
for use by the MyISAMMRG engine.
myisammrg/myrg_rkey.c:
Bug#9112 - Merge table with composite index producing invalid results with some queries
Changed to use the new element of MI_INFO to get at the
packed key length.
mysql-test/r/merge.result:
Bug#9112 - Merge table with composite index producing invalid results with some queries
The test result.
mysql-test/t/merge.test:
Bug#9112 - Merge table with composite index producing invalid results with some queries
The test case.
Diffstat (limited to 'myisam/mi_rkey.c')
-rw-r--r-- | myisam/mi_rkey.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/myisam/mi_rkey.c b/myisam/mi_rkey.c index 1bb478efd3d..70122288d6c 100644 --- a/myisam/mi_rkey.c +++ b/myisam/mi_rkey.c @@ -31,8 +31,8 @@ int mi_rkey(MI_INFO *info, byte *buf, int inx, const byte *key, uint key_len, MI_KEYSEG *last_used_keyseg; uint pack_key_length, use_key_length, nextflag; DBUG_ENTER("mi_rkey"); - DBUG_PRINT("enter",("base: %lx inx: %d search_flag: %d", - info,inx,search_flag)); + DBUG_PRINT("enter", ("base: %p buf: %p inx: %d search_flag: %d", + info, buf, inx, search_flag)); if ((inx = _mi_check_index(info,inx)) < 0) DBUG_RETURN(my_errno); @@ -44,9 +44,12 @@ int mi_rkey(MI_INFO *info, byte *buf, int inx, const byte *key, uint key_len, { if (key_len == 0) key_len=USE_WHOLE_KEY; + /* Save the packed key for later use in the second buffer of lastkey. */ key_buff=info->lastkey+info->s->base.max_key_length; pack_key_length=_mi_pack_key(info, (uint) inx, key_buff, (uchar*) key, key_len, &last_used_keyseg); + /* Save packed_key_length for use by the MERGE engine. */ + info->pack_key_length= pack_key_length; DBUG_EXECUTE("key",_mi_print_key(DBUG_FILE, keyinfo->seg, key_buff, pack_key_length);); } |