From 2d008198d29509c69677c44985af8b086ac063fe Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 2 Jun 2005 14:48:19 +0200 Subject: [PATCH] Modified handling of guarded predicates at condition pushdown to storage engine, to make valgrind happy --- sql/sql_select.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 7bd2d6f4fd2..d0038561d5e 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -5454,6 +5454,7 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond) */ if (cond) { + COND *unguarded= tmp; /* Because of QUICK_GROUP_MIN_MAX_SELECT there may be a select without a cond, so neutralize the hack above. @@ -5463,11 +5464,12 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond) tab->select_cond=sel->cond=tmp; /* Push condition to storage engine if this is enabled and the condition is not guarded */ - if (thd->variables.engine_condition_pushdown) + tab->table->file->pushed_cond= NULL; + if (thd->variables.engine_condition_pushdown && + unguarded == tmp) { COND *push_cond= - make_cond_for_table(tmp,current_map,current_map); - tab->table->file->pushed_cond= NULL; + make_cond_for_table(cond, current_map, current_map); if (push_cond) { /* Push condition to handler */