mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
BUG#877288: Wrong result with semijoin + materialization + multipart key
- when create_ref_for_key() is constructing a ref access for a table that's inside a SJ-Materialization nest, it may not use references to fields of tables that are unside the nest (because these fields will not yet have values when ref access will be used) The check was performed in the first of create_ref_for_key's loops (the one which counts how many key parts are usable) but not in the second (the one which actually fills the TABLE_REF structure).
This commit is contained in:
@ -7360,7 +7360,8 @@ static bool create_ref_for_key(JOIN *join, JOIN_TAB *j,
|
||||
while (((~used_tables) & keyuse->used_tables) ||
|
||||
(keyuse->keypart !=
|
||||
(is_hash_join_key_no(key) ?
|
||||
keyinfo->key_part[i].field->field_index : i)))
|
||||
keyinfo->key_part[i].field->field_index : i)) ||
|
||||
!are_tables_local(j, keyuse->val->used_tables()))
|
||||
keyuse++; /* Skip other parts */
|
||||
|
||||
uint maybe_null= test(keyinfo->key_part[i].null_bit);
|
||||
|
Reference in New Issue
Block a user