mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-10 01:02:56 +03:00
Add usage detection to the NULL value generator for the left table of a
RIGHT JOIN inside of an aggregate. FossilOrigin-Name: 4d05a009dfb63bcb4173da4d09ccc00c308ce4dd2534a32aeb23c5d8d6a1fd4b
This commit is contained in:
10
src/expr.c
10
src/expr.c
@@ -4224,9 +4224,15 @@ expr_code_doover:
|
||||
assert( pAggInfo!=0 );
|
||||
assert( pExpr->iAgg>=0 );
|
||||
if( pExpr->iAgg>=pAggInfo->nColumn ){
|
||||
/* Happens when the left table of a RIGHT JOIN is null and
|
||||
** is using an expression index */
|
||||
sqlite3VdbeAddOp2(v, OP_Null, 0, target);
|
||||
/* FIXME: Need to verify that tests run this opcode
|
||||
** Some kind of coverage macro.. VdbeCoverage(v); tag-20230325-2 */
|
||||
#ifdef SQLITE_VDBE_COVERAGE
|
||||
/* Verify that the OP_Null above is exercised by tests
|
||||
** tag-20230325-2 */
|
||||
sqlite3VdbeAddOp2(v, OP_NotNull, target, 1);
|
||||
VdbeCoverageNeverTaken(v);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
pCol = &pAggInfo->aCol[pExpr->iAgg];
|
||||
|
Reference in New Issue
Block a user