diff options
author | igor@olga.mysql.com <> | 2006-12-13 21:08:25 -0800 |
---|---|---|
committer | igor@olga.mysql.com <> | 2006-12-13 21:08:25 -0800 |
commit | 8642d23b6a1ef75d9120ba0871de2c183feee7db (patch) | |
tree | d2a54ccb335e917d32f0e7f7c6cf236039ea34d5 /sql/item_cmpfunc.cc | |
parent | 026196c4ef3217491d22959bafde1cea40f9667b (diff) | |
download | mariadb-git-8642d23b6a1ef75d9120ba0871de2c183feee7db.tar.gz |
Fixed bug #25027.
Blocked evaluation of constant objects of the classes
Item_func_is_null and Item_is_not_null_test at the
prepare phase in the cases when the objects used subqueries.
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r-- | sql/item_cmpfunc.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 29fa049b6c4..0a7cbbb51cb 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -2990,7 +2990,7 @@ longlong Item_func_isnull::val_int() Handle optimization if the argument can't be null This has to be here because of the test in update_used_tables(). */ - if (!used_tables_cache) + if (!used_tables_cache && !with_subselect) return cached_value; return args[0]->is_null() ? 1: 0; } @@ -2999,7 +2999,7 @@ longlong Item_is_not_null_test::val_int() { DBUG_ASSERT(fixed == 1); DBUG_ENTER("Item_is_not_null_test::val_int"); - if (!used_tables_cache) + if (!used_tables_cache && !with_subselect) { owner->was_null|= (!cached_value); DBUG_PRINT("info", ("cached :%ld", (long) cached_value)); @@ -3026,7 +3026,7 @@ void Item_is_not_null_test::update_used_tables() else { args[0]->update_used_tables(); - if (!(used_tables_cache=args[0]->used_tables())) + if (!(used_tables_cache=args[0]->used_tables()) && !with_subselect) { /* Remember if the value is always NULL or never NULL */ cached_value= (longlong) !args[0]->is_null(); |