1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Remove unused parameters on internal APIs. Suppress warnings from

CodeWarrior. (CVS 3110)

FossilOrigin-Name: 4b22e4b847f8d5c29830baea541194ef3a0c4811
This commit is contained in:
drh
2006-02-24 02:53:49 +00:00
parent 874abbed68
commit 74161705f1
21 changed files with 96 additions and 108 deletions

View File

@@ -1,5 +1,5 @@
C Make\ssure\sthe\srandom()\sfunction\salways\sreturns\sa\svalue\sthat\scan\sbe\spassed\nto\sabs().\s(CVS\s3109) C Remove\sunused\sparameters\son\sinternal\sAPIs.\s\sSuppress\swarnings\sfrom\nCodeWarrior.\s(CVS\s3110)
D 2006-02-23T21:51:13 D 2006-02-24T02:53:50
F Makefile.in 5d8dff443383918b700e495de42ec65bc1c8865b F Makefile.in 5d8dff443383918b700e495de42ec65bc1c8865b
F Makefile.linux-gcc 74ba0eadf88748a9ce3fd03d2a3ede2e6715baec F Makefile.linux-gcc 74ba0eadf88748a9ce3fd03d2a3ede2e6715baec
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@@ -34,19 +34,19 @@ F src/alter.c 451b34fc4eb2475ca76a2e86b21e1030a9428091
F src/analyze.c 7d2b7ab9a9c2fd6e55700f69064dfdd3e36d7a8a F src/analyze.c 7d2b7ab9a9c2fd6e55700f69064dfdd3e36d7a8a
F src/attach.c d73a3505de3fb9e373d0a158978116c4212031d0 F src/attach.c d73a3505de3fb9e373d0a158978116c4212031d0
F src/auth.c 9ae84d2d94eb96195e04515715e08e85963e96c2 F src/auth.c 9ae84d2d94eb96195e04515715e08e85963e96c2
F src/btree.c b4af2cff1e0f6815fca740ec094f564e9870792c F src/btree.c ffe57d05cf1d4b3f9837c8f1b4015da843a8f287
F src/btree.h 40055cfc09defd1146bc5b922399c035f969e56d F src/btree.h 40055cfc09defd1146bc5b922399c035f969e56d
F src/build.c f96e57e6a05c3e039c0dde9219d4a3753974d874 F src/build.c eaf2d4d894e5317fd2de86fe4f1c5f93d9ed3d7b
F src/callback.c 1bf497306c32229114f826707054df7ebe10abf2 F src/callback.c 1bf497306c32229114f826707054df7ebe10abf2
F src/complete.c 7d1a44be8f37de125fcafd3d3a018690b3799675 F src/complete.c 7d1a44be8f37de125fcafd3d3a018690b3799675
F src/date.c cd2bd5d1ebc6fa12d6312f69789ae5b0a2766f2e F src/date.c cd2bd5d1ebc6fa12d6312f69789ae5b0a2766f2e
F src/delete.c ca404d5fd5f678e32f2f46377ad802cd0219aa99 F src/delete.c 2dea1a83e6ef534346e74fd03114d3a7b16f08fc
F src/experimental.c 1b2d1a6cd62ecc39610e97670332ca073c50792b F src/experimental.c 1b2d1a6cd62ecc39610e97670332ca073c50792b
F src/expr.c 9c957fabf95ef62288151eecd5c490a629470666 F src/expr.c 9c957fabf95ef62288151eecd5c490a629470666
F src/func.c 402b305b0f0d8709cce343e74312bcc38ed61f06 F src/func.c 402b305b0f0d8709cce343e74312bcc38ed61f06
F src/hash.c 449f3d6620193aa557f5d86cbc5cc6b87702b185 F src/hash.c 449f3d6620193aa557f5d86cbc5cc6b87702b185
F src/hash.h 1b3f7e2609141fd571f62199fc38687d262e9564 F src/hash.h 1b3f7e2609141fd571f62199fc38687d262e9564
F src/insert.c 67b3dc11831c58d8703eb502355ad3704ee18f66 F src/insert.c ae51e360d1e710870471fb72d00f84c3d98292a0
F src/legacy.c 86b669707b3cefd570e34154e2f6457547d1df4f F src/legacy.c 86b669707b3cefd570e34154e2f6457547d1df4f
F src/main.c f520c65fb1478e1db1c20387c60a4e5765b0d7aa F src/main.c f520c65fb1478e1db1c20387c60a4e5765b0d7aa
F src/md5.c c5fdfa5c2593eaee2e32a5ce6c6927c986eaf217 F src/md5.c c5fdfa5c2593eaee2e32a5ce6c6927c986eaf217
@@ -59,18 +59,18 @@ F src/os_unix.c 757a7b726764367f7b0595c4302969582c04413d
F src/os_unix.h 5768d56d28240d3fe4537fac08cc85e4fb52279e F src/os_unix.h 5768d56d28240d3fe4537fac08cc85e4fb52279e
F src/os_win.c c67a2c46d929cf54c8f80ec5e6079cf684a141a9 F src/os_win.c c67a2c46d929cf54c8f80ec5e6079cf684a141a9
F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b
F src/pager.c c438aa5fc248e0523e80591eeae33a3993c47278 F src/pager.c bb2c0007f6e447a4cf7b101e165fc0b79938785f
F src/pager.h 425a9e52d5404158de016799715cbc2c3d685178 F src/pager.h 425a9e52d5404158de016799715cbc2c3d685178
F src/parse.y 6d666d60a3bb51ceeb0d30b395455a24856849b7 F src/parse.y 52b8cdcceeaef01283138de5541dcadd2eeff486
F src/pragma.c 607b0f3b1916aa01918acd08499bd6ef21065c23 F src/pragma.c 607b0f3b1916aa01918acd08499bd6ef21065c23
F src/prepare.c cf0fc8ebaf94409955ecb09ffeb0099c9ef44693 F src/prepare.c cf0fc8ebaf94409955ecb09ffeb0099c9ef44693
F src/printf.c c7d6ad9efb71c466305297a448308f467b6e2b6e F src/printf.c cda33918f602ff20bfba3ceae642ac1ed8f476d6
F src/random.c d40f8d356cecbd351ccfab6eaedd7ec1b54f5261 F src/random.c d40f8d356cecbd351ccfab6eaedd7ec1b54f5261
F src/select.c 7d069e875d0eec05129c7e8b9c99422d7c9c6321 F src/select.c 46e1d5bf796696a10587e981407fd75632fc9ba3
F src/server.c 087b92a39d883e3fa113cae259d64e4c7438bc96 F src/server.c 087b92a39d883e3fa113cae259d64e4c7438bc96
F src/shell.c 738f55ed75fb36731e764bfdb40756ac43b90b08 F src/shell.c 738f55ed75fb36731e764bfdb40756ac43b90b08
F src/sqlite.h.in 0bf6f03f9a14dde5f3a4f87471840803acaa4497 F src/sqlite.h.in 0bf6f03f9a14dde5f3a4f87471840803acaa4497
F src/sqliteInt.h bd6a966fecba8955e5861234d97d6f835e347c42 F src/sqliteInt.h d99092c3bb510712b26461cf07cff8eca686b83d
F src/table.c f64ec4fbfe333f8df925bc6ba494f55e05b0e75e F src/table.c f64ec4fbfe333f8df925bc6ba494f55e05b0e75e
F src/tclsqlite.c d9c26374b52cd47233ae0620d0a858a59b601f89 F src/tclsqlite.c d9c26374b52cd47233ae0620d0a858a59b601f89
F src/test1.c 9d299609a0ce35157fe15cdf8b4c663db5d40386 F src/test1.c 9d299609a0ce35157fe15cdf8b4c663db5d40386
@@ -84,19 +84,19 @@ F src/test_async.c e3deaedd4d86a56391b81808fde9e44fbd92f1d3
F src/test_md5.c 6c42bc0a3c0b54be34623ff77a0eec32b2fa96e3 F src/test_md5.c 6c42bc0a3c0b54be34623ff77a0eec32b2fa96e3
F src/test_server.c 087b92a39d883e3fa113cae259d64e4c7438bc96 F src/test_server.c 087b92a39d883e3fa113cae259d64e4c7438bc96
F src/tokenize.c 382b3bb0ca26eb9153b5d20b246ef512a114a24f F src/tokenize.c 382b3bb0ca26eb9153b5d20b246ef512a114a24f
F src/trigger.c 4d3644cbd16959b568c95ae73493402be8021b08 F src/trigger.c bdead679e3688fa9e3d690ac83e471e1b5358318
F src/update.c 050a7e0ddaac03dec5271712eee62f1a9e699049 F src/update.c 34add66fcd3301b33b6e4c4c813f4e408f7ee4a0
F src/utf.c 1199766bbb0157931a83aa6eede6b6381177be64 F src/utf.c 1d51225bce1ea8d1978e8ab28e862a0c12c7a8e8
F src/util.c 8aa4f443a2c4a790f4ab3b38d148e108e9c00f2e F src/util.c f3f004c2b6ac6b1f8fd275f96efe040c5b0aa102
F src/vacuum.c 3865673cc66acd0717ecd517f6b8fdb2a5e7924b F src/vacuum.c 5b37d0f436f8e1ffacd17934e44720b38d2247f9
F src/vdbe.c 0a7fd81609429bae2b3c326687b02a60a9c01c49 F src/vdbe.c 5fb9d3e64ed18f82e71bd2ff94c3e5f07384c7d4
F src/vdbe.h 80ba1c391ec28180dd07a630577f50b22c2062da F src/vdbe.h 80ba1c391ec28180dd07a630577f50b22c2062da
F src/vdbeInt.h eb3f86ab08ef11635bc78eb88c3ff13f923c233b F src/vdbeInt.h 2109be6b58e3bfcd8e5b56d3b212b1a105a61051
F src/vdbeapi.c 7dc662e7c905ce666bb506dced932e0307115cbf F src/vdbeapi.c 7dc662e7c905ce666bb506dced932e0307115cbf
F src/vdbeaux.c 95f4ed0bc8ed45f16823d84504310495b5dc587d F src/vdbeaux.c 433850854059f1ff74ed09bc4df890fbae57f332
F src/vdbefifo.c 9efb94c8c3f4c979ebd0028219483f88e57584f5 F src/vdbefifo.c 9efb94c8c3f4c979ebd0028219483f88e57584f5
F src/vdbemem.c a1738a8605bcb92615698eeda9c61c0d46971b10 F src/vdbemem.c 5f0afe3b92bb2c037f8d5d697f7c151fa50783a3
F src/where.c c7d71d5e55c9c4c1e948089280fb0dec7c7d1ef6 F src/where.c 39af47e7f48be8df8a14a5965a38326bccf8eeed
F tclinstaller.tcl 046e3624671962dc50f0481d7c25b38ef803eb42 F tclinstaller.tcl 046e3624671962dc50f0481d7c25b38ef803eb42
F test/aggerror.test b854de90f530ae37be68fbfe6de40e111358cbb2 F test/aggerror.test b854de90f530ae37be68fbfe6de40e111358cbb2
F test/all.test 5df90d015ca63fcef2a4b62c24f7316b66c4bfd4 F test/all.test 5df90d015ca63fcef2a4b62c24f7316b66c4bfd4
@@ -354,7 +354,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl a99cf5f6d8bd4d5537584a2b342f0fb9fa601d8b F www/version3.tcl a99cf5f6d8bd4d5537584a2b342f0fb9fa601d8b
F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513 F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513
P 942c509595a2a300e798e6b048ad7fc3bc54af43 P 5d2e7ea01989fc9ba2c79d192760bc29f8cab463
R 151d579d1c46dea292a923e2d9c89659 R baa01ddef2a6621d707afa4441611757
U drh U drh
Z 630eeabb62dfd30a6a8a8d528960cacb Z d0c2d619e1ded91f63a55f7331a682a5

