1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-23 03:54:27 +03:00

BUG#920255: Wrong result (extra rows) with loosescan and IN subquery

The problem was that LooseScan execution code assumed that tab->key holds 
the index used for looseScan. This is only true when range or full index
scan are used. In case of ref access, the index is in tab->ref.key (and 
tab->index==0 which explains how LooseScan passed tests with ref access: they 
used one index)

Fixed by setting/using loosescan_key, which always the correct index#.
This commit is contained in:
Sergey Petrunya
2012-01-25 18:33:57 +04:00
parent e10816118a
commit 73cc529b51
6 changed files with 96 additions and 2 deletions

View File

@@ -379,6 +379,12 @@ typedef struct st_join_table {
/* Buffer to save index tuple to be able to skip duplicates */
uchar *loosescan_buf;
/*
Index used by LooseScan (we store it here separately because ref access
stores it in tab->ref.key, while range scan stores it in tab->index, etc)
*/
uint loosescan_key;
/* Length of key tuple (depends on #keyparts used) to store in the above */
uint loosescan_key_len;