diff options
author | danielk1977 <danielk1977@noemail.net> | 2008-03-25 09:47:35 +0000 |
---|---|---|
committer | danielk1977 <danielk1977@noemail.net> | 2008-03-25 09:47:35 +0000 |
commit | cd3e8f7ce94b2c87ceeeb3da3e2344e1397ec2ab (patch) | |
tree | 6c4d2fa51268edffef783bec9a2f9c689871b82e /src/select.c | |
parent | 1e968a0cbf30ea1b0f4d4c5927a8b173d36956d9 (diff) | |
download | sqlite-cd3e8f7ce94b2c87ceeeb3da3e2344e1397ec2ab.tar.gz sqlite-cd3e8f7ce94b2c87ceeeb3da3e2344e1397ec2ab.zip |
Use a vdbe memory cell to allocate the space required for vdbe cursors. (CVS 4912)
FossilOrigin-Name: 047153648155654b0cd70b811935209d2e21776c
Diffstat (limited to 'src/select.c')
-rw-r--r-- | src/select.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/select.c b/src/select.c index 18532b585..3df5f4055 100644 --- a/src/select.c +++ b/src/select.c @@ -12,7 +12,7 @@ ** This file contains C code routines that are called by the parser ** to handle SELECT statements in SQLite. ** -** $Id: select.c,v 1.417 2008/03/22 01:07:18 drh Exp $ +** $Id: select.c,v 1.418 2008/03/25 09:47:35 danielk1977 Exp $ */ #include "sqliteInt.h" @@ -789,8 +789,8 @@ static void generateSortTail( iTab = pOrderBy->iECursor; if( eDest==SRT_Callback || eDest==SRT_Subroutine ){ pseudoTab = pParse->nTab++; + sqlite3VdbeAddOp2(v, OP_SetNumColumns, 0, nColumn); sqlite3VdbeAddOp2(v, OP_OpenPseudo, pseudoTab, 0); - sqlite3VdbeAddOp2(v, OP_SetNumColumns, pseudoTab, nColumn); } addr = 1 + sqlite3VdbeAddOp2(v, OP_Sort, iTab, brk); codeOffset(v, p, cont); @@ -3316,10 +3316,9 @@ int sqlite3Select( */ sAggInfo.sortingIdx = pParse->nTab++; pKeyInfo = keyInfoFromExprList(pParse, pGroupBy); - addrSortingIdx = - sqlite3VdbeAddOp4(v, OP_OpenEphemeral, sAggInfo.sortingIdx, - sAggInfo.nSortingColumn, 0, - (char*)pKeyInfo, P4_KEYINFO_HANDOFF); + addrSortingIdx = sqlite3VdbeAddOp4(v, OP_OpenEphemeral, + sAggInfo.sortingIdx, sAggInfo.nSortingColumn, + 0, (char*)pKeyInfo, P4_KEYINFO_HANDOFF); /* Initialize memory locations used by GROUP BY aggregate processing */ |