View File

@@ -1 +1 @@
5d2e7ea01989fc9ba2c79d192760bc29f8cab463 4b22e4b847f8d5c29830baea541194ef3a0c4811

View File

@@ -9,7 +9,7 @@
** May you share freely, never taking more than you give. ** May you share freely, never taking more than you give.
** **
************************************************************************* *************************************************************************
** $Id: btree.c,v 1.315 2006/02/22 03:08:33 drh Exp $ ** $Id: btree.c,v 1.316 2006/02/24 02:53:50 drh Exp $
** **
** This file implements a external (disk-based) database using BTrees. ** This file implements a external (disk-based) database using BTrees.
** For a detailed discussion of BTrees, refer to ** For a detailed discussion of BTrees, refer to
@@ -1750,7 +1750,7 @@ int sqlite3BtreeClose(Btree *p){
pTsd->pBtree = pBt->pNext; pTsd->pBtree = pBt->pNext;
}else{ }else{
BtShared *pPrev; BtShared *pPrev;
for(pPrev=pTsd->pBtree; pPrev && pPrev->pNext!=pBt; pPrev=pPrev->pNext); for(pPrev=pTsd->pBtree; pPrev && pPrev->pNext!=pBt; pPrev=pPrev->pNext){}
if( pPrev ){ if( pPrev ){
assert( pTsd==sqlite3ThreadData() ); assert( pTsd==sqlite3ThreadData() );
pPrev->pNext = pBt->pNext; pPrev->pNext = pBt->pNext;
@@ -6221,11 +6221,7 @@ static int checkTreePage(
IntegrityCk *pCheck, /* Context for the sanity check */ IntegrityCk *pCheck, /* Context for the sanity check */
int iPage, /* Page number of the page to check */ int iPage, /* Page number of the page to check */
MemPage *pParent, /* Parent page */ MemPage *pParent, /* Parent page */
char *zParentContext, /* Parent context */ char *zParentContext /* Parent context */
char *zLowerBound, /* All keys should be greater than this, if not NULL */
int nLower, /* Number of characters in zLowerBound */
char *zUpperBound, /* All keys should be less than this, if not NULL */
int nUpper /* Number of characters in zUpperBound */
){ ){
MemPage *pPage; MemPage *pPage;
int i, rc, depth, d2, pgno, cnt; int i, rc, depth, d2, pgno, cnt;
@@ -6291,7 +6287,7 @@ static int checkTreePage(
checkPtrmap(pCheck, pgno, PTRMAP_BTREE, iPage, zContext); checkPtrmap(pCheck, pgno, PTRMAP_BTREE, iPage, zContext);
} }
#endif #endif
d2 = checkTreePage(pCheck,pgno,pPage,zContext,0,0,0,0); d2 = checkTreePage(pCheck,pgno,pPage,zContext);
if( i>0 && d2!=depth ){ if( i>0 && d2!=depth ){
checkAppendMsg(pCheck, zContext, "Child page depth differs"); checkAppendMsg(pCheck, zContext, "Child page depth differs");
} }
@@ -6306,7 +6302,7 @@ static int checkTreePage(
checkPtrmap(pCheck, pgno, PTRMAP_BTREE, iPage, 0); checkPtrmap(pCheck, pgno, PTRMAP_BTREE, iPage, 0);
} }
#endif #endif
checkTreePage(pCheck, pgno, pPage, zContext,0,0,0,0); checkTreePage(pCheck, pgno, pPage, zContext);
} }
/* Check for complete coverage of the page /* Check for complete coverage of the page
@@ -6418,7 +6414,7 @@ char *sqlite3BtreeIntegrityCheck(Btree *p, int *aRoot, int nRoot){
checkPtrmap(&sCheck, aRoot[i], PTRMAP_ROOTPAGE, 0, 0); checkPtrmap(&sCheck, aRoot[i], PTRMAP_ROOTPAGE, 0, 0);
} }
#endif #endif
checkTreePage(&sCheck, aRoot[i], 0, "List of tree roots: ", 0,0,0,0); checkTreePage(&sCheck, aRoot[i], 0, "List of tree roots: ");
} }
/* Make sure every page in the file is referenced /* Make sure every page in the file is referenced

View File

@@ -22,7 +22,7 @@
** COMMIT ** COMMIT
** ROLLBACK ** ROLLBACK
** **
** $Id: build.c,v 1.388 2006/02/18 16:36:45 drh Exp $ ** $Id: build.c,v 1.389 2006/02/24 02:53:50 drh Exp $
*/ */
#include "sqliteInt.h" #include "sqliteInt.h"
#include <ctype.h> #include <ctype.h>
@@ -338,7 +338,7 @@ static void freeIndex(Index *p){
** it is not unlinked from the Table that it indexes. ** it is not unlinked from the Table that it indexes.
** Unlinking from the Table must be done by the calling function. ** Unlinking from the Table must be done by the calling function.
*/ */
static void sqliteDeleteIndex(sqlite3 *db, Index *p){ static void sqliteDeleteIndex(Index *p){
Index *pOld; Index *pOld;
const char *zName = p->zName; const char *zName = p->zName;
@@ -507,7 +507,7 @@ void sqlite3DeleteTable(sqlite3 *db, Table *pTable){
for(pIndex = pTable->pIndex; pIndex; pIndex=pNext){ for(pIndex = pTable->pIndex; pIndex; pIndex=pNext){
pNext = pIndex->pNext; pNext = pIndex->pNext;
assert( pIndex->pSchema==pTable->pSchema ); assert( pIndex->pSchema==pTable->pSchema );
sqliteDeleteIndex(db, pIndex); sqliteDeleteIndex(pIndex);
} }
#ifndef SQLITE_OMIT_FOREIGN_KEY #ifndef SQLITE_OMIT_FOREIGN_KEY
@@ -690,8 +690,7 @@ int sqlite3CheckObjectName(Parse *pParse, const char *zName){
** Begin constructing a new table representation in memory. This is ** Begin constructing a new table representation in memory. This is
** the first of several action routines that get called in response ** the first of several action routines that get called in response
** to a CREATE TABLE statement. In particular, this routine is called ** to a CREATE TABLE statement. In particular, this routine is called
** after seeing tokens "CREATE" and "TABLE" and the table name. The ** after seeing tokens "CREATE" and "TABLE" and the table name. The isTemp
** pStart token is the CREATE and pName is the table name. The isTemp
** flag is true if the table should be stored in the auxiliary database ** flag is true if the table should be stored in the auxiliary database
** file instead of in the main database file. This is normally the case ** file instead of in the main database file. This is normally the case
** when the "TEMP" or "TEMPORARY" keyword occurs in between ** when the "TEMP" or "TEMPORARY" keyword occurs in between
@@ -705,7 +704,6 @@ int sqlite3CheckObjectName(Parse *pParse, const char *zName){
*/ */
void sqlite3StartTable( void sqlite3StartTable(
Parse *pParse, /* Parser context */ Parse *pParse, /* Parser context */
Token *pStart, /* The "CREATE" token */
Token *pName1, /* First part of the name of the table or view */ Token *pName1, /* First part of the name of the table or view */
Token *pName2, /* Second part of the name of the table or view */ Token *pName2, /* Second part of the name of the table or view */
int isTemp, /* True if this is a TEMP table */ int isTemp, /* True if this is a TEMP table */
@@ -1584,7 +1582,7 @@ void sqlite3CreateView(
sqlite3SelectDelete(pSelect); sqlite3SelectDelete(pSelect);
return; return;
} }
sqlite3StartTable(pParse, pBegin, pName1, pName2, isTemp, 1, 0); sqlite3StartTable(pParse, pName1, pName2, isTemp, 1, 0);
p = pParse->pNewTable; p = pParse->pNewTable;
if( p==0 || pParse->nErr ){ if( p==0 || pParse->nErr ){
sqlite3SelectDelete(pSelect); sqlite3SelectDelete(pSelect);
@@ -1925,7 +1923,7 @@ void sqlite3DropTable(Parse *pParse, SrcList *pName, int isView, int noErr){
while( pTrigger ){ while( pTrigger ){
assert( pTrigger->pSchema==pTab->pSchema || assert( pTrigger->pSchema==pTab->pSchema ||
pTrigger->pSchema==db->aDb[1].pSchema ); pTrigger->pSchema==db->aDb[1].pSchema );
sqlite3DropTriggerPtr(pParse, pTrigger, 1); sqlite3DropTriggerPtr(pParse, pTrigger);
pTrigger = pTrigger->pNext; pTrigger = pTrigger->pNext;
} }

View File

@@ -12,7 +12,7 @@
** This file contains C code routines that are called by the parser ** This file contains C code routines that are called by the parser
** in order to generate code for DELETE FROM statements. ** in order to generate code for DELETE FROM statements.
** **
** $Id: delete.c,v 1.121 2006/02/10 02:27:43 danielk1977 Exp $ ** $Id: delete.c,v 1.122 2006/02/24 02:53:50 drh Exp $
*/ */
#include "sqliteInt.h" #include "sqliteInt.h"
@@ -382,7 +382,7 @@ void sqlite3GenerateRowDelete(
){ ){
int addr; int addr;
addr = sqlite3VdbeAddOp(v, OP_NotExists, iCur, 0); addr = sqlite3VdbeAddOp(v, OP_NotExists, iCur, 0);
sqlite3GenerateRowIndexDelete(db, v, pTab, iCur, 0); sqlite3GenerateRowIndexDelete(v, pTab, iCur, 0);
sqlite3VdbeAddOp(v, OP_Delete, iCur, (count?OPFLAG_NCHANGE:0)); sqlite3VdbeAddOp(v, OP_Delete, iCur, (count?OPFLAG_NCHANGE:0));
if( count ){ if( count ){
sqlite3VdbeChangeP3(v, -1, pTab->zName, P3_STATIC); sqlite3VdbeChangeP3(v, -1, pTab->zName, P3_STATIC);
@@ -407,7 +407,6 @@ void sqlite3GenerateRowDelete(
** deleted. ** deleted.
*/ */
void sqlite3GenerateRowIndexDelete( void sqlite3GenerateRowIndexDelete(
sqlite3 *db, /* The database containing the index */
Vdbe *v, /* Generate code into this VDBE */ Vdbe *v, /* Generate code into this VDBE */
Table *pTab, /* Table containing the row to be deleted */ Table *pTab, /* Table containing the row to be deleted */
int iCur, /* Cursor number for the table */ int iCur, /* Cursor number for the table */

View File

@@ -12,7 +12,7 @@
** This file contains C code routines that are called by the parser ** This file contains C code routines that are called by the parser
** to handle INSERT statements in SQLite. ** to handle INSERT statements in SQLite.
** **
** $Id: insert.c,v 1.161 2006/02/10 02:27:43 danielk1977 Exp $ ** $Id: insert.c,v 1.162 2006/02/24 02:53:50 drh Exp $
*/ */
#include "sqliteInt.h" #include "sqliteInt.h"
@@ -911,7 +911,7 @@ void sqlite3GenerateConstraintChecks(
break; break;
} }
case OE_Replace: { case OE_Replace: {
sqlite3GenerateRowIndexDelete(pParse->db, v, pTab, base, 0); sqlite3GenerateRowIndexDelete(v, pTab, base, 0);
if( isUpdate ){ if( isUpdate ){
sqlite3VdbeAddOp(v, OP_Dup, nCol+hasTwoRowids, 1); sqlite3VdbeAddOp(v, OP_Dup, nCol+hasTwoRowids, 1);
sqlite3VdbeAddOp(v, OP_MoveGe, base, 0); sqlite3VdbeAddOp(v, OP_MoveGe, base, 0);

View File

@@ -18,7 +18,7 @@
** file simultaneously, or one process from reading the database while ** file simultaneously, or one process from reading the database while
** another is writing. ** another is writing.
** **
** @(#) $Id: pager.c,v 1.258 2006/02/11 01:25:51 drh Exp $ ** @(#) $Id: pager.c,v 1.259 2006/02/24 02:53:50 drh Exp $
*/ */
#ifndef SQLITE_OMIT_DISKIO #ifndef SQLITE_OMIT_DISKIO
#include "sqliteInt.h" #include "sqliteInt.h"
@@ -935,7 +935,7 @@ static int pager_unwritelock(Pager *pPager){
** only the middle sector is corrupt, we will still have a reasonable ** only the middle sector is corrupt, we will still have a reasonable
** chance of failing the checksum and thus detecting the problem. ** chance of failing the checksum and thus detecting the problem.
*/ */
static u32 pager_cksum(Pager *pPager, Pgno pgno, const u8 *aData){ static u32 pager_cksum(Pager *pPager, const u8 *aData){
u32 cksum = pPager->cksumInit; u32 cksum = pPager->cksumInit;
int i = pPager->pageSize-200; int i = pPager->pageSize-200;
while( i>0 ){ while( i>0 ){
@@ -987,7 +987,7 @@ static int pager_playback_one_page(Pager *pPager, OsFile *jfd, int useCksum){
rc = read32bits(jfd, &cksum); rc = read32bits(jfd, &cksum);
if( rc ) return rc; if( rc ) return rc;
pPager->journalOff += 4; pPager->journalOff += 4;
if( pager_cksum(pPager, pgno, aData)!=cksum ){ if( pager_cksum(pPager, aData)!=cksum ){
return SQLITE_DONE; return SQLITE_DONE;
} }
} }
@@ -2070,7 +2070,7 @@ int sqlite3pager_close(Pager *pPager){
pTsd->pPager = pPager->pNext; pTsd->pPager = pPager->pNext;
}else{ }else{
Pager *pTmp; Pager *pTmp;
for(pTmp = pTsd->pPager; pTmp->pNext!=pPager; pTmp=pTmp->pNext); for(pTmp = pTsd->pPager; pTmp->pNext!=pPager; pTmp=pTmp->pNext){}
pTmp->pNext = pPager->pNext; pTmp->pNext = pPager->pNext;
} }
#endif #endif
@@ -2477,7 +2477,7 @@ int sqlite3pager_release_memory(int nReq){
if( pPg==p->pAll ){ if( pPg==p->pAll ){
p->pAll = pPg->pNextAll; p->pAll = pPg->pNextAll;
}else{ }else{
for( pTmp=p->pAll; pTmp->pNextAll!=pPg; pTmp=pTmp->pNextAll ); for( pTmp=p->pAll; pTmp->pNextAll!=pPg; pTmp=pTmp->pNextAll ){}
pTmp->pNextAll = pPg->pNextAll; pTmp->pNextAll = pPg->pNextAll;
} }
nReleased += sqliteAllocSize(pPg); nReleased += sqliteAllocSize(pPg);
@@ -3023,7 +3023,7 @@ int sqlite3pager_write(void *pData){
** that we do not. */ ** that we do not. */
assert( pPg->pgno!=PAGER_MJ_PGNO(pPager) ); assert( pPg->pgno!=PAGER_MJ_PGNO(pPager) );
CODEC(pPager, pData, pPg->pgno, 7); CODEC(pPager, pData, pPg->pgno, 7);
cksum = pager_cksum(pPager, pPg->pgno, pData); cksum = pager_cksum(pPager, pData);
saved = *(u32*)PGHDR_TO_EXTRA(pPg, pPager); saved = *(u32*)PGHDR_TO_EXTRA(pPg, pPager);
store32bits(cksum, pPg, pPager->pageSize); store32bits(cksum, pPg, pPager->pageSize);
szPg = pPager->pageSize+8; szPg = pPager->pageSize+8;

View File

@@ -14,7 +14,7 @@
** the parser. Lemon will also generate a header file containing ** the parser. Lemon will also generate a header file containing
** numeric codes for all of the tokens. ** numeric codes for all of the tokens.
** **
** @(#) $Id: parse.y,v 1.195 2006/02/10 02:27:43 danielk1977 Exp $ ** @(#) $Id: parse.y,v 1.196 2006/02/24 02:53:50 drh Exp $
*/ */
// All token codes are small integers with #defines that begin with "TK_" // All token codes are small integers with #defines that begin with "TK_"
@@ -120,8 +120,8 @@ cmd ::= ROLLBACK trans_opt. {sqlite3RollbackTransaction(pParse);}
///////////////////// The CREATE TABLE statement //////////////////////////// ///////////////////// The CREATE TABLE statement ////////////////////////////
// //
cmd ::= create_table create_table_args. cmd ::= create_table create_table_args.
create_table ::= CREATE(X) temp(T) TABLE ifnotexists(E) nm(Y) dbnm(Z). { create_table ::= CREATE temp(T) TABLE ifnotexists(E) nm(Y) dbnm(Z). {
sqlite3StartTable(pParse,&X,&Y,&Z,T,0,E); sqlite3StartTable(pParse,&Y,&Z,T,0,E);
} }
%type ifnotexists {int} %type ifnotexists {int}
ifnotexists(A) ::= . {A = 0;} ifnotexists(A) ::= . {A = 0;}
@@ -884,8 +884,8 @@ cmd ::= DROP INDEX ifexists(E) fullname(X). {sqlite3DropIndex(pParse, X, E);}
///////////////////////////// The VACUUM command ///////////////////////////// ///////////////////////////// The VACUUM command /////////////////////////////
// //
cmd ::= VACUUM. {sqlite3Vacuum(pParse,0);} cmd ::= VACUUM. {sqlite3Vacuum(pParse);}
cmd ::= VACUUM nm. {sqlite3Vacuum(pParse,0);} cmd ::= VACUUM nm. {sqlite3Vacuum(pParse);}
///////////////////////////// The PRAGMA command ///////////////////////////// ///////////////////////////// The PRAGMA command /////////////////////////////
// //

View File

@@ -444,7 +444,7 @@ static int vxprintf(
for(idx=precision, rounder=0.4999; idx>0; idx--, rounder*=0.1); for(idx=precision, rounder=0.4999; idx>0; idx--, rounder*=0.1);
#else #else
/* It makes more sense to use 0.5 */ /* It makes more sense to use 0.5 */
for(idx=precision, rounder=0.5; idx>0; idx--, rounder*=0.1); for(idx=precision, rounder=0.5; idx>0; idx--, rounder*=0.1){}
#endif #endif
if( xtype==etFLOAT ) realvalue += rounder; if( xtype==etFLOAT ) realvalue += rounder;
/* Normalize realvalue to within 10.0 > realvalue >= 1.0 */ /* Normalize realvalue to within 10.0 > realvalue >= 1.0 */

View File

@@ -12,7 +12,7 @@
** This file contains C code routines that are called by the parser ** This file contains C code routines that are called by the parser
** to handle SELECT statements in SQLite. ** to handle SELECT statements in SQLite.
** **
** $Id: select.c,v 1.304 2006/02/10 07:07:16 danielk1977 Exp $ ** $Id: select.c,v 1.305 2006/02/24 02:53:50 drh Exp $
*/ */
#include "sqliteInt.h" #include "sqliteInt.h"
@@ -680,7 +680,6 @@ static KeyInfo *keyInfoFromExprList(Parse *pParse, ExprList *pList){
** routine generates the code needed to do that. ** routine generates the code needed to do that.
*/ */
static void generateSortTail( static void generateSortTail(
Parse *pParse, /* The parsing context */
Select *p, /* The SELECT statement */ Select *p, /* The SELECT statement */
Vdbe *v, /* Generate code into this VDBE */ Vdbe *v, /* Generate code into this VDBE */
int nColumn, /* Number of columns of data */ int nColumn, /* Number of columns of data */
@@ -1965,7 +1964,7 @@ static int multiSelect(
pKeyInfo->nField = nOrderByExpr; pKeyInfo->nField = nOrderByExpr;
sqlite3VdbeChangeP3(v, addr, (char*)pKeyInfo, P3_KEYINFO_HANDOFF); sqlite3VdbeChangeP3(v, addr, (char*)pKeyInfo, P3_KEYINFO_HANDOFF);
pKeyInfo = 0; pKeyInfo = 0;
generateSortTail(pParse, p, v, p->pEList->nExpr, eDest, iParm); generateSortTail(p, v, p->pEList->nExpr, eDest, iParm);
} }
sqliteFree(pKeyInfo); sqliteFree(pKeyInfo);
@@ -2117,7 +2116,6 @@ static void substSelect(Select *p, int iTable, ExprList *pEList){
** the subquery before this routine runs. ** the subquery before this routine runs.
*/ */
static int flattenSubquery( static int flattenSubquery(
Parse *pParse, /* The parsing context */
Select *p, /* The parent or outer SELECT statement */ Select *p, /* The parent or outer SELECT statement */
int iFrom, /* Index in p->pSrc->a[] of the inner subquery */ int iFrom, /* Index in p->pSrc->a[] of the inner subquery */
int isAgg, /* True if outer SELECT uses aggregate functions */ int isAgg, /* True if outer SELECT uses aggregate functions */
@@ -2902,7 +2900,7 @@ int sqlite3Select(
*/ */
#ifndef SQLITE_OMIT_VIEW #ifndef SQLITE_OMIT_VIEW
if( pParent && pParentAgg && if( pParent && pParentAgg &&
flattenSubquery(pParse, pParent, parentTab, *pParentAgg, isAgg) ){ flattenSubquery(pParent, parentTab, *pParentAgg, isAgg) ){
if( isAgg ) *pParentAgg = 1; if( isAgg ) *pParentAgg = 1;
goto select_end; goto select_end;
} }
@@ -3254,7 +3252,7 @@ int sqlite3Select(
** and send them to the callback one by one. ** and send them to the callback one by one.
*/ */
if( pOrderBy ){ if( pOrderBy ){
generateSortTail(pParse, p, v, pEList->nExpr, eDest, iParm); generateSortTail(p, v, pEList->nExpr, eDest, iParm);
} }
#ifndef SQLITE_OMIT_SUBQUERY #ifndef SQLITE_OMIT_SUBQUERY

View File

@@ -11,7 +11,7 @@
************************************************************************* *************************************************************************
** Internal interface definitions for SQLite. ** Internal interface definitions for SQLite.
** **
** @(#) $Id: sqliteInt.h,v 1.486 2006/02/17 15:01:36 danielk1977 Exp $ ** @(#) $Id: sqliteInt.h,v 1.487 2006/02/24 02:53:50 drh Exp $
*/ */
#ifndef _SQLITEINT_H_ #ifndef _SQLITEINT_H_
#define _SQLITEINT_H_ #define _SQLITEINT_H_
@@ -1519,7 +1519,7 @@ void sqlite3RollbackInternalChanges(sqlite3*);
void sqlite3CommitInternalChanges(sqlite3*); void sqlite3CommitInternalChanges(sqlite3*);
Table *sqlite3ResultSetOfSelect(Parse*,char*,Select*); Table *sqlite3ResultSetOfSelect(Parse*,char*,Select*);
void sqlite3OpenMasterTable(Parse *, int); void sqlite3OpenMasterTable(Parse *, int);
void sqlite3StartTable(Parse*,Token*,Token*,Token*,int,int,int); void sqlite3StartTable(Parse*,Token*,Token*,int,int,int);
void sqlite3AddColumn(Parse*,Token*); void sqlite3AddColumn(Parse*,Token*);
void sqlite3AddNotNull(Parse*, int); void sqlite3AddNotNull(Parse*, int);
void sqlite3AddPrimaryKey(Parse*, ExprList*, int, int, int); void sqlite3AddPrimaryKey(Parse*, ExprList*, int, int, int);
@@ -1575,7 +1575,7 @@ Table *sqlite3LocateTable(Parse*,const char*, const char*);
Index *sqlite3FindIndex(sqlite3*,const char*, const char*); Index *sqlite3FindIndex(sqlite3*,const char*, const char*);
void sqlite3UnlinkAndDeleteTable(sqlite3*,int,const char*); void sqlite3UnlinkAndDeleteTable(sqlite3*,int,const char*);
void sqlite3UnlinkAndDeleteIndex(sqlite3*,int,const char*); void sqlite3UnlinkAndDeleteIndex(sqlite3*,int,const char*);
void sqlite3Vacuum(Parse*, Token*); void sqlite3Vacuum(Parse*);
int sqlite3RunVacuum(char**, sqlite3*); int sqlite3RunVacuum(char**, sqlite3*);
char *sqlite3NameFromToken(Token*); char *sqlite3NameFromToken(Token*);
int sqlite3ExprCheck(Parse*, Expr*, int, int*); int sqlite3ExprCheck(Parse*, Expr*, int, int*);
@@ -1596,7 +1596,7 @@ int sqlite3ExprIsConstantOrFunction(Expr*);
int sqlite3ExprIsInteger(Expr*, int*); int sqlite3ExprIsInteger(Expr*, int*);
int sqlite3IsRowid(const char*); int sqlite3IsRowid(const char*);
void sqlite3GenerateRowDelete(sqlite3*, Vdbe*, Table*, int, int); void sqlite3GenerateRowDelete(sqlite3*, Vdbe*, Table*, int, int);
void sqlite3GenerateRowIndexDelete(sqlite3*, Vdbe*, Table*, int, char*); void sqlite3GenerateRowIndexDelete(Vdbe*, Table*, int, char*);
void sqlite3GenerateIndexKey(Vdbe*, Index*, int); void sqlite3GenerateIndexKey(Vdbe*, Index*, int);
void sqlite3GenerateConstraintChecks(Parse*,Table*,int,char*,int,int,int,int); void sqlite3GenerateConstraintChecks(Parse*,Table*,int,char*,int,int,int,int);
void sqlite3CompleteInsertion(Parse*, Table*, int, char*, int, int, int); void sqlite3CompleteInsertion(Parse*, Table*, int, char*, int, int, int);
@@ -1621,7 +1621,7 @@ void sqlite3ChangeCookie(sqlite3*, Vdbe*, int);
int,Expr*,int); int,Expr*,int);
void sqlite3FinishTrigger(Parse*, TriggerStep*, Token*); void sqlite3FinishTrigger(Parse*, TriggerStep*, Token*);
void sqlite3DropTrigger(Parse*, SrcList*); void sqlite3DropTrigger(Parse*, SrcList*);
void sqlite3DropTriggerPtr(Parse*, Trigger*, int); void sqlite3DropTriggerPtr(Parse*, Trigger*);
int sqlite3TriggersExist(Parse*, Table*, int, ExprList*); int sqlite3TriggersExist(Parse*, Table*, int, ExprList*);
int sqlite3CodeRowTrigger(Parse*, int, ExprList*, int, Table *, int, int, int sqlite3CodeRowTrigger(Parse*, int, ExprList*, int, Table *, int, int,
int, int); int, int);

View File

@@ -460,7 +460,7 @@ void sqlite3DropTrigger(Parse *pParse, SrcList *pName){
sqlite3ErrorMsg(pParse, "no such trigger: %S", pName, 0); sqlite3ErrorMsg(pParse, "no such trigger: %S", pName, 0);
goto drop_trigger_cleanup; goto drop_trigger_cleanup;
} }
sqlite3DropTriggerPtr(pParse, pTrigger, 0); sqlite3DropTriggerPtr(pParse, pTrigger);
drop_trigger_cleanup: drop_trigger_cleanup:
sqlite3SrcListDelete(pName); sqlite3SrcListDelete(pName);
@@ -470,18 +470,16 @@ drop_trigger_cleanup:
** Return a pointer to the Table structure for the table that a trigger ** Return a pointer to the Table structure for the table that a trigger
** is set on. ** is set on.
*/ */
static Table *tableOfTrigger(sqlite3 *db, Trigger *pTrigger){ static Table *tableOfTrigger(Trigger *pTrigger){
int n = strlen(pTrigger->table) + 1; int n = strlen(pTrigger->table) + 1;
return sqlite3HashFind(&pTrigger->pTabSchema->tblHash, pTrigger->table, n); return sqlite3HashFind(&pTrigger->pTabSchema->tblHash, pTrigger->table, n);
} }
/* /*
** Drop a trigger given a pointer to that trigger. If nested is false, ** Drop a trigger given a pointer to that trigger.
** then also generate code to remove the trigger from the SQLITE_MASTER
** table.
*/ */
void sqlite3DropTriggerPtr(Parse *pParse, Trigger *pTrigger, int nested){ void sqlite3DropTriggerPtr(Parse *pParse, Trigger *pTrigger){
Table *pTable; Table *pTable;
Vdbe *v; Vdbe *v;
sqlite3 *db = pParse->db; sqlite3 *db = pParse->db;
@@ -489,7 +487,7 @@ void sqlite3DropTriggerPtr(Parse *pParse, Trigger *pTrigger, int nested){
iDb = sqlite3SchemaToIndex(pParse->db, pTrigger->pSchema); iDb = sqlite3SchemaToIndex(pParse->db, pTrigger->pSchema);
assert( iDb>=0 && iDb<db->nDb ); assert( iDb>=0 && iDb<db->nDb );
pTable = tableOfTrigger(db, pTrigger); pTable = tableOfTrigger(pTrigger);
assert(pTable); assert(pTable);
assert( pTable->pSchema==pTrigger->pSchema || iDb==1 ); assert( pTable->pSchema==pTrigger->pSchema || iDb==1 );
#ifndef SQLITE_OMIT_AUTHORIZATION #ifndef SQLITE_OMIT_AUTHORIZATION
@@ -539,7 +537,7 @@ void sqlite3UnlinkAndDeleteTrigger(sqlite3 *db, int iDb, const char *zName){
int nName = strlen(zName); int nName = strlen(zName);
pTrigger = sqlite3HashInsert(&(db->aDb[iDb].pSchema->trigHash), zName, nName+1, 0); pTrigger = sqlite3HashInsert(&(db->aDb[iDb].pSchema->trigHash), zName, nName+1, 0);
if( pTrigger ){ if( pTrigger ){
Table *pTable = tableOfTrigger(db, pTrigger); Table *pTable = tableOfTrigger(pTrigger);
assert( pTable!=0 ); assert( pTable!=0 );
if( pTable->pTrigger == pTrigger ){ if( pTable->pTrigger == pTrigger ){
pTable->pTrigger = pTrigger->pNext; pTable->pTrigger = pTrigger->pNext;
@@ -761,7 +759,7 @@ int sqlite3CodeRowTrigger(
(op!=TK_UPDATE||!p->pColumns||checkColumnOverLap(p->pColumns,pChanges)) (op!=TK_UPDATE||!p->pColumns||checkColumnOverLap(p->pColumns,pChanges))
){ ){
TriggerStack *pS; /* Pointer to trigger-stack entry */ TriggerStack *pS; /* Pointer to trigger-stack entry */
for(pS=pParse->trigStack; pS && p!=pS->pTrigger; pS=pS->pNext); for(pS=pParse->trigStack; pS && p!=pS->pTrigger; pS=pS->pNext){}
if( !pS ){ if( !pS ){
fire_this = 1; fire_this = 1;
} }

View File

@@ -12,7 +12,7 @@
** This file contains C code routines that are called by the parser ** This file contains C code routines that are called by the parser
** to handle UPDATE statements. ** to handle UPDATE statements.
** **
** $Id: update.c,v 1.122 2006/02/10 02:27:43 danielk1977 Exp $ ** $Id: update.c,v 1.123 2006/02/24 02:53:50 drh Exp $
*/ */
#include "sqliteInt.h" #include "sqliteInt.h"
@@ -431,7 +431,7 @@ void sqlite3Update(
/* Delete the old indices for the current record. /* Delete the old indices for the current record.
*/ */
sqlite3GenerateRowIndexDelete(db, v, pTab, iCur, aIdxUsed); sqlite3GenerateRowIndexDelete(v, pTab, iCur, aIdxUsed);
/* If changing the record number, delete the old record. /* If changing the record number, delete the old record.
*/ */

View File

@@ -12,7 +12,7 @@
** This file contains routines used to translate between UTF-8, ** This file contains routines used to translate between UTF-8,
** UTF-16, UTF-16BE, and UTF-16LE. ** UTF-16, UTF-16BE, and UTF-16LE.
** **
** $Id: utf.c,v 1.37 2006/01/24 10:58:22 danielk1977 Exp $ ** $Id: utf.c,v 1.38 2006/02/24 02:53:50 drh Exp $
** **
** Notes on UTF-8: ** Notes on UTF-8:
** **
@@ -255,7 +255,7 @@ int sqlite3VdbeMemTranslate(Mem *pMem, u8 desiredEnc){
#if defined(TRANSLATE_TRACE) && defined(SQLITE_DEBUG) #if defined(TRANSLATE_TRACE) && defined(SQLITE_DEBUG)
{ {
char zBuf[100]; char zBuf[100];
sqlite3VdbeMemPrettyPrint(pMem, zBuf, 100); sqlite3VdbeMemPrettyPrint(pMem, zBuf);
fprintf(stderr, "INPUT: %s\n", zBuf); fprintf(stderr, "INPUT: %s\n", zBuf);
} }
#endif #endif
@@ -371,7 +371,7 @@ translate_out:
#if defined(TRANSLATE_TRACE) && defined(SQLITE_DEBUG) #if defined(TRANSLATE_TRACE) && defined(SQLITE_DEBUG)
{ {
char zBuf[100]; char zBuf[100];
sqlite3VdbeMemPrettyPrint(pMem, zBuf, 100); sqlite3VdbeMemPrettyPrint(pMem, zBuf);
fprintf(stderr, "OUTPUT: %s\n", zBuf); fprintf(stderr, "OUTPUT: %s\n", zBuf);
} }
#endif #endif

View File

@@ -14,7 +14,7 @@
** This file contains functions for allocating memory, comparing ** This file contains functions for allocating memory, comparing
** strings, and stuff like that. ** strings, and stuff like that.
** **
** $Id: util.c,v 1.185 2006/02/14 10:48:39 danielk1977 Exp $ ** $Id: util.c,v 1.186 2006/02/24 02:53:50 drh Exp $
*/ */
#include "sqliteInt.h" #include "sqliteInt.h"
#include "os.h" #include "os.h"
@@ -547,7 +547,7 @@ static int enforceSoftLimit(int n){
} }
assert( pTsd->nAlloc>=0 ); assert( pTsd->nAlloc>=0 );
if( n>0 && pTsd->nSoftHeapLimit>0 ){ if( n>0 && pTsd->nSoftHeapLimit>0 ){
while( pTsd->nAlloc+n>pTsd->nSoftHeapLimit && sqlite3_release_memory(n) ); while( pTsd->nAlloc+n>pTsd->nSoftHeapLimit && sqlite3_release_memory(n) ){}
} }
return 1; return 1;
} }
@@ -586,7 +586,7 @@ static void updateMemoryUsedCount(int n){
void *sqlite3MallocRaw(int n, int doMemManage){ void *sqlite3MallocRaw(int n, int doMemManage){
void *p = 0; void *p = 0;
if( n>0 && !sqlite3MallocFailed() && (!doMemManage || enforceSoftLimit(n)) ){ if( n>0 && !sqlite3MallocFailed() && (!doMemManage || enforceSoftLimit(n)) ){
while( (p = OSMALLOC(n))==0 && sqlite3_release_memory(n) ); while( (p = OSMALLOC(n))==0 && sqlite3_release_memory(n) ){}
if( !p ){ if( !p ){
sqlite3FailedMalloc(); sqlite3FailedMalloc();
OSMALLOC_FAILED(); OSMALLOC_FAILED();
@@ -615,7 +615,7 @@ void *sqlite3Realloc(void *p, int n){
int origSize = OSSIZEOF(p); int origSize = OSSIZEOF(p);
#endif #endif
if( enforceSoftLimit(n - origSize) ){ if( enforceSoftLimit(n - origSize) ){
while( (np = OSREALLOC(p, n))==0 && sqlite3_release_memory(n) ); while( (np = OSREALLOC(p, n))==0 && sqlite3_release_memory(n) ){}
if( !np ){ if( !np ){
sqlite3FailedMalloc(); sqlite3FailedMalloc();
OSMALLOC_FAILED(); OSMALLOC_FAILED();

View File

@@ -14,7 +14,7 @@
** Most of the code in this file may be omitted by defining the ** Most of the code in this file may be omitted by defining the
** SQLITE_OMIT_VACUUM macro. ** SQLITE_OMIT_VACUUM macro.
** **
** $Id: vacuum.c,v 1.58 2006/01/18 16:51:36 danielk1977 Exp $ ** $Id: vacuum.c,v 1.59 2006/02/24 02:53:50 drh Exp $
*/ */
#include "sqliteInt.h" #include "sqliteInt.h"
#include "vdbeInt.h" #include "vdbeInt.h"
@@ -43,7 +43,7 @@ static int execSql(sqlite3 *db, const char *zSql){
if( SQLITE_OK!=sqlite3_prepare(db, zSql, -1, &pStmt, 0) ){ if( SQLITE_OK!=sqlite3_prepare(db, zSql, -1, &pStmt, 0) ){
return sqlite3_errcode(db); return sqlite3_errcode(db);
} }
while( SQLITE_ROW==sqlite3_step(pStmt) ); while( SQLITE_ROW==sqlite3_step(pStmt) ){}
return sqlite3_finalize(pStmt); return sqlite3_finalize(pStmt);
} }
@@ -81,7 +81,7 @@ static int execExecSql(sqlite3 *db, const char *zSql){
** with 2.0.0, SQLite no longer uses GDBM so this command has ** with 2.0.0, SQLite no longer uses GDBM so this command has
** become a no-op. ** become a no-op.
*/ */
void sqlite3Vacuum(Parse *pParse, Token *pTableName){ void sqlite3Vacuum(Parse *pParse){
Vdbe *v = sqlite3GetVdbe(pParse); Vdbe *v = sqlite3GetVdbe(pParse);
if( v ){ if( v ){
sqlite3VdbeAddOp(v, OP_Vacuum, 0, 0); sqlite3VdbeAddOp(v, OP_Vacuum, 0, 0);

View File

@@ -43,7 +43,7 @@
** in this file for details. If in doubt, do not deviate from existing ** in this file for details. If in doubt, do not deviate from existing
** commenting and indentation practices when changing or adding code. ** commenting and indentation practices when changing or adding code.
** **
** $Id: vdbe.c,v 1.543 2006/02/10 14:02:07 drh Exp $ ** $Id: vdbe.c,v 1.544 2006/02/24 02:53:50 drh Exp $
*/ */
#include "sqliteInt.h" #include "sqliteInt.h"
#include "os.h" #include "os.h"
@@ -280,7 +280,7 @@ void sqlite3ValueApplyAffinity(sqlite3_value *pVal, u8 affinity, u8 enc){
** Write a nice string representation of the contents of cell pMem ** Write a nice string representation of the contents of cell pMem
** into buffer zBuf, length nBuf. ** into buffer zBuf, length nBuf.
*/ */
void sqlite3VdbeMemPrettyPrint(Mem *pMem, char *zBuf, int nBuf){ void sqlite3VdbeMemPrettyPrint(Mem *pMem, char *zBuf){
char *zCsr = zBuf; char *zCsr = zBuf;
int f = pMem->flags; int f = pMem->flags;
@@ -3013,7 +3013,7 @@ case OP_IsUnique: { /* no-push */
zKey = pNos->z; zKey = pNos->z;
nKey = pNos->n; nKey = pNos->n;
szRowid = sqlite3VdbeIdxRowidLen(nKey, (u8*)zKey); szRowid = sqlite3VdbeIdxRowidLen((u8*)zKey);
len = nKey-szRowid; len = nKey-szRowid;
/* Search for an entry in P1 where all but the last four bytes match K. /* Search for an entry in P1 where all but the last four bytes match K.
@@ -4600,7 +4600,7 @@ default: {
#ifndef NDEBUG #ifndef NDEBUG
/* Sanity checking on the top element of the stack */ /* Sanity checking on the top element of the stack */
if( pTos>=p->aStack ){ if( pTos>=p->aStack ){
sqlite3VdbeMemSanity(pTos, encoding); sqlite3VdbeMemSanity(pTos);
} }
assert( pc>=-1 && pc<p->nOp ); assert( pc>=-1 && pc<p->nOp );
#ifdef SQLITE_DEBUG #ifdef SQLITE_DEBUG
@@ -4619,7 +4619,7 @@ default: {
fprintf(p->trace, " r:%g", pTos[i].r); fprintf(p->trace, " r:%g", pTos[i].r);
}else{ }else{
char zBuf[100]; char zBuf[100];
sqlite3VdbeMemPrettyPrint(&pTos[i], zBuf, 100); sqlite3VdbeMemPrettyPrint(&pTos[i], zBuf);
fprintf(p->trace, " "); fprintf(p->trace, " ");
fprintf(p->trace, "%s", zBuf); fprintf(p->trace, "%s", zBuf);
} }

View File

@@ -350,7 +350,7 @@ int sqlite3VdbeIdxKeyCompare(Cursor*, int , const unsigned char*, int*);
int sqlite3VdbeIdxRowid(BtCursor *, i64 *); int sqlite3VdbeIdxRowid(BtCursor *, i64 *);
int sqlite3MemCompare(const Mem*, const Mem*, const CollSeq*); int sqlite3MemCompare(const Mem*, const Mem*, const CollSeq*);
int sqlite3VdbeRecordCompare(void*,int,const void*,int, const void*); int sqlite3VdbeRecordCompare(void*,int,const void*,int, const void*);
int sqlite3VdbeIdxRowidLen(int,const u8*); int sqlite3VdbeIdxRowidLen(const u8*);
int sqlite3VdbeExec(Vdbe*); int sqlite3VdbeExec(Vdbe*);
int sqlite3VdbeList(Vdbe*); int sqlite3VdbeList(Vdbe*);
int sqlite3VdbeHalt(Vdbe*); int sqlite3VdbeHalt(Vdbe*);
@@ -376,11 +376,11 @@ int sqlite3VdbeMemFromBtree(BtCursor*,int,int,int,Mem*);
void sqlite3VdbeMemRelease(Mem *p); void sqlite3VdbeMemRelease(Mem *p);
int sqlite3VdbeMemFinalize(Mem*, FuncDef*); int sqlite3VdbeMemFinalize(Mem*, FuncDef*);
#ifndef NDEBUG #ifndef NDEBUG
void sqlite3VdbeMemSanity(Mem*, u8); void sqlite3VdbeMemSanity(Mem*);
int sqlite3VdbeOpcodeNoPush(u8); int sqlite3VdbeOpcodeNoPush(u8);
#endif #endif
int sqlite3VdbeMemTranslate(Mem*, u8); int sqlite3VdbeMemTranslate(Mem*, u8);
void sqlite3VdbeMemPrettyPrint(Mem *pMem, char *zBuf, int nBuf); void sqlite3VdbeMemPrettyPrint(Mem *pMem, char *zBuf);
int sqlite3VdbeMemHandleBom(Mem *pMem); int sqlite3VdbeMemHandleBom(Mem *pMem);
void sqlite3VdbeFifoInit(Fifo*); void sqlite3VdbeFifoInit(Fifo*);
int sqlite3VdbeFifoPush(Fifo*, i64); int sqlite3VdbeFifoPush(Fifo*, i64);

View File

@@ -1841,7 +1841,7 @@ int sqlite3VdbeRecordCompare(
** an integer rowid). This routine returns the number of bytes in ** an integer rowid). This routine returns the number of bytes in
** that integer. ** that integer.
*/ */
int sqlite3VdbeIdxRowidLen(int nKey, const u8 *aKey){ int sqlite3VdbeIdxRowidLen(const u8 *aKey){
u32 szHdr; /* Size of the header */ u32 szHdr; /* Size of the header */
u32 typeRowid; /* Serial type of the rowid */ u32 typeRowid; /* Serial type of the rowid */
@@ -1911,7 +1911,7 @@ int sqlite3VdbeIdxKeyCompare(
if( rc ){ if( rc ){
return rc; return rc;
} }
lenRowid = sqlite3VdbeIdxRowidLen(m.n, (u8*)m.z); lenRowid = sqlite3VdbeIdxRowidLen((u8*)m.z);
*res = sqlite3VdbeRecordCompare(pC->pKeyInfo, m.n-lenRowid, m.z, nKey, pKey); *res = sqlite3VdbeRecordCompare(pC->pKeyInfo, m.n-lenRowid, m.z, nKey, pKey);
sqlite3VdbeMemRelease(&m); sqlite3VdbeMemRelease(&m);
return SQLITE_OK; return SQLITE_OK;

View File

@@ -711,7 +711,7 @@ int sqlite3VdbeMemFromBtree(
** Perform various checks on the memory cell pMem. An assert() will ** Perform various checks on the memory cell pMem. An assert() will
** fail if pMem is internally inconsistent. ** fail if pMem is internally inconsistent.
*/ */
void sqlite3VdbeMemSanity(Mem *pMem, u8 db_enc){ void sqlite3VdbeMemSanity(Mem *pMem){
int flags = pMem->flags; int flags = pMem->flags;
assert( flags!=0 ); /* Must define some type */ assert( flags!=0 ); /* Must define some type */
if( pMem->flags & (MEM_Str|MEM_Blob) ){ if( pMem->flags & (MEM_Str|MEM_Blob) ){

View File

@@ -16,7 +16,7 @@
** so is applicable. Because this module is responsible for selecting ** so is applicable. Because this module is responsible for selecting
** indices, you might also think of this module as the "query optimizer". ** indices, you might also think of this module as the "query optimizer".
** **
** $Id: where.c,v 1.204 2006/02/01 02:45:02 drh Exp $ ** $Id: where.c,v 1.205 2006/02/24 02:53:51 drh Exp $
*/ */
#include "sqliteInt.h" #include "sqliteInt.h"
@@ -771,8 +771,7 @@ or_not_possible:
static int isSortingIndex( static int isSortingIndex(
Parse *pParse, /* Parsing context */ Parse *pParse, /* Parsing context */
Index *pIdx, /* The index we are testing */ Index *pIdx, /* The index we are testing */
Table *pTab, /* The table to be sorted */ int base, /* Cursor number for the table to be sorted */
int base, /* Cursor number for pTab */
ExprList *pOrderBy, /* The ORDER BY clause */ ExprList *pOrderBy, /* The ORDER BY clause */
int nEqCol, /* Number of index columns with == constraints */ int nEqCol, /* Number of index columns with == constraints */
int *pbRev /* Set to 1 if ORDER BY is DESC */ int *pbRev /* Set to 1 if ORDER BY is DESC */
@@ -1057,7 +1056,7 @@ static double bestIndex(
*/ */
if( pOrderBy ){ if( pOrderBy ){
if( (flags & WHERE_COLUMN_IN)==0 && if( (flags & WHERE_COLUMN_IN)==0 &&
isSortingIndex(pParse,pProbe,pSrc->pTab,iCur,pOrderBy,nEq,&rev) ){ isSortingIndex(pParse,pProbe,iCur,pOrderBy,nEq,&rev) ){
if( flags==0 ){ if( flags==0 ){
flags = WHERE_COLUMN_RANGE; flags = WHERE_COLUMN_RANGE;
} }
@@ -1591,7 +1590,7 @@ WhereInfo *sqlite3WhereBegin(
if( pTab->nCol<(sizeof(Bitmask)*8) ){ if( pTab->nCol<(sizeof(Bitmask)*8) ){
Bitmask b = pTabItem->colUsed; Bitmask b = pTabItem->colUsed;
int n = 0; int n = 0;
for(; b; b=b>>1, n++); for(; b; b=b>>1, n++){}
sqlite3VdbeChangeP2(v, sqlite3VdbeCurrentAddr(v)-1, n); sqlite3VdbeChangeP2(v, sqlite3VdbeCurrentAddr(v)-1, n);
assert( n<=pTab->nCol ); assert( n<=pTab->nCol );
} }