diff options
author | unknown <timour@askmonty.org> | 2010-04-02 17:27:06 +0300 |
---|---|---|
committer | unknown <timour@askmonty.org> | 2010-04-02 17:27:06 +0300 |
commit | 3fc85580c9bc1e585de752697e3ae7ad02a64957 (patch) | |
tree | 352824574c4f80714df39b66784d8f421bf47401 | |
parent | cb325eb2b2f738b63d162fb0d46cf335e4ae84a4 (diff) | |
download | mariadb-git-3fc85580c9bc1e585de752697e3ae7ad02a64957.tar.gz |
MWL#68: Subquery optimization: Efficient NOT IN execution with NULLs
Fixed an error where the priority queue for the indexes used for partial
matching was not emptied after each execution in all cases.
-rw-r--r-- | sql/item_subselect.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 741cd2e3e85..fbfc89a1919 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -3882,8 +3882,9 @@ subselect_hash_sj_engine::make_unique_engine() cur_ref_buff + test(maybe_null), we could use that information instead. */ + cur_ref_buff + null_count, - null_count ? tab->ref.key_buff : 0, + null_count ? cur_ref_buff : 0, cur_key_part->length, tab->ref.items[i]); cur_ref_buff+= cur_key_part->store_length; } @@ -4908,6 +4909,8 @@ bool subselect_rowid_merge_engine::partial_match() /* If there is a non-NULL key, it must be the first key in the keys array. */ DBUG_ASSERT(!non_null_key || (non_null_key && merge_keys[0] == non_null_key)); + /* The prioryty queue for keys must be empty. */ + DBUG_ASSERT(!pq.elements); /* All data accesses during execution are via handler::ha_rnd_pos() */ tmp_table->file->ha_rnd_init(0); @@ -5031,6 +5034,7 @@ bool subselect_rowid_merge_engine::partial_match() DBUG_ASSERT(FALSE); end: + queue_remove_all(&pq); tmp_table->file->ha_rnd_end(); return res; } |