mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
BUG#49129: Wrong result with IN-subquery with join_cache_level=6 and firstmatch=off
- The problem was that DuplicateWeedout strategy setup code wasn't aware of the fact that join buffering will be used and applied optimization that doesn't work together with join buffering. Fixed by making DuplicateWeedout setup code to have a pessimistic check about whether there is a chance that join buffering will be used. - Make JOIN_CACHE_BKA::init() correctly process Copy_field elements that denote saving current rowids in the join buffer. mysql-test/r/subselect_sj2.result: Update test results mysql-test/r/subselect_sj2_jcl6.result: Update test results mysql-test/r/subselect_sj_jcl6.result: Testcase mysql-test/t/subselect_sj2.test: Update test results mysql-test/t/subselect_sj_jcl6.test: Testcase sql/opt_subselect.cc: - The problem was that DuplicateWeedout strategy setup code wasn't aware of the fact that join buffering will be used and applied optimization that doesn't work together with join buffering. Fixed by making DuplicateWeedout setup code to have a pessimistic check about whether there is a chance that join buffering will be used. sql/sql_join_cache.cc: Make JOIN_CACHE_BKA::init() correctly process Copy_field elements that denote saving current rowids in the join buffer. sql/sql_select.cc: Added a question note
This commit is contained in:
@ -5632,7 +5632,11 @@ void calc_used_field_length(THD *thd, JOIN_TAB *join_tab)
|
||||
uint blob_length=(uint) (join_tab->table->file->stats.mean_rec_length-
|
||||
(join_tab->table->s->reclength-rec_length));
|
||||
rec_length+=(uint) max(4,blob_length);
|
||||
}
|
||||
}
|
||||
/*
|
||||
psergey-todo: why we don't count here rowid that we might need to store
|
||||
when using DuplicateElimination?
|
||||
*/
|
||||
join_tab->used_fields=fields;
|
||||
join_tab->used_fieldlength=rec_length;
|
||||
join_tab->used_blobs=blobs;
|
||||
|
Reference in New Issue
Block a user