Commit 93c93592 authored by Gleb Shchepa's avatar Gleb Shchepa

Manual up-merge (16311231 backport)

parents e1e43631 f8cd565d
...@@ -4700,7 +4700,7 @@ longlong Item_is_not_null_test::val_int() ...@@ -4700,7 +4700,7 @@ longlong Item_is_not_null_test::val_int()
{ {
DBUG_ASSERT(fixed == 1); DBUG_ASSERT(fixed == 1);
DBUG_ENTER("Item_is_not_null_test::val_int"); DBUG_ENTER("Item_is_not_null_test::val_int");
if (const_item_cache) if (!used_tables_cache && !with_subselect)
{ {
owner->was_null|= (!cached_value); owner->was_null|= (!cached_value);
DBUG_PRINT("info", ("cached: %ld", (long) cached_value)); DBUG_PRINT("info", ("cached: %ld", (long) cached_value));
...@@ -4721,12 +4721,10 @@ longlong Item_is_not_null_test::val_int() ...@@ -4721,12 +4721,10 @@ longlong Item_is_not_null_test::val_int()
*/ */
void Item_is_not_null_test::update_used_tables() void Item_is_not_null_test::update_used_tables()
{ {
const_item_cache= false;
if (!args[0]->maybe_null) if (!args[0]->maybe_null)
{ {
used_tables_cache= 0; /* is always true */ used_tables_cache= 0; /* is always true */
cached_value= (longlong) 1; cached_value= (longlong) 1;
const_item_cache= true;
} }
else else
{ {
...@@ -4735,7 +4733,6 @@ void Item_is_not_null_test::update_used_tables() ...@@ -4735,7 +4733,6 @@ void Item_is_not_null_test::update_used_tables()
{ {
/* Remember if the value is always NULL or never NULL */ /* Remember if the value is always NULL or never NULL */
cached_value= (longlong) !args[0]->is_null(); cached_value= (longlong) !args[0]->is_null();
const_item_cache= true;
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment