1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

The SQLITE_EXTRA_IFNULLROW compile-time option causes OP_IfNullRow opcodes

to be issued for references to the right-hand side table of *any* flattened
join, not just LEFT JOINs.  This puts extra stress on the OP_IfNUllRow opcodes
for testing purposes.

FossilOrigin-Name: 1a074c8a2bc0b28918ef905339d11a21d30101b4ea8c06c8b3faca7d17237538
This commit is contained in:
drh
2017-05-25 11:39:50 +00:00
parent 074ce1e7fd
commit dc6de47925
4 changed files with 18 additions and 11 deletions

View File

@@ -3511,6 +3511,14 @@ static int flattenSubquery(
return 0; /* Restriction (3) */
}
}
#ifdef SQLITE_EXTRA_IFNULLROW
else if( iFrom>0 && !isAgg ){
/* Setting isLeftJoin to -1 causes OP_IfNullRow opcodes to be generated for
** every reference to any result column from subquery in a join, even though
** they are not necessary. This will stress-test the OP_IfNullRow opcode. */
isLeftJoin = -1;
}
#endif
/* Restriction 17: If the sub-query is a compound SELECT, then it must
** use only the UNION ALL operator. And none of the simple select queries
@@ -3764,7 +3772,7 @@ static int flattenSubquery(
pSub->pOrderBy = 0;
}
pWhere = sqlite3ExprDup(db, pSub->pWhere, 0);
if( isLeftJoin ){
if( isLeftJoin>0 ){
setJoinExpr(pWhere, iNewParent);
}
if( subqueryIsAgg ){