summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.h
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2002-05-07 19:08:56 +0300
committerunknown <monty@hundin.mysql.fi>2002-05-07 19:08:56 +0300
commitdaafa8db5049da5a8e3c51edb7cb5b7f36dbc73f (patch)
tree998601644441d26cc8a548d4f2e086978a15feea /sql/item_cmpfunc.h
parent6c6ae10e7532e3630396160ccb41f79ce8ce001c (diff)
downloadmariadb-git-daafa8db5049da5a8e3c51edb7cb5b7f36dbc73f.tar.gz
Fix for ISNULL()
Docs/manual.texi: Chagnelog mysql-test/r/join.result: New tests for IS NULL mysql-test/t/join.test: New tests for IS NULL
Diffstat (limited to 'sql/item_cmpfunc.h')
-rw-r--r--sql/item_cmpfunc.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index 5ee0687c064..e7c598808e8 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -429,6 +429,7 @@ class Item_func_in :public Item_int_func
class Item_func_isnull :public Item_bool_func
{
+ longlong cached_value;
public:
Item_func_isnull(Item *a) :Item_bool_func(a) {}
longlong val_int();
@@ -449,6 +450,12 @@ public:
args[0]->update_used_tables();
used_tables_cache=args[0]->used_tables();
}
+ if (!used_tables_cache)
+ {
+ /* Remember if the value is always NULL or never NULL */
+ args[0]->val();
+ cached_value= args[0]->null_value ? (longlong) 1 : (longlong) 0;
+ }
}
optimize_type select_optimize() const { return OPTIMIZE_NULL; }
};