summaryrefslogtreecommitdiff
path: root/sql/sql_join_cache.cc
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2011-03-21 23:06:16 +0300
committerSergey Petrunya <psergey@askmonty.org>2011-03-21 23:06:16 +0300
commitd56e74eb9ba27ae98884b9ddb37c3d7a575b50fe (patch)
treeb72181de895cc81668691b7a4457a8136b9a1dda /sql/sql_join_cache.cc
parent792c67ff618f7fa5edb39563b0ccf48b4a30db0f (diff)
downloadmariadb-git-d56e74eb9ba27ae98884b9ddb37c3d7a575b50fe.tar.gz
MWL#90: Address review feedback part #2
Diffstat (limited to 'sql/sql_join_cache.cc')
-rw-r--r--sql/sql_join_cache.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/sql/sql_join_cache.cc b/sql/sql_join_cache.cc
index bdc944d8d6c..face1f9196e 100644
--- a/sql/sql_join_cache.cc
+++ b/sql/sql_join_cache.cc
@@ -3235,6 +3235,13 @@ int JOIN_TAB_SCAN::next()
}
+/*
+ Walk back in join order from join_tab until we encounter a join tab with
+ tab->cache!=NULL, and save/restore tab->table->status along the way.
+
+ @param save TRUE save
+ FALSE restore
+*/
void save_or_restore_used_tabs(JOIN_TAB *join_tab, bool save)
{
JOIN_TAB *first= join_tab->bush_root_tab?
@@ -3251,6 +3258,7 @@ void save_or_restore_used_tabs(JOIN_TAB *join_tab, bool save)
{
if (save)
child->table->status= child->status;
+ else
{
tab->status= tab->table->status;
tab->table->status= 0;