mirror of
https://github.com/MariaDB/server.git
synced 2026-05-02 21:25:36 +02:00
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. mysql-test/r/ps.result: Extended test case for bug #25027. mysql-test/t/ps.test: Extended test case for bug #25027. sql/sql_lex.cc: Returned back the assertion in st_select_lex_unit::set_limit, removed by the previous commit for this bug.
This commit is contained in:
parent
2f78d5ca81
commit
cbd1bd9078
5 changed files with 18 additions and 4 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue