diff options
author | unknown <monty@mashka.mysql.fi> | 2003-02-17 01:05:04 +0200 |
---|---|---|
committer | unknown <monty@mashka.mysql.fi> | 2003-02-17 01:05:04 +0200 |
commit | 1f66df4d47bb3bcdbb10709ac1911362727547e8 (patch) | |
tree | eb584ba2896d1fc6550417b89fd48769f58c3eba /sql | |
parent | cad553de49b1418c8d99652332dd62c706f65cc7 (diff) | |
download | mariadb-git-1f66df4d47bb3bcdbb10709ac1911362727547e8.tar.gz |
Fixed problem with ISNULL on fields that could not be null
Diffstat (limited to 'sql')
-rw-r--r-- | sql/item_cmpfunc.h | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index 5105eb9279d..c33042e11ab 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -449,17 +449,19 @@ public: void update_used_tables() { if (!args[0]->maybe_null) - used_tables_cache=0; /* is always false */ - else { - args[0]->update_used_tables(); - used_tables_cache=args[0]->used_tables(); + used_tables_cache= 0; /* is always false */ + cached_value= (longlong) 0; } - if (!used_tables_cache) + else { - /* Remember if the value is always NULL or never NULL */ - args[0]->val(); - cached_value= args[0]->null_value ? (longlong) 1 : (longlong) 0; + args[0]->update_used_tables(); + if (!(used_tables_cache=args[0]->used_tables())) + { + /* 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; } |