summaryrefslogtreecommitdiff
path: root/sql/opt_range.cc
diff options
context:
space:
mode:
authorAlexey Kopytov <Alexey.Kopytov@Sun.com>2009-10-15 14:42:51 +0400
committerAlexey Kopytov <Alexey.Kopytov@Sun.com>2009-10-15 14:42:51 +0400
commitf98d11ee24c43bf22799d4f1a765470249ac2680 (patch)
treebb4f7a174fc872003133990644cb90b528d572df /sql/opt_range.cc
parentcd69e34ca7c0e6fbbbac5823f22e30035566b180 (diff)
parent5db734a896bff99d044eb6e08bb5c849d04915ef (diff)
downloadmariadb-git-f98d11ee24c43bf22799d4f1a765470249ac2680.tar.gz
Manual merge.
Diffstat (limited to 'sql/opt_range.cc')
-rw-r--r--sql/opt_range.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 119f90bc97a..04dae4fd815 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -5891,6 +5891,17 @@ get_mm_leaf(RANGE_OPT_PARAM *param, COND *conf_func, Field *field,
goto end;
}
field->table->in_use->variables.sql_mode= orig_sql_mode;
+
+ /*
+ Any sargable predicate except "<=>" involving NULL as a constant is always
+ FALSE
+ */
+ if (type != Item_func::EQUAL_FUNC && field->is_real_null())
+ {
+ tree= &null_element;
+ goto end;
+ }
+
str= (uchar*) alloc_root(alloc, key_part->store_length+1);
if (!str)
goto end;