summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.cc
diff options
context:
space:
mode:
authorunknown <msvensson@pilot.blaudden>2007-04-23 16:22:01 +0200
committerunknown <msvensson@pilot.blaudden>2007-04-23 16:22:01 +0200
commit20b22b40cfa56907e865afb09cd28c8f523a0712 (patch)
treef57af89d9d557ae756cb9bacbfb6acc38b64156f /sql/item_cmpfunc.cc
parentb44eee2a6739afb44f59a06c2f7adb309f66b6a9 (diff)
parentc94da3764fde2c4cb775317052b483df9f45d129 (diff)
downloadmariadb-git-20b22b40cfa56907e865afb09cd28c8f523a0712.tar.gz
Merge pilot.blaudden:/home/msvensson/mysql/mysql-5.0
into pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint client/mysql.cc: Auto merged sql/item_cmpfunc.cc: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r--sql/item_cmpfunc.cc18
1 files changed, 14 insertions, 4 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 6f207e920d0..bf9ddcc6659 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -812,8 +812,18 @@ int Arg_comparator::compare_row()
if (owner->null_value)
{
// NULL was compared
- if (owner->abort_on_null)
- return -1; // We do not need correct NULL returning
+ switch (owner->functype()) {
+ case Item_func::NE_FUNC:
+ break; // NE never aborts on NULL even if abort_on_null is set
+ case Item_func::LT_FUNC:
+ case Item_func::LE_FUNC:
+ case Item_func::GT_FUNC:
+ case Item_func::GE_FUNC:
+ return -1; // <, <=, > and >= always fail on NULL
+ default: // EQ_FUNC
+ if (owner->abort_on_null)
+ return -1; // We do not need correct NULL returning
+ }
was_null= 1;
owner->null_value= 0;
res= 0; // continue comparison (maybe we will meet explicit difference)
@@ -824,8 +834,8 @@ int Arg_comparator::compare_row()
if (was_null)
{
/*
- There was NULL(s) in comparison in some parts, but there was not
- explicit difference in other parts, so we have to return NULL
+ There was NULL(s) in comparison in some parts, but there was no
+ explicit difference in other parts, so we have to return NULL.
*/
owner->null_value= 1;
return -1;