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/analyze.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/analyze.c')
-rw-r--r-- | src/analyze.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/analyze.c b/src/analyze.c index 4168fe669..aeb997274 100644 --- a/src/analyze.c +++ b/src/analyze.c @@ -11,7 +11,7 @@ ************************************************************************* ** This file contains code associated with the ANALYZE command. ** -** @(#) $Id: analyze.c,v 1.41 2008/01/25 15:04:49 drh Exp $ +** @(#) $Id: analyze.c,v 1.42 2008/03/25 09:47:35 danielk1977 Exp $ */ #ifndef SQLITE_OMIT_ANALYZE #include "sqliteInt.h" @@ -74,9 +74,9 @@ static void openStatTable( if( !createStat1 ){ sqlite3TableLock(pParse, iDb, iRootPage, 1, "sqlite_stat1"); } + sqlite3VdbeAddOp2(v, OP_SetNumColumns, 0, 3); sqlite3VdbeAddOp3(v, OP_OpenWrite, iStatCur, iRootPage, iDb); sqlite3VdbeChangeP5(v, createStat1); - sqlite3VdbeAddOp2(v, OP_SetNumColumns, iStatCur, 3); } /* @@ -130,17 +130,17 @@ static void analyzeOneTable( /* Open a cursor to the index to be analyzed */ assert( iDb==sqlite3SchemaToIndex(pParse->db, pIdx->pSchema) ); + nCol = pIdx->nColumn; + sqlite3VdbeAddOp2(v, OP_SetNumColumns, 0, nCol+1); sqlite3VdbeAddOp4(v, OP_OpenRead, iIdxCur, pIdx->tnum, iDb, (char *)pKey, P4_KEYINFO_HANDOFF); VdbeComment((v, "%s", pIdx->zName)); - nCol = pIdx->nColumn; regFields = iMem+nCol*2; regTemp = regRowid = regCol = regFields+3; regRec = regCol+1; if( regRec>pParse->nMem ){ pParse->nMem = regRec; } - sqlite3VdbeAddOp2(v, OP_SetNumColumns, iIdxCur, nCol+1); /* Memory cells are used as follows: ** |