mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-24 07:23:03 +01:00
More clever solution for bug #459059.
Deoptimization of NOT ANY is no longer necessary.
This commit is contained in:
parent
cd1eb0dbd4
commit
77dafd90c3
@ -3500,22 +3500,9 @@ static jrd_nod* pass1(thread_db* tdbb,
|
||||
validate_expr);
|
||||
break;
|
||||
|
||||
case nod_not:
|
||||
// See below
|
||||
if (node->nod_arg[0]->nod_type == nod_ansi_any)
|
||||
{
|
||||
node->nod_arg[0]->nod_flags |= nod_deoptimize;
|
||||
}
|
||||
break;
|
||||
|
||||
case nod_ansi_all:
|
||||
node->nod_flags |= nod_deoptimize;
|
||||
// fall into
|
||||
|
||||
case nod_ansi_any:
|
||||
if (node->nod_flags & nod_deoptimize)
|
||||
{
|
||||
// Deoptimize the conjunct, not the ANY/ALL node itself
|
||||
// Deoptimize the conjunct, not the ALL node itself
|
||||
jrd_nod* boolean =
|
||||
((RecordSelExpr*) (node->nod_arg[e_any_rse]))->rse_boolean;
|
||||
fb_assert(boolean);
|
||||
@ -3524,13 +3511,13 @@ static jrd_nod* pass1(thread_db* tdbb,
|
||||
boolean = boolean->nod_arg[1];
|
||||
}
|
||||
// Deoptimize the injected boolean of a quantified predicate
|
||||
// when it's necessary. Neither ALL nor NOT ANY requires an index scan.
|
||||
// This fixes bugs SF #459059 and #543106.
|
||||
// when it's necessary. ALL predicate does not require an index scan.
|
||||
// This fixes bug SF #543106.
|
||||
boolean->nod_flags |= nod_deoptimize;
|
||||
node->nod_flags &= ~nod_deoptimize;
|
||||
}
|
||||
// fall into
|
||||
|
||||
case nod_ansi_any:
|
||||
case nod_any:
|
||||
case nod_exists:
|
||||
case nod_unique:
|
||||
|
@ -1949,6 +1949,11 @@ static bool get_record(thread_db* tdbb,
|
||||
{
|
||||
select_node = NULL;
|
||||
}
|
||||
|
||||
EVL_expr(tdbb, column_node->nod_arg[0]);
|
||||
if (request->req_flags & req_null) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (column_node && (request->req_flags & req_ansi_any))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user