summaryrefslogtreecommitdiff
path: root/sql/opt_range.h
diff options
context:
space:
mode:
authorSergei Petrunia <psergey@askmonty.org>2014-08-27 18:47:33 +0400
committerSergei Petrunia <psergey@askmonty.org>2014-08-27 18:47:33 +0400
commitbe00e279c6061134a33a8099fd69d4304735d02e (patch)
treea530d1229f4d70770721ccdd94ff269f99d26fdb /sql/opt_range.h
parent9534fd83ce6dc402132cc304c121c9205b430dda (diff)
downloadmariadb-git-be00e279c6061134a33a8099fd69d4304735d02e.tar.gz
MDEV-6480: Remove conditions for which range optimizer returned SEL_ARG::IMPOSSIBLE
Let range optimizer remove parts of OR-clauses for which range analysis produced SEL_TREE(IMPOSSIBLE). There is no need to remove parts of AND-clauses: either they are inside of OR (and the whole AND-clause will be removed), or the AND-clause is at the top level, in which case the whole WHERE (or ON) is always FALSE and this is a degenerate case which receives special treatment. The removal process takes care not to produce 1-way ORs (in that case we substitute the OR for its remaining member).
Diffstat (limited to 'sql/opt_range.h')
-rw-r--r--sql/opt_range.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/opt_range.h b/sql/opt_range.h
index 1ca245ea420..f602408ea82 100644
--- a/sql/opt_range.h
+++ b/sql/opt_range.h
@@ -994,7 +994,7 @@ class SQL_SELECT :public Sql_alloc {
{
key_map tmp;
tmp.set_all();
- return test_quick_select(thd, tmp, 0, limit, force_quick_range, FALSE) < 0;
+ return test_quick_select(thd, tmp, 0, limit, force_quick_range, FALSE, FALSE) < 0;
}
/*
RETURN
@@ -1011,7 +1011,7 @@ class SQL_SELECT :public Sql_alloc {
}
int test_quick_select(THD *thd, key_map keys, table_map prev_tables,
ha_rows limit, bool force_quick_range,
- bool ordered_output);
+ bool ordered_output, bool remove_false_parts_of_where);
};
@@ -1036,7 +1036,7 @@ SQL_SELECT *make_select(TABLE *head, table_map const_tables,
table_map read_tables, COND *conds,
bool allow_null_cond, int *error);
-bool calculate_cond_selectivity_for_table(THD *thd, TABLE *table, Item *cond);
+bool calculate_cond_selectivity_for_table(THD *thd, TABLE *table, Item **cond);
#ifdef WITH_PARTITION_STORAGE_ENGINE
bool prune_partitions(THD *thd, TABLE *table, Item *pprune_cond);