diff options
author | unknown <mskold@mysql.com> | 2005-05-07 22:41:30 +0200 |
---|---|---|
committer | unknown <mskold@mysql.com> | 2005-05-07 22:41:30 +0200 |
commit | 0410766f3d91085601d5d520200acf39287cb878 (patch) | |
tree | 7af91c1d6ef4652439aa16c12eb7691a0cf02e3b /sql | |
parent | 2275c0486ca3e44c8dcfe62f9c92af5537efd504 (diff) | |
download | mariadb-git-0410766f3d91085601d5d520200acf39287cb878.tar.gz |
Removed double cond_push
Diffstat (limited to 'sql')
-rw-r--r-- | sql/ha_ndbcluster.cc | 30 | ||||
-rw-r--r-- | sql/sql_select.cc | 13 |
2 files changed, 20 insertions, 23 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index b61dbd1792c..4f947adfd07 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -6101,24 +6101,26 @@ const COND* ha_ndbcluster::cond_push(const COND *cond) { - Ndb_cond_stack *ndb_cond = new Ndb_cond_stack(); DBUG_ENTER("cond_push"); - DBUG_EXECUTE("where",print_where((COND *)cond, m_tabname);); - if (m_cond_stack) - ndb_cond->next= m_cond_stack; - else - ndb_cond->next= NULL; - m_cond_stack= ndb_cond; - - if (serialize_cond(cond, ndb_cond)) + if (cond) { + Ndb_cond_stack *ndb_cond = new Ndb_cond_stack(); + DBUG_EXECUTE("where",print_where((COND *)cond, m_tabname);); + if (m_cond_stack) + ndb_cond->next= m_cond_stack; + else + ndb_cond->next= NULL; + m_cond_stack= ndb_cond; + + if (serialize_cond(cond, ndb_cond)) + { DBUG_RETURN(NULL); + } + else + { + cond_pop(); + } } - else - { - cond_pop(); - } - DBUG_RETURN(cond); } diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 32624bb3305..e7d33aff124 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -5403,10 +5403,12 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond) tab->select_cond=sel->cond=tmp; if (thd->variables.engine_condition_pushdown) { + COND *push_cond= + make_cond_for_table(cond,current_map,current_map); tab->table->file->pushed_cond= NULL; /* Push condition to handler */ - if (!tab->table->file->cond_push(tmp)) - tab->table->file->pushed_cond= tmp; + if (!tab->table->file->cond_push(push_cond)) + tab->table->file->pushed_cond= push_cond; } } else @@ -5530,13 +5532,6 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond) thd->memdup((gptr) sel, sizeof(SQL_SELECT)); tab->cache.select->cond=tmp; tab->cache.select->read_tables=join->const_table_map; - if (thd->variables.engine_condition_pushdown && - (!tab->table->file->pushed_cond)) - { - /* Push condition to handler */ - if (!tab->table->file->cond_push(tmp)) - tab->table->file->pushed_cond= tmp; - } } } } |