mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-10 01:02:56 +03:00
When the left table of a RIGHT JOIN is used inside an aggregate function
and the left table employs an index on expressions, then make sure the expressions evaluate to NULL for the cases where the left table should be NULL. Proposed fix for [forum:/forumpost/9b491e1deb|forum post 9b491e1deb]. More testing an analysis needed - there is a FIXME in this check-in. FossilOrigin-Name: 3572b40a7dfc4acc35e72e08e79f64688f8737e57ac89e4d10e6b32bd5178c63
This commit is contained in:
@@ -4222,7 +4222,13 @@ expr_code_doover:
|
||||
AggInfo *pAggInfo = pExpr->pAggInfo;
|
||||
struct AggInfo_col *pCol;
|
||||
assert( pAggInfo!=0 );
|
||||
assert( pExpr->iAgg>=0 && pExpr->iAgg<pAggInfo->nColumn );
|
||||
assert( pExpr->iAgg>=0 );
|
||||
if( pExpr->iAgg>=pAggInfo->nColumn ){
|
||||
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 */
|
||||
break;
|
||||
}
|
||||
pCol = &pAggInfo->aCol[pExpr->iAgg];
|
||||
if( !pAggInfo->directMode ){
|
||||
return AggInfoColumnReg(pAggInfo, pExpr->iAgg);
|
||||
|
Reference in New Issue
Block a user