diff options
| author | Igor Babaev <igor@askmonty.org> | 2012-02-13 23:46:57 -0800 |
|---|---|---|
| committer | Igor Babaev <igor@askmonty.org> | 2012-02-13 23:46:57 -0800 |
| commit | c8bbe06ac7fd536b3e756afc0e2e8c8dc0724119 (patch) | |
| tree | 7989abc78e260fc4ed2b526eba61cb37befd4de4 /sql | |
| parent | 27dfa45e7026f6b632863a37b7dece8ecd480b47 (diff) | |
| download | mariadb-git-c8bbe06ac7fd536b3e756afc0e2e8c8dc0724119.tar.gz | |
Fixed LP bug #925985.
If the flag 'optimize_join_buffer_size' is set to 'off' and the value
of the system variable 'join_buffer_size' is greater than the value of
the system variable 'join_buffer_space_limit' than no join cache can
be employed to join tables of the executed query.
A bug in the function JOIN_CACHE::alloc_buffer allowed to use join
buffer even in this case while another bug in the function
revise_cache_usage could cause a crash of the server in this case if the
chosen execution plan for the query contained outer join or semi-join
operation.
Diffstat (limited to 'sql')
| -rw-r--r-- | sql/sql_join_cache.cc | 2 | ||||
| -rw-r--r-- | sql/sql_select.cc | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/sql/sql_join_cache.cc b/sql/sql_join_cache.cc index 2a8db8b4fd1..78f95a7ac7e 100644 --- a/sql/sql_join_cache.cc +++ b/sql/sql_join_cache.cc @@ -898,6 +898,8 @@ int JOIN_CACHE::alloc_buffer() curr_buff_space_sz+= cache->get_join_buffer_size(); } } + curr_min_buff_space_sz+= min_buff_size; + curr_buff_space_sz+= buff_size; if (curr_min_buff_space_sz > join_buff_space_limit || (curr_buff_space_sz > join_buff_space_limit && diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 05fba45792b..aa1090fb03b 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -8903,7 +8903,7 @@ void revise_cache_usage(JOIN_TAB *join_tab) first_inner; first_inner= first_inner->first_upper) { - for (tab= end_tab-1; tab >= first_inner; tab--) + for (tab= end_tab; tab >= first_inner; tab--) set_join_cache_denial(tab); end_tab= first_inner; } @@ -8911,7 +8911,7 @@ void revise_cache_usage(JOIN_TAB *join_tab) else if (join_tab->first_sj_inner_tab) { first_inner= join_tab->first_sj_inner_tab; - for (tab= join_tab-1; tab >= first_inner; tab--) + for (tab= join_tab; tab >= first_inner; tab--) { set_join_cache_denial(tab); } |
