From acb2d4aad85896ce31380f2c90804f3f1240d1d8 Mon Sep 17 00:00:00 2001 From: Sergey Petrunya Date: Tue, 1 Nov 2011 12:04:11 +0400 Subject: [PATCH] BUG#884631: Table elimination works 5.3 release builds even if turned off - Make table elimination to actually switch itself on/off in release builds. --- mysql-test/t/table_elim_debug.test | 3 ++- sql/opt_table_elimination.cc | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/mysql-test/t/table_elim_debug.test b/mysql-test/t/table_elim_debug.test index 9f793169e4f..6400f798195 100644 --- a/mysql-test/t/table_elim_debug.test +++ b/mysql-test/t/table_elim_debug.test @@ -1,7 +1,8 @@ # # Table elimination (MWL#17) tests that need debug build # ---source include/have_debug.inc +# In MariaDB 5.3, one can switch table_elimination on/off without debug, too: +## --source include/have_debug.inc --disable_warnings drop table if exists t1, t2; diff --git a/sql/opt_table_elimination.cc b/sql/opt_table_elimination.cc index c8c61720068..56396181619 100644 --- a/sql/opt_table_elimination.cc +++ b/sql/opt_table_elimination.cc @@ -588,10 +588,8 @@ void eliminate_tables(JOIN *join) if (!join->outer_join) DBUG_VOID_RETURN; -#ifndef DBUG_OFF if (!optimizer_flag(thd, OPTIMIZER_SWITCH_TABLE_ELIMINATION)) DBUG_VOID_RETURN; /* purecov: inspected */ -#endif /* Find the tables that are referred to from WHERE/HAVING */ used_tables= (join->conds? join->conds->used_tables() : 0) |