summaryrefslogtreecommitdiff
path: root/sql/sql_join_cache.cc
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2011-03-22 13:09:55 +0300
committerSergey Petrunya <psergey@askmonty.org>2011-03-22 13:09:55 +0300
commitb77e3dc9f403cea4d8ccebf87267096f5194d31c (patch)
treecd0ba1b8d15b74ade79328101d10ebf3d2b4920f /sql/sql_join_cache.cc
parent809a805251f45d81a6026049944f14b9db60b81d (diff)
downloadmariadb-git-b77e3dc9f403cea4d8ccebf87267096f5194d31c.tar.gz
MWL#90: Address review feedback part #5
Diffstat (limited to 'sql/sql_join_cache.cc')
-rw-r--r--sql/sql_join_cache.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/sql/sql_join_cache.cc b/sql/sql_join_cache.cc
index face1f9196e..af0c3c6709e 100644
--- a/sql/sql_join_cache.cc
+++ b/sql/sql_join_cache.cc
@@ -185,6 +185,7 @@ void JOIN_CACHE::calc_record_fields()
start_tab= tab;
if (start_tab->bush_children)
start_tab= start_tab->bush_children->start;
+ DBUG_ASSERT(!start_tab->bush_children);
tab= start_tab;
@@ -508,7 +509,6 @@ void JOIN_CACHE::create_key_arg_fields()
/* Now create local fields that are used to build ref for this key access */
copy= field_descr+flag_fields;
for (tab= start_tab; tab != join_tab; tab= next_linear_tab(join, tab, FALSE))
- //for (tab= join_tab-tables; tab; tab= get_next_table(tab))
{
length+= add_table_data_fields_to_join_cache(tab, &tab->table->tmp_set,
&data_field_count, &copy,
@@ -721,8 +721,11 @@ ulong JOIN_CACHE::get_min_join_buffer_size()
if (!min_buff_size)
{
size_t len= 0;
- for (JOIN_TAB *tab= start_tab; tab != join_tab; tab= next_linear_tab(join, tab, FALSE))
+ for (JOIN_TAB *tab= start_tab; tab != join_tab;
+ tab= next_linear_tab(join, tab, FALSE))
+ {
len+= tab->get_max_used_fieldlength();
+ }
len+= get_record_max_affix_length() + get_max_key_addon_space_per_record();
size_t min_sz= len*min_records;
size_t add_sz= 0;
@@ -774,8 +777,11 @@ ulong JOIN_CACHE::get_max_join_buffer_size(bool optimize_buff_size)
size_t max_sz;
size_t min_sz= get_min_join_buffer_size();
size_t len= 0;
- for (JOIN_TAB *tab= start_tab; tab != join_tab; tab= next_linear_tab(join, tab, FALSE))
+ for (JOIN_TAB *tab= start_tab; tab != join_tab;
+ tab= next_linear_tab(join, tab, FALSE))
+ {
len+= tab->get_used_fieldlength();
+ }
len+= get_record_max_affix_length();
avg_record_length= len;
len+= get_max_key_addon_space_per_record() + avg_aux_buffer_incr;