Index: src/build.c ================================================================== --- src/build.c +++ src/build.c @@ -20,11 +20,11 @@ ** creating ID lists ** BEGIN TRANSACTION ** COMMIT ** ROLLBACK ** -** $Id: build.c,v 1.531 2009/04/24 18:06:09 danielk1977 Exp $ +** $Id: build.c,v 1.532 2009/04/28 13:01:09 drh Exp $ */ #include "sqliteInt.h" /* ** This routine is called when a new SQL statement is beginning to @@ -259,11 +259,11 @@ Table *sqlite3FindTable(sqlite3 *db, const char *zName, const char *zDatabase){ Table *p = 0; int i; int nName; assert( zName!=0 ); - nName = sqlite3Strlen(db, zName) + 1; + nName = sqlite3Strlen(db, zName); for(i=OMIT_TEMPDB; inDb; i++){ int j = (i<2) ? i^1 : i; /* Search TEMP before MAIN */ if( zDatabase!=0 && sqlite3StrICmp(zDatabase, db->aDb[j].zName) ) continue; p = sqlite3HashFind(&db->aDb[j].pSchema->tblHash, zName, nName); if( p ) break; @@ -321,11 +321,11 @@ ** using the ATTACH command. */ Index *sqlite3FindIndex(sqlite3 *db, const char *zName, const char *zDb){ Index *p = 0; int i; - int nName = sqlite3Strlen(db, zName)+1; + int nName = sqlite3Strlen(db, zName); for(i=OMIT_TEMPDB; inDb; i++){ int j = (i<2) ? i^1 : i; /* Search TEMP before MAIN */ Schema *pSchema = db->aDb[j].pSchema; if( zDb && sqlite3StrICmp(zDb, db->aDb[j].zName) ) continue; assert( pSchema || (j==1 && !db->aDb[1].pBt) ); @@ -357,11 +357,11 @@ static void sqlite3DeleteIndex(Index *p){ Index *pOld; const char *zName = p->zName; pOld = sqlite3HashInsert(&p->pSchema->idxHash, zName, - sqlite3Strlen30(zName)+1, 0); + sqlite3Strlen30(zName), 0); assert( pOld==0 || pOld==p ); freeIndex(p); } /* @@ -374,11 +374,11 @@ Index *pIndex; int len; Hash *pHash = &db->aDb[iDb].pSchema->idxHash; len = sqlite3Strlen(db, zIdxName); - pIndex = sqlite3HashInsert(pHash, zIdxName, len+1, 0); + pIndex = sqlite3HashInsert(pHash, zIdxName, len, 0); if( pIndex ){ if( pIndex->pTable->pIndex==pIndex ){ pIndex->pTable->pIndex = pIndex->pNext; }else{ Index *p; @@ -522,11 +522,11 @@ ** should have already been unlinked from the pSchema->aFKey hash table */ for(pFKey=pTable->pFKey; pFKey; pFKey=pNextFKey){ pNextFKey = pFKey->pNextFrom; assert( sqlite3HashFind(&pTable->pSchema->aFKey, - pFKey->zTo, sqlite3Strlen30(pFKey->zTo)+1)!=pFKey ); + pFKey->zTo, sqlite3Strlen30(pFKey->zTo))!=pFKey ); sqlite3DbFree(db, pFKey); } #endif /* Delete the Table structure itself. @@ -554,15 +554,15 @@ assert( db!=0 ); assert( iDb>=0 && iDbnDb ); assert( zTabName && zTabName[0] ); pDb = &db->aDb[iDb]; p = sqlite3HashInsert(&pDb->pSchema->tblHash, zTabName, - sqlite3Strlen30(zTabName)+1,0); + sqlite3Strlen30(zTabName),0); if( p ){ #ifndef SQLITE_OMIT_FOREIGN_KEY for(pF1=p->pFKey; pF1; pF1=pF1->pNextFrom){ - int nTo = sqlite3Strlen30(pF1->zTo) + 1; + int nTo = sqlite3Strlen30(pF1->zTo); pF2 = sqlite3HashFind(&pDb->pSchema->aFKey, pF1->zTo, nTo); if( pF2==pF1 ){ sqlite3HashInsert(&pDb->pSchema->aFKey, pF1->zTo, nTo, pF1->pNextTo); }else{ while( pF2 && pF2->pNextTo!=pF1 ){ pF2=pF2->pNextTo; } @@ -1686,20 +1686,20 @@ if( db->init.busy && pParse->nErr==0 ){ Table *pOld; FKey *pFKey; Schema *pSchema = p->pSchema; pOld = sqlite3HashInsert(&pSchema->tblHash, p->zName, - sqlite3Strlen30(p->zName)+1,p); + sqlite3Strlen30(p->zName),p); if( pOld ){ assert( p==pOld ); /* Malloc must have failed inside HashInsert() */ db->mallocFailed = 1; return; } #ifndef SQLITE_OMIT_FOREIGN_KEY for(pFKey=p->pFKey; pFKey; pFKey=pFKey->pNextFrom){ void *data; - int nTo = sqlite3Strlen30(pFKey->zTo) + 1; + int nTo = sqlite3Strlen30(pFKey->zTo); pFKey->pNextTo = sqlite3HashFind(&pSchema->aFKey, pFKey->zTo, nTo); data = sqlite3HashInsert(&pSchema->aFKey, pFKey->zTo, nTo, pFKey); if( data==(void *)pFKey ){ db->mallocFailed = 1; } @@ -2740,11 +2740,11 @@ ** in-memory database structures. */ if( db->init.busy ){ Index *p; p = sqlite3HashInsert(&pIndex->pSchema->idxHash, - pIndex->zName, sqlite3Strlen30(pIndex->zName)+1, + pIndex->zName, sqlite3Strlen30(pIndex->zName), pIndex); if( p ){ assert( p==pIndex ); /* Malloc must have failed */ db->mallocFailed = 1; goto exit_create_index; Index: src/hash.c ================================================================== --- src/hash.c +++ src/hash.c @@ -10,11 +10,11 @@ ** ************************************************************************* ** This is the implementation of generic hash-tables ** used in SQLite. ** -** $Id: hash.c,v 1.33 2009/01/09 01:12:28 drh Exp $ +** $Id: hash.c,v 1.34 2009/04/28 13:01:09 drh Exp $ */ #include "sqliteInt.h" #include /* Turn bulk memory into a hash table object by initializing the @@ -61,11 +61,11 @@ ** Hash and comparison functions when the mode is SQLITE_HASH_STRING */ static int strHash(const void *pKey, int nKey){ const char *z = (const char *)pKey; int h = 0; - if( nKey<=0 ) nKey = sqlite3Strlen30(z); + assert( nKey>0 ); while( nKey > 0 ){ h = (h<<3) ^ h ^ sqlite3UpperToLower[(unsigned char)*z++]; nKey--; } return h & 0x7fffffff; Index: src/test_async.c ================================================================== --- src/test_async.c +++ src/test_async.c @@ -8,11 +8,11 @@ ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** -** $Id: test_async.c,v 1.61 2009/04/25 08:39:15 danielk1977 Exp $ +** $Id: test_async.c,v 1.62 2009/04/28 13:01:09 drh Exp $ ** ** This file contains a binding of the asynchronous IO extension interface ** (defined in ext/async/sqlite3async.h) to Tcl. */ @@ -238,6 +238,5 @@ Tcl_CreateObjCommand(interp,"sqlite3async_initialize",testAsyncInit,0,0); Tcl_CreateObjCommand(interp,"sqlite3async_shutdown",testAsyncShutdown,0,0); #endif /* SQLITE_ENABLE_ASYNCIO */ return TCL_OK; } - Index: src/trigger.c ================================================================== --- src/trigger.c +++ src/trigger.c @@ -8,11 +8,11 @@ ** May you share freely, never taking more than you give. ** ************************************************************************* ** ** -** $Id: trigger.c,v 1.136 2009/04/23 13:22:44 drh Exp $ +** $Id: trigger.c,v 1.137 2009/04/28 13:01:09 drh Exp $ */ #include "sqliteInt.h" #ifndef SQLITE_OMIT_TRIGGER /* @@ -283,11 +283,11 @@ pTrig = sqlite3HashInsert(pHash, zName, sqlite3Strlen30(zName), pTrig); if( pTrig ){ db->mallocFailed = 1; }else if( pLink->pSchema==pLink->pTabSchema ){ Table *pTab; - int n = sqlite3Strlen30(pLink->table) + 1; + int n = sqlite3Strlen30(pLink->table); pTab = sqlite3HashFind(&pLink->pTabSchema->tblHash, pLink->table, n); assert( pTab!=0 ); pLink->pNext = pTab->pTrigger; pTab->pTrigger = pLink; } @@ -510,11 +510,11 @@ /* ** Return a pointer to the Table structure for the table that a trigger ** is set on. */ static Table *tableOfTrigger(Trigger *pTrigger){ - int n = sqlite3Strlen30(pTrigger->table) + 1; + int n = sqlite3Strlen30(pTrigger->table); return sqlite3HashFind(&pTrigger->pTabSchema->tblHash, pTrigger->table, n); } /* Index: src/vtab.c ================================================================== --- src/vtab.c +++ src/vtab.c @@ -9,11 +9,11 @@ ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains code used to help implement virtual tables. ** -** $Id: vtab.c,v 1.85 2009/04/11 16:27:20 drh Exp $ +** $Id: vtab.c,v 1.86 2009/04/28 13:01:09 drh Exp $ */ #ifndef SQLITE_OMIT_VIRTUALTABLE #include "sqliteInt.h" /* @@ -306,11 +306,11 @@ */ else { Table *pOld; Schema *pSchema = pTab->pSchema; const char *zName = pTab->zName; - int nName = sqlite3Strlen30(zName) + 1; + int nName = sqlite3Strlen30(zName); pOld = sqlite3HashInsert(&pSchema->tblHash, zName, nName, pTab); if( pOld ){ db->mallocFailed = 1; assert( pTab==pOld ); /* Malloc must have failed inside HashInsert() */ return;