From 1c30fb2a156b9c510e1829108bc8db71dcea3d43 Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Sat, 6 Apr 2013 12:33:38 -0700 Subject: Fixed bug mdev-4372. Range analysis of non-indexed columns should handle properly range trees with type == SEL_TREE::MAYBE. --- sql/opt_range.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sql/opt_range.cc') diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 215c85cbdf5..035ea3635e2 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -3368,7 +3368,12 @@ bool calculate_cond_selectivity_for_table(THD *thd, TABLE *table, Item *cond) rows= 0; table->reginfo.impossible_range= 1; goto free_alloc; - } + } + else if (tree->type == SEL_TREE::MAYBE) + { + rows= table_records; + goto free_alloc; + } for (key= tree->keys, end= key + param.keys; key != end; key++, idx++) { -- cgit v1.2.1