summaryrefslogtreecommitdiff
path: root/sql/sql_join_cache.cc
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2012-02-13 23:46:57 -0800
committerIgor Babaev <igor@askmonty.org>2012-02-13 23:46:57 -0800
commitc8bbe06ac7fd536b3e756afc0e2e8c8dc0724119 (patch)
tree7989abc78e260fc4ed2b526eba61cb37befd4de4 /sql/sql_join_cache.cc
parent27dfa45e7026f6b632863a37b7dece8ecd480b47 (diff)
downloadmariadb-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/sql_join_cache.cc')
-rw-r--r--sql/sql_join_cache.cc2
1 files changed, 2 insertions, 0 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 &&