diff options
author | drh <drh@noemail.net> | 2011-12-10 14:44:31 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2011-12-10 14:44:31 +0000 |
commit | a5eec8c8c3b44b802d6571a436ec3b3bffd69f4c (patch) | |
tree | bc1364df96b88de63e0ba83a3b05df2c233add73 /src/select.c | |
parent | 4e2a9c32721086d5f73f84c075c9883018038b89 (diff) | |
parent | 3a0c9c0298776f8a3ca842fe555979768fdabac7 (diff) | |
download | sqlite-a5eec8c8c3b44b802d6571a436ec3b3bffd69f4c.tar.gz sqlite-a5eec8c8c3b44b802d6571a436ec3b3bffd69f4c.zip |
Merge the latest trunk changes into tree-explain branch.
FossilOrigin-Name: 1a360da0f8314f232c224c71829646bc7558892b
Diffstat (limited to 'src/select.c')
-rw-r--r-- | src/select.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/select.c b/src/select.c index f761a0897..15b34e2b4 100644 --- a/src/select.c +++ b/src/select.c @@ -3845,12 +3845,11 @@ int sqlite3Select( topAddr = sqlite3VdbeAddOp2(v, OP_Integer, 0, pItem->regReturn); pItem->addrFillSub = topAddr+1; VdbeNoopComment((v, "materialize %s", pItem->pTab->zName)); - if( pItem->isCorrelated==0 && pParse->pTriggerTab==0 ){ + if( pItem->isCorrelated==0 ){ /* If the subquery is no correlated and if we are not inside of ** a trigger, then we only need to compute the value of the subquery ** once. */ - int regOnce = ++pParse->nMem; - onceAddr = sqlite3VdbeAddOp1(v, OP_Once, regOnce); + onceAddr = sqlite3CodeOnce(pParse); } sqlite3SelectDestInit(&dest, SRT_EphemTab, pItem->iCursor); explainSetInteger(pItem->iSelectId, (u8)pParse->iNextSelectId); @@ -4155,6 +4154,7 @@ int sqlite3Select( VdbeComment((v, "clear abort flag")); sqlite3VdbeAddOp2(v, OP_Integer, 0, iUseFlag); VdbeComment((v, "indicate accumulator empty")); + sqlite3VdbeAddOp3(v, OP_Null, 0, iAMem, iAMem+pGroupBy->nExpr-1); /* Begin a loop that will extract all source rows in GROUP BY order. ** This might involve two separate loops with an OP_Sort in between, or |