summaryrefslogtreecommitdiff
path: root/sql/opt_range.cc
diff options
context:
space:
mode:
authorAlexander Nozdrin <alik@sun.com>2009-11-06 11:56:48 +0300
committerAlexander Nozdrin <alik@sun.com>2009-11-06 11:56:48 +0300
commit52b1bfe4050e163d844df1c10c648b33d25e28c5 (patch)
treeeb2d1324319886b82e2838e7144d856c95683bbd /sql/opt_range.cc
parenteed607b829e68694ee996092c337ed13846e78ec (diff)
parentf6868a4eb42f39a5f4e8179b91fe38f0ff299ebe (diff)
downloadmariadb-git-52b1bfe4050e163d844df1c10c648b33d25e28c5.tar.gz
Manual merge from mysql-trunk-merge.
Fix partition_column.test.
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 ce86fa535fe..61122b9892d 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -6067,6 +6067,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;