1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Merge sunlight.local:/local_work/tmp_merge-4.1-opt-mysql

into  sunlight.local:/local_work/tmp_merge-5.0-opt-mysql


mysql-test/t/select.test:
  Auto merged
sql/sql_select.cc:
  Auto merged
mysql-test/r/func_group.result:
  Manual merge
mysql-test/r/select.result:
  Manual merge
mysql-test/r/subselect.result:
  Manual merge
This commit is contained in:
unknown
2006-07-29 23:59:53 +04:00
4 changed files with 235 additions and 0 deletions

View File

@ -679,6 +679,24 @@ JOIN::optimize()
DBUG_PRINT("info",("Select tables optimized away"));
zero_result_cause= "Select tables optimized away";
tables_list= 0; // All tables resolved
/*
Extract all table-independent conditions and replace the WHERE
clause with them. All other conditions were computed by opt_sum_query
and the MIN/MAX/COUNT function(s) have been replaced by constants,
so there is no need to compute the whole WHERE clause again.
Notice that make_cond_for_table() will always succeed to remove all
computed conditions, because opt_sum_query() is applicable only to
conjunctions.
*/
if (conds)
{
COND *table_independent_conds=
make_cond_for_table(conds, PSEUDO_TABLE_BITS, 0);
DBUG_EXECUTE("where",
print_where(table_independent_conds,
"where after opt_sum_query()"););
conds= table_independent_conds;
}
}
}
if (!tables_list)