From e946c3966ab7b6b4e205356685c382be1fd45057 Mon Sep 17 00:00:00 2001 From: dan Date: Sat, 22 Aug 2009 11:39:46 +0000 Subject: [PATCH 01/14] Fix a problem in os_unix.c where a malloc failure could lead to a leaked file descriptor. FossilOrigin-Name: aa6acfa8caa2ef59b4c16dfe42c4b5644da96905 --- manifest | 14 +-- manifest.uuid | 2 +- src/os_unix.c | 237 +++++++++++++++++++++++++++------------------- test/tkt4018.test | 2 +- 4 files changed, 149 insertions(+), 106 deletions(-) diff --git a/manifest b/manifest index 33fdd10b13..4780014aec 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C When\sa\sdatabase\sfile\sis\sopened,\stry\sto\sfind\san\sunused\sfile\sdescriptor\sto\sreuse.\s\sThis\schange\saffects\sunix\s(and\sother\ssystems\sthat\suse\sos_unix.c)\sonly.\sFix\sfor\scvstrac\sticket\s[http://www.sqlite.org/cvstrac/tktview?tn=4018|#4018]. -D 2009-08-21T17:18:03 +C Fix\sa\sproblem\sin\sos_unix.c\swhere\sa\smalloc\sfailure\scould\slead\sto\sa\sleaked\sfile\sdescriptor. +D 2009-08-22T11:39:47 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in 73ddeec9dd10b85876c5c2ce1fdce627e1dcc7f8 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -145,7 +145,7 @@ F src/os.c 9fea283e336ee31caa4654d6cb05a129a1c42d2f F src/os.h 00a1334a4eecee7f7bef79ac606b88d325119f21 F src/os_common.h 8c61457df58f1a4bd5f5adc3e90e01b37bf7afbc F src/os_os2.c bed77dc26e3a95ce4a204936b9a1ca6fe612fcc5 -F src/os_unix.c 1546de71b888c9a2bb0589d04e7e4267d40ef944 +F src/os_unix.c f151f27d353bf4240896d9a1386e5d59102a3cba F src/os_win.c 58bb163f327e79726dd119344d908e4d98483c3f F src/pager.c a47be286477ed6c7b9a342dd53d4e4043f29d8c2 F src/pager.h 11852d044c86cf5a9d6e34171fb0c4fcf1f6265f @@ -664,7 +664,7 @@ F test/tkt3929.test 6a4c3baefb4e75127356b7d675b5df42c35c00d1 F test/tkt3935.test e15261fedb9e30a4305a311da614a5d8e693c767 F test/tkt3992.test c193b9643b1c25d020c503a986d5e4089e65c530 F test/tkt3997.test a335fa41ca3985660a139df7b734a26ef53284bd -F test/tkt4018.test f581cf52dc359171875cb649bdc38b525d7b9309 +F test/tkt4018.test 7c2c9ba4df489c676a0a7a0e809a1fb9b2185bd1 F test/tokenize.test ce430a7aed48fc98301611429595883fdfcab5d7 F test/trace.test 19ffbc09885c3321d56358a5738feae8587fb377 F test/trans.test d887cb07630dc39879a322d958ad8b006137485c @@ -748,7 +748,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/vdbe-compress.tcl 672f81d693a03f80f5ae60bfefacd8a349e76746 -P 75f596a04a74eb3a538c7be5b41756c970a21a1b -R a2800e2c5932867798528426b058f0c9 +P 9b4d9ab62d687289837b13b07885e72cc3abe8a9 +R cdd26bf118eaa2a9465bbbd01490d6db U dan -Z 0551703c5a252ef4437a61cdae64c5ea +Z 37f9fc37ad160151ec2e7b69ade6b18c diff --git a/manifest.uuid b/manifest.uuid index 9e75b69c40..c61f045d08 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -9b4d9ab62d687289837b13b07885e72cc3abe8a9 \ No newline at end of file +aa6acfa8caa2ef59b4c16dfe42c4b5644da96905 \ No newline at end of file diff --git a/src/os_unix.c b/src/os_unix.c index 458c90e8f7..99312604ad 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -167,6 +167,19 @@ #define IS_LOCK_ERROR(x) ((x != SQLITE_OK) && (x != SQLITE_BUSY)) +/* +** Sometimes, after a file handle is closed by SQLite, the file descriptor +** cannot be closed immediately. In these cases, instances of the following +** structure are used to store the file descriptor while waiting for an +** opportunity to either close or reuse it. +*/ +typedef struct UnixUnusedFd UnixUnusedFd; +struct UnixUnusedFd { + int fd; /* File descriptor to close */ + int flags; /* Flags this file descriptor was opened with */ + UnixUnusedFd *pNext; /* Next unused file descriptor on same file */ +}; + /* ** The unixFile structure is subclass of sqlite3_file specific to the unix ** VFS implementations. @@ -181,7 +194,7 @@ struct unixFile { unsigned char locktype; /* The type of lock held on this fd */ int lastErrno; /* The unix errno from the last I/O error */ void *lockingContext; /* Locking style specific state */ - int flags; /* Flags value returned by xOpen() */ + UnixUnusedFd *pUnused; /* Pre-allocated UnixUnusedFd */ #if SQLITE_ENABLE_LOCKING_STYLE int openFlags; /* The flags specified at open() */ #endif @@ -748,11 +761,7 @@ struct unixOpenCnt { struct unixFileId fileId; /* The lookup key */ int nRef; /* Number of pointers to this structure */ int nLock; /* Number of outstanding locks */ - int nPending; /* Number of pending close() operations */ - struct PendingClose { - int fd; /* File descriptor to close */ - int flags; /* Flags this file descriptor was opened with */ - } *aPending; /* Malloced space holding fds awaiting close() */ + UnixUnusedFd *pUnused; /* Unused file descriptors to close */ #if OS_VXWORKS sem_t *pSem; /* Named POSIX semaphore */ char aSemName[MAX_PATHNAME+1]; /* Name of that semaphore */ @@ -910,7 +919,7 @@ static void releaseOpenCnt(struct unixOpenCnt *pOpen){ assert( pOpen->pNext->pPrev==pOpen ); pOpen->pNext->pPrev = pOpen->pPrev; } - sqlite3_free(pOpen->aPending); + assert( !pOpen->pUnused ); sqlite3_free(pOpen); } } @@ -1028,19 +1037,12 @@ static int findLockInfo( rc = SQLITE_NOMEM; goto exit_findlockinfo; } + memset(pOpen, 0, sizeof(*pOpen)); pOpen->fileId = fileId; pOpen->nRef = 1; - pOpen->nLock = 0; - pOpen->nPending = 0; - pOpen->aPending = 0; pOpen->pNext = openList; - pOpen->pPrev = 0; if( openList ) openList->pPrev = pOpen; openList = pOpen; -#if OS_VXWORKS - pOpen->pSem = NULL; - pOpen->aSemName[0] = '\0'; -#endif }else{ pOpen->nRef++; } @@ -1405,57 +1407,47 @@ end_lock: } /* -** Close all file descriptors accumuated in the p->aPending[] array. If -** all such file descriptors are closed without error, the aPending[] -** array is deleted and SQLITE_OK returned. +** Close all file descriptors accumuated in the unixOpenCnt->pUnused list. +** If all such file descriptors are closed without error, the list is +** cleared and SQLITE_OK returned. ** ** Otherwise, if an error occurs, then successfully closed file descriptor -** entries in the aPending[] array are set to -1, the aPending[] array +** entries are removed from the list, and SQLITE_IOERR_CLOSE returned. ** not deleted and SQLITE_IOERR_CLOSE returned. */ static int closePendingFds(unixFile *pFile){ - struct unixOpenCnt *pOpen = pFile->pOpen; - struct PendingClose *aPending = pOpen->aPending; - int i; int rc = SQLITE_OK; - assert( unixMutexHeld() ); - for(i=0; inPending; i++){ - if( aPending[i].fd>=0 ){ - if( close(aPending[i].fd) ){ - pFile->lastErrno = errno; - rc = SQLITE_IOERR_CLOSE; - }else{ - aPending[i].fd = -1; - } + struct unixOpenCnt *pOpen = pFile->pOpen; + UnixUnusedFd *pError = 0; + UnixUnusedFd *p; + UnixUnusedFd *pNext; + for(p=pOpen->pUnused; p; p=pNext){ + pNext = p->pNext; + if( close(p->fd) ){ + pFile->lastErrno = errno; + rc = SQLITE_IOERR_CLOSE; + p->pNext = pError; + pError = p; + assert(0); + }else{ + sqlite3_free(p); } } - if( rc==SQLITE_OK ){ - sqlite3_free(aPending); - pOpen->nPending = 0; - pOpen->aPending = 0; - } + pOpen->pUnused = pError; return rc; } /* ** Add the file descriptor used by file handle pFile to the corresponding -** aPending[] array to be closed after some other connection releases -** a lock. +** pUnused list. */ static void setPendingFd(unixFile *pFile){ - struct PendingClose *aNew; struct unixOpenCnt *pOpen = pFile->pOpen; - int nByte = (pOpen->nPending+1)*sizeof(pOpen->aPending[0]); - aNew = sqlite3_realloc(pOpen->aPending, nByte); - if( aNew==0 ){ - /* If a malloc fails, just leak the file descriptor */ - }else{ - pOpen->aPending = aNew; - pOpen->aPending[pOpen->nPending].fd = pFile->h; - pOpen->aPending[pOpen->nPending].flags = pFile->flags; - pOpen->nPending++; - pFile->h = -1; - } + UnixUnusedFd *p = pFile->pUnused; + p->pNext = pOpen->pUnused; + pOpen->pUnused = p; + pFile->h = -1; + pFile->pUnused = 0; } /* @@ -1573,7 +1565,7 @@ static int unixUnlock(sqlite3_file *id, int locktype){ pOpen = pFile->pOpen; pOpen->nLock--; assert( pOpen->nLock>=0 ); - if( pOpen->nLock==0 && pOpen->nPending>0 ){ + if( pOpen->nLock==0 ){ int rc2 = closePendingFds(pFile); if( rc==SQLITE_OK ){ rc = rc2; @@ -1627,6 +1619,7 @@ static int closeUnixFile(sqlite3_file *id){ #endif OSTRACE2("CLOSE %-3d\n", pFile->h); OpenCounter(-1); + sqlite3_free(pFile->pUnused); memset(pFile, 0, sizeof(unixFile)); } return SQLITE_OK; @@ -1644,8 +1637,8 @@ static int unixClose(sqlite3_file *id){ if( pFile->pOpen && pFile->pOpen->nLock ){ /* If there are outstanding locks, do not actually close the file just ** yet because that would clear those locks. Instead, add the file - ** descriptor to pOpen->aPending. It will be automatically closed when - ** the last lock is cleared. + ** descriptor to pOpen->pUnused list. It will be automatically closed + ** when the last lock is cleared. */ setPendingFd(pFile); } @@ -2734,7 +2727,7 @@ static int unixRead( /* If this is a database file (not a journal, master-journal or temp ** file), the bytes in the locking range should never be read or written. */ - assert( (pFile->flags&SQLITE_OPEN_MAIN_DB)==0 + assert( pFile->pUnused==0 || offset>=PENDING_BYTE+512 || offset+amt<=PENDING_BYTE ); @@ -2807,7 +2800,7 @@ static int unixWrite( /* If this is a database file (not a journal, master-journal or temp ** file), the bytes in the locking range should never be read or written. */ - assert( (pFile->flags&SQLITE_OPEN_MAIN_DB)==0 + assert( pFile->pUnused==0 || offset>=PENDING_BYTE+512 || offset+amt<=PENDING_BYTE ); @@ -3174,7 +3167,7 @@ static int unixDeviceCharacteristics(sqlite3_file *NotUsed){ ** ** (1) The real finder-function named "FImpt()". ** -** (2) A constant pointer to this functio named just "F". +** (2) A constant pointer to this function named just "F". ** ** ** A pointer to the F pointer is used as the pAppData value for VFS @@ -3438,13 +3431,10 @@ static int fillInUnixFile( assert( pNew->pLock==NULL ); assert( pNew->pOpen==NULL ); - /* Parameter isDelete is only used on vxworks. - ** Express this explicitly here to prevent compiler warnings - ** about unused parameters. + /* Parameter isDelete is only used on vxworks. Express this explicitly + ** here to prevent compiler warnings about unused parameters. */ -#if !OS_VXWORKS UNUSED_PARAMETER(isDelete); -#endif OSTRACE3("OPEN %-3d %s\n", h, zFilename); pNew->h = h; @@ -3474,6 +3464,28 @@ static int fillInUnixFile( if( pLockingStyle == &posixIoMethods ){ unixEnterMutex(); rc = findLockInfo(pNew, &pNew->pLock, &pNew->pOpen); + if( rc!=SQLITE_OK ){ + /* If an error occured in findLockInfo(), close the file descriptor + ** immediately, before releasing the mutex. findLockInfo() may fail + ** in two scenarios: + ** + ** (a) A call to fstat() failed. + ** (b) A malloc failed. + ** + ** Scenario (b) may only occur if the process is holding no other + ** file descriptors open on the same file. If there were other file + ** descriptors on this file, then no malloc would be required by + ** findLockInfo(). If this is the case, it is quite safe to close + ** handle h - as it is guaranteed that no posix locks will be released + ** by doing so. + ** + ** If scenario (a) caused the error then things are not so safe. The + ** implicit assumption here is that if fstat() fails, things are in + ** such bad shape that dropping a lock or two doesn't matter much. + */ + close(h); + h = -1; + } unixLeaveMutex(); } @@ -3549,7 +3561,7 @@ static int fillInUnixFile( #endif if( rc!=SQLITE_OK ){ if( dirfd>=0 ) close(dirfd); /* silent leak if fail, already in error */ - close(h); + if( h>=0 ) close(h); }else{ pNew->pMethod = pLockingStyle; OpenCounter(+1); @@ -3674,8 +3686,15 @@ static int proxyTransformUnixFile(unixFile*, const char*); ** If a suitable file descriptor is found, then it is returned. If no ** such file descriptor is located, -1 is returned. */ -static int findReusableFd(const char *zPath, int flags){ - int fd = -1; /* Return value */ +static UnixUnusedFd *findReusableFd(const char *zPath, int flags){ + UnixUnusedFd *pUnused = 0; + + /* Do not search for an unused file descriptor on vxworks. Not because + ** vxworks would not benefit from the change (it might, we're not sure), + ** but because no way to test it is currently available. It is better + ** not to risk breaking vxworks support for the sake of such an obscure + ** feature. */ +#if !OS_VXWORKS struct stat sStat; /* Results of stat() call */ /* A stat() call may fail for various reasons. If this happens, it is @@ -3687,28 +3706,25 @@ static int findReusableFd(const char *zPath, int flags){ ** Even if a subsequent open() call does succeed, the consequences of ** not searching for a resusable file descriptor are not dire. */ if( 0==stat(zPath, &sStat) ){ - struct unixOpenCnt *p; + struct unixOpenCnt *pO; struct unixFileId id; id.dev = sStat.st_dev; id.ino = sStat.st_ino; unixEnterMutex(); - for(p=openList; p&& memcmp(&id, &p->fileId, sizeof(id)); p=p->pNext); - if( p && p->aPending ){ - int i; - struct PendingClose *aPending = p->aPending; - for(i=0; inPending; i++){ - if( aPending[i].fd>=0 && flags==aPending[i].flags ){ - fd = aPending[i].fd; - aPending[i].fd = -1; - break; - } + for(pO=openList; pO && memcmp(&id, &pO->fileId, sizeof(id)); pO=pO->pNext); + if( pO ){ + UnixUnusedFd **pp; + for(pp=&pO->pUnused; *pp && (*pp)->flags!=flags; pp=&((*pp)->pNext)); + pUnused = *pp; + if( pUnused ){ + *pp = pUnused->pNext; } } unixLeaveMutex(); } - - return fd; +#endif /* if !OS_VXWORKS */ + return pUnused; } /* @@ -3796,14 +3812,17 @@ static int unixOpen( memset(p, 0, sizeof(unixFile)); if( eType==SQLITE_OPEN_MAIN_DB ){ - /* Try to find an unused file descriptor to reuse. This is not done - ** for vxworks. Not because vxworks would not benefit from the change - ** (it might, we're not sure), but because no way to test it is - ** currently available. It is better not to risk breaking vxworks for - ** the sake of such an obscure feature. */ -#if !OS_VXWORKS - fd = findReusableFd(zName, flags); -#endif + UnixUnusedFd *pUnused; + pUnused = findReusableFd(zName, flags); + if( pUnused ){ + fd = pUnused->fd; + }else{ + pUnused = sqlite3_malloc(sizeof(pUnused)); + if( !pUnused ){ + return SQLITE_NOMEM; + } + } + p->pUnused = pUnused; }else if( !zName ){ /* If zName is NULL, the upper layer is requesting a temp file. */ assert(isDelete && !isOpenDirectory); @@ -3825,24 +3844,32 @@ static int unixOpen( openFlags |= (O_LARGEFILE|O_BINARY); if( fd<0 ){ - fd = open(zName, openFlags, isDelete?0600:SQLITE_DEFAULT_FILE_PERMISSIONS); + mode_t openMode = (isDelete?0600:SQLITE_DEFAULT_FILE_PERMISSIONS); + fd = open(zName, openFlags, openMode); OSTRACE4("OPENX %-3d %s 0%o\n", fd, zName, openFlags); if( fd<0 && errno!=EISDIR && isReadWrite && !isExclusive ){ /* Failed to open the file for read/write access. Try read-only. */ flags &= ~(SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE); + openFlags &= ~(O_RDWR|O_CREAT); flags |= SQLITE_OPEN_READONLY; - return unixOpen(pVfs, zPath, pFile, flags, pOutFlags); + openFlags |= O_RDONLY; + fd = open(zName, openFlags, openMode); } if( fd<0 ){ - return SQLITE_CANTOPEN; + rc = SQLITE_CANTOPEN; + goto open_finished; } } assert( fd>=0 ); - p->flags = flags; if( pOutFlags ){ *pOutFlags = flags; } + if( p->pUnused ){ + p->pUnused->fd = fd; + p->pUnused->flags = flags; + } + if( isDelete ){ #if OS_VXWORKS zPath = zName; @@ -3861,11 +3888,11 @@ static int unixOpen( if( rc!=SQLITE_OK ){ /* It is safe to close fd at this point, because it is guaranteed not ** to be open on a database file. If it were open on a database file, - ** it would not be safe to close as this would cause any locks held - ** on the file by this process to be released. */ + ** it would not be safe to close as this would release any locks held + ** on the file by this process. */ assert( eType!=SQLITE_OPEN_MAIN_DB ); close(fd); /* silently leak if fail, already in error */ - return rc; + goto open_finished; } } @@ -3887,10 +3914,20 @@ static int unixOpen( }else{ struct statfs fsInfo; if( statfs(zPath, &fsInfo) == -1 ){ - ((unixFile*)pFile)->lastErrno = errno; - if( dirfd>=0 ) close(dirfd); /* silently leak if fail, in error */ + /* In theory, the close(fd) call is sub-optimal. If the file opened + ** with fd is a database file, and there are other connections open + ** on that file that are currently holding advisory locks on it, + ** then the call to close() will cancel those locks. In practice, + ** we're assuming that statfs() doesn't fail very often. At least + ** not while other file descriptors opened by the same process on + ** the same file are working. */ + p->lastErrno = errno; + if( dirfd>=0 ){ + close(dirfd); /* silently leak if fail, in error */ + } close(fd); /* silently leak if fail, in error */ - return SQLITE_IOERR_ACCESS; + rc = SQLITE_IOERR_ACCESS; + goto open_finished; } useProxy = !(fsInfo.f_flags&MNT_LOCAL); } @@ -3899,14 +3936,20 @@ static int unixOpen( if( rc==SQLITE_OK ){ rc = proxyTransformUnixFile((unixFile*)pFile, ":auto:"); } - return rc; + goto open_finished; } } #endif - return fillInUnixFile(pVfs, fd, dirfd, pFile, zPath, noLock, isDelete); + rc = fillInUnixFile(pVfs, fd, dirfd, pFile, zPath, noLock, isDelete); +open_finished: + if( rc!=SQLITE_OK ){ + sqlite3_free(p->pUnused); + } + return rc; } + /* ** Delete the file at zPath. If the dirSync argument is true, fsync() ** the directory after deleting the file. diff --git a/test/tkt4018.test b/test/tkt4018.test index 9977f9fc82..2bc41d47aa 100644 --- a/test/tkt4018.test +++ b/test/tkt4018.test @@ -43,7 +43,7 @@ do_test tkt4018-1.1 { } {} # The database is locked by connection [db]. Open and close a second -# connection to test.db 20000 times. If file-descriptors are not being +# connection to test.db 10000 times. If file-descriptors are not being # reused, then the process will quickly exceed its maximum number of # file descriptors (1024 by default on linux). do_test tkt4018-1.2 { From 30a89a384551f78e56aa8b814aa97d22727648fa Mon Sep 17 00:00:00 2001 From: drh Date: Sat, 22 Aug 2009 19:17:02 +0000 Subject: [PATCH 02/14] Remove an obsolete documentation file left over from SQLite version 1.0. FossilOrigin-Name: f7eb1efc37d0658d66b3b86d5afd5419d22bfe92 --- doc/report1.txt | 121 ------------------------------------------------ manifest | 23 ++++++--- manifest.uuid | 2 +- 3 files changed, 17 insertions(+), 129 deletions(-) delete mode 100644 doc/report1.txt diff --git a/doc/report1.txt b/doc/report1.txt deleted file mode 100644 index a236e7cedf..0000000000 --- a/doc/report1.txt +++ /dev/null @@ -1,121 +0,0 @@ -An SQLite (version 1.0) database was used in a large military application -where the database contained 105 tables and indices. The following is -a breakdown on the sizes of keys and data within these tables and indices: - -Entries: 967089 -Size: 45896104 -Avg Size: 48 -Key Size: 11112265 -Avg Key Size: 12 -Max Key Size: 99 - - 0..8 263 0% - 9..12 5560 0% - 13..16 71394 7% - 17..24 180717 26% - 25..32 215442 48% - 33..40 151118 64% - 41..48 77479 72% - 49..56 13983 74% - 57..64 14481 75% - 65..80 41342 79% - 81..96 127098 92% - 97..112 38054 96% - 113..128 14197 98% - 129..144 8208 99% - 145..160 3326 99% - 161..176 1242 99% - 177..192 604 99% - 193..208 222 99% - 209..224 213 99% - 225..240 132 99% - 241..256 58 99% - 257..288 515 99% - 289..320 64 99% - 321..352 39 99% - 353..384 44 99% - 385..416 25 99% - 417..448 24 99% - 449..480 26 99% - 481..512 27 99% - 513..1024 470 99% - 1025..2048 396 99% - 2049..4096 187 99% - 4097..8192 78 99% - 8193..16384 35 99% -16385..32768 17 99% -32769..65536 6 99% -65537..65541 3 100% - -If the indices are omitted, the statistics for the 49 tables -become the following: - -Entries: 451103 -Size: 30930282 -Avg Size: 69 -Key Size: 1804412 -Avg Key Size: 4 -Max Key Size: 4 - - 0..24 89 0% - 25..32 9417 2% - 33..40 119162 28% - 41..48 68710 43% - 49..56 9539 45% - 57..64 12435 48% - 65..80 38650 57% - 81..96 126877 85% - 97..112 38030 93% - 113..128 14183 96% - 129..144 7668 98% - 145..160 3302 99% - 161..176 1238 99% - 177..192 597 99% - 193..208 217 99% - 209..224 211 99% - 225..240 130 99% - 241..256 57 99% - 257..288 100 99% - 289..320 62 99% - 321..352 34 99% - 353..384 43 99% - 385..416 24 99% - 417..448 24 99% - 449..480 25 99% - 481..512 27 99% - 513..1024 153 99% - 1025..2048 92 99% - 2049..4096 7 100% - -The 56 indices have these statistics: - -Entries: 512422 -Size: 14879828 -Avg Size: 30 -Key Size: 9253204 -Avg Key Size: 19 -Max Key Size: 99 - - 0..8 246 0% - 9..12 5486 1% - 13..16 70717 14% - 17..24 178246 49% - 25..32 205722 89% - 33..40 31951 96% - 41..48 8768 97% - 49..56 4444 98% - 57..64 2046 99% - 65..80 2691 99% - 81..96 202 99% - 97..112 11 99% - 113..144 527 99% - 145..160 20 99% - 161..288 406 99% - 289..1024 316 99% - 1025..2048 304 99% - 2049..4096 180 99% - 4097..8192 78 99% - 8193..16384 35 99% -16385..32768 17 99% -32769..65536 6 99% -65537..65541 3 100% diff --git a/manifest b/manifest index 4780014aec..eb0a645e7f 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,8 @@ -C Fix\sa\sproblem\sin\sos_unix.c\swhere\sa\smalloc\sfailure\scould\slead\sto\sa\sleaked\sfile\sdescriptor. -D 2009-08-22T11:39:47 +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + +C Remove\san\sobsolete\sdocumentation\sfile\sleft\sover\sfrom\sSQLite\sversion\s1.0. +D 2009-08-22T19:17:03 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in 73ddeec9dd10b85876c5c2ce1fdce627e1dcc7f8 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -22,7 +25,6 @@ F configure 486c870218ec915bd8edfece7109b6c864e82a5a F configure.ac 14740970ddb674d92a9f5da89083dff1179014ff F contrib/sqlitecon.tcl 210a913ad63f9f991070821e599d600bd913e0ad F doc/lemon.html f0f682f50210928c07e562621c3b7e8ab912a538 -F doc/report1.txt a031aaf37b185e4fa540223cb516d3bccec7eeac F ext/README.txt 913a7bd3f4837ab14d7e063304181787658b14e1 F ext/async/README.txt 0c541f418b14b415212264cbaaf51c924ec62e5b F ext/async/sqlite3async.c ec97d85cdb56dda9312cce39dd3cd9d62a747ec6 @@ -748,7 +750,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/vdbe-compress.tcl 672f81d693a03f80f5ae60bfefacd8a349e76746 -P 9b4d9ab62d687289837b13b07885e72cc3abe8a9 -R cdd26bf118eaa2a9465bbbd01490d6db -U dan -Z 37f9fc37ad160151ec2e7b69ade6b18c +P aa6acfa8caa2ef59b4c16dfe42c4b5644da96905 +R b2c711eaf557092f239dfa0773f260fa +U drh +Z 691b8bbbc5705e9c8f90c29fb0305de2 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.6 (GNU/Linux) + +iD8DBQFKkEQyoxKgR168RlERAiJ9AJsFs50VJ3XZxahfq30lhOA5nWayXACfW1Th +dnkRj6C5BnZxRcqkd+dsDMQ= +=jBN8 +-----END PGP SIGNATURE----- diff --git a/manifest.uuid b/manifest.uuid index c61f045d08..3696961cee 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -aa6acfa8caa2ef59b4c16dfe42c4b5644da96905 \ No newline at end of file +f7eb1efc37d0658d66b3b86d5afd5419d22bfe92 \ No newline at end of file From 6aa657f76b78c432111ec51e4f6cba195523c7f0 Mon Sep 17 00:00:00 2001 From: dan Date: Mon, 24 Aug 2009 18:57:58 +0000 Subject: [PATCH 03/14] Fix some errors in [http://www.sqlite.org/src/vdiff/aa6acfa8caa2ef59b4c16dfe42c4b5644da96905|aa6acfa8ca]. FossilOrigin-Name: 82d1934a428a34c292a612fb67bbcea262990e0f --- manifest | 24 +++++++----------------- manifest.uuid | 2 +- src/os_unix.c | 5 ++--- 3 files changed, 10 insertions(+), 21 deletions(-) diff --git a/manifest b/manifest index eb0a645e7f..cf8141d34c 100644 --- a/manifest +++ b/manifest @@ -1,8 +1,5 @@ ------BEGIN PGP SIGNED MESSAGE----- -Hash: SHA1 - -C Remove\san\sobsolete\sdocumentation\sfile\sleft\sover\sfrom\sSQLite\sversion\s1.0. -D 2009-08-22T19:17:03 +C Fix\ssome\serrors\sin\s[http://www.sqlite.org/src/vdiff/aa6acfa8caa2ef59b4c16dfe42c4b5644da96905|aa6acfa8ca]. +D 2009-08-24T18:57:58 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in 73ddeec9dd10b85876c5c2ce1fdce627e1dcc7f8 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -147,7 +144,7 @@ F src/os.c 9fea283e336ee31caa4654d6cb05a129a1c42d2f F src/os.h 00a1334a4eecee7f7bef79ac606b88d325119f21 F src/os_common.h 8c61457df58f1a4bd5f5adc3e90e01b37bf7afbc F src/os_os2.c bed77dc26e3a95ce4a204936b9a1ca6fe612fcc5 -F src/os_unix.c f151f27d353bf4240896d9a1386e5d59102a3cba +F src/os_unix.c 5fc8443b16d64faf3db374f6dda959cfe3202a03 F src/os_win.c 58bb163f327e79726dd119344d908e4d98483c3f F src/pager.c a47be286477ed6c7b9a342dd53d4e4043f29d8c2 F src/pager.h 11852d044c86cf5a9d6e34171fb0c4fcf1f6265f @@ -750,14 +747,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/vdbe-compress.tcl 672f81d693a03f80f5ae60bfefacd8a349e76746 -P aa6acfa8caa2ef59b4c16dfe42c4b5644da96905 -R b2c711eaf557092f239dfa0773f260fa -U drh -Z 691b8bbbc5705e9c8f90c29fb0305de2 ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.4.6 (GNU/Linux) - -iD8DBQFKkEQyoxKgR168RlERAiJ9AJsFs50VJ3XZxahfq30lhOA5nWayXACfW1Th -dnkRj6C5BnZxRcqkd+dsDMQ= -=jBN8 ------END PGP SIGNATURE----- +P f7eb1efc37d0658d66b3b86d5afd5419d22bfe92 +R 83c4813ff710350c0fba94b0a5e87768 +U dan +Z 0b89a0ea45e445bcb467bd70aa77089d diff --git a/manifest.uuid b/manifest.uuid index 3696961cee..2fbcc968e9 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -f7eb1efc37d0658d66b3b86d5afd5419d22bfe92 \ No newline at end of file +82d1934a428a34c292a612fb67bbcea262990e0f \ No newline at end of file diff --git a/src/os_unix.c b/src/os_unix.c index 99312604ad..65259a7568 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -1428,7 +1428,6 @@ static int closePendingFds(unixFile *pFile){ rc = SQLITE_IOERR_CLOSE; p->pNext = pError; pError = p; - assert(0); }else{ sqlite3_free(p); } @@ -2609,7 +2608,7 @@ static int afpUnlock(sqlite3_file *id, int locktype) { struct unixOpenCnt *pOpen = pFile->pOpen; pOpen->nLock--; assert( pOpen->nLock>=0 ); - if( pOpen->nLock==0 && pOpen->nPending>0 ){ + if( pOpen->nLock==0 ){ rc = closePendingFds(pFile); } } @@ -3817,7 +3816,7 @@ static int unixOpen( if( pUnused ){ fd = pUnused->fd; }else{ - pUnused = sqlite3_malloc(sizeof(pUnused)); + pUnused = sqlite3_malloc(sizeof(*pUnused)); if( !pUnused ){ return SQLITE_NOMEM; } From cee4c937713301ab655efebbd3c4465d55849444 Mon Sep 17 00:00:00 2001 From: drh Date: Mon, 24 Aug 2009 19:37:20 +0000 Subject: [PATCH 04/14] Update the version number to 3.6.18, even though the actual release of that version is still a few weeks away. FossilOrigin-Name: c0ea4e9a7dcd66c079f917af47157f6ab7d79401 --- VERSION | 2 +- configure | 20 ++++++++++---------- manifest | 20 ++++++++++---------- manifest.uuid | 2 +- 4 files changed, 22 insertions(+), 22 deletions(-) mode change 100644 => 100755 configure diff --git a/VERSION b/VERSION index 601c643270..c241e9602d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.6.17 +3.6.18 diff --git a/configure b/configure old mode 100644 new mode 100755 index 533ede8f60..505e0a3cf8 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.62 for sqlite 3.6.17. +# Generated by GNU Autoconf 2.62 for sqlite 3.6.18. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. @@ -743,8 +743,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.6.17' -PACKAGE_STRING='sqlite 3.6.17' +PACKAGE_VERSION='3.6.18' +PACKAGE_STRING='sqlite 3.6.18' PACKAGE_BUGREPORT='' # Factoring default headers for most tests. @@ -1487,7 +1487,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.6.17 to adapt to many kinds of systems. +\`configure' configures sqlite 3.6.18 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1552,7 +1552,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.6.17:";; + short | recursive ) echo "Configuration of sqlite 3.6.18:";; esac cat <<\_ACEOF @@ -1670,7 +1670,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.6.17 +sqlite configure 3.6.18 generated by GNU Autoconf 2.62 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1684,7 +1684,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.6.17, which was +It was created by sqlite $as_me 3.6.18, which was generated by GNU Autoconf 2.62. Invocation command line was $ $0 $@ @@ -2065,7 +2065,7 @@ please regen with autoconf" >&2;} fi # The following RCS revision string applies to configure.in -# $Revision: 1.74 $ +# $Revision: 1.56 $ ######### # Programs needed @@ -13972,7 +13972,7 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.6.17, which was +This file was extended by sqlite $as_me 3.6.18, which was generated by GNU Autoconf 2.62. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14025,7 +14025,7 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ -sqlite config.status 3.6.17 +sqlite config.status 3.6.18 configured by $0, generated by GNU Autoconf 2.62, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff --git a/manifest b/manifest index edf9fdd5a3..6212330420 100644 --- a/manifest +++ b/manifest @@ -1,14 +1,14 @@ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 -C Run\sthe\scolumn\scache\sin\sa\snew\scontext\swhen\sgenerating\scode\sfor\strigger\nprograms.\s\sFix\sfor\sticket\s[efc02f9779]. -D 2009-08-24T01:35:25 +C Update\sthe\sversion\snumber\sto\s3.6.18,\seven\sthough\sthe\sactual\srelease\sof\nthat\sversion\sis\sstill\sa\sfew\sweeks\saway. +D 2009-08-24T19:37:21 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in 73ddeec9dd10b85876c5c2ce1fdce627e1dcc7f8 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 F Makefile.vxworks 10010ddbf52e2503c7c49c7c0b7c7a096f8638a6 F README b974cdc3f9f12b87e851b04e75996d720ebf81ac -F VERSION 8fd162479ea9d3932d4492a889db80634742fe90 +F VERSION 7260e7baf934051dee42458206e915b75570f41d F aclocal.m4 a5c22d164aff7ed549d53a90fa56d56955281f50 F addopcodes.awk 215333be9d99c260e076c3080a81dba3ae928c45 F art/2005osaward.gif 0d1851b2a7c1c9d0ccce545f3e14bca42d7fd248 @@ -21,7 +21,7 @@ F art/powered_by_sqlite.gif 7fbcd7d3675391fd3d21672c14c05f5999eb60d1 F config.guess 226d9a188c6196f3033ffc651cbc9dcee1a42977 F config.h.in 868fdb48c028421a203470e15c69ada15b9ba673 F config.sub 9ebe4c3b3dab6431ece34f16828b594fb420da55 -F configure 486c870218ec915bd8edfece7109b6c864e82a5a +F configure bccfdabb9982b7e88a33470741f1d6ba14a6b684 x F configure.ac 14740970ddb674d92a9f5da89083dff1179014ff F contrib/sqlitecon.tcl 210a913ad63f9f991070821e599d600bd913e0ad F doc/lemon.html f0f682f50210928c07e562621c3b7e8ab912a538 @@ -750,14 +750,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/vdbe-compress.tcl 672f81d693a03f80f5ae60bfefacd8a349e76746 -P 9b4d9ab62d687289837b13b07885e72cc3abe8a9 -R 8c0a86d1dda3ad47818cafa2a01a76cc +P dee1b8eb402f47c6d5ee60aac28f8e3dcf98167f +R 18469d49f3e5ceb1a5be57bfca3721d7 U drh -Z a8886aa9c2f39a29c2eeac74183b7a19 +Z d9590dbc39db73d8a7cd1e77630302e6 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) -iD8DBQFKke5hoxKgR168RlERAlsiAJ99uio4dN8iQWmrdPv34d66O3Nb/wCdEt6E -0TzPUVqtgGFOj3LSxkTm7fQ= -=7r/8 +iD8DBQFKkuv0oxKgR168RlERAnbOAJ9GNnuKpMVMY0YMDaLOX/CLH3yVHQCfbq7u +jxVu7AXStYZw/1h03vBMaiw= +=8t8V -----END PGP SIGNATURE----- diff --git a/manifest.uuid b/manifest.uuid index c6f1f2e6c9..e64728f97a 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -dee1b8eb402f47c6d5ee60aac28f8e3dcf98167f \ No newline at end of file +c0ea4e9a7dcd66c079f917af47157f6ab7d79401 \ No newline at end of file From 15edd587fd5d460ca0914c764d9ceb3b7d2dc760 Mon Sep 17 00:00:00 2001 From: dan Date: Tue, 25 Aug 2009 05:57:47 +0000 Subject: [PATCH 05/14] Fix a bad interaction between "proxy-locking" and [http://www.sqlite.org/src/vdiff/aa6acfa8caa2ef59b4c16dfe42c4b5644da96905|aa6acfa8ca]. FossilOrigin-Name: 2a5c9e1dbf7f5f4b2081c964450a9305a4516f5b --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/os_unix.c | 46 ++++++++++++++++++++++++++++------------------ 3 files changed, 35 insertions(+), 25 deletions(-) diff --git a/manifest b/manifest index cf8141d34c..b51d13fd90 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\ssome\serrors\sin\s[http://www.sqlite.org/src/vdiff/aa6acfa8caa2ef59b4c16dfe42c4b5644da96905|aa6acfa8ca]. -D 2009-08-24T18:57:58 +C Fix\sa\sbad\sinteraction\sbetween\s"proxy-locking"\sand\s[http://www.sqlite.org/src/vdiff/aa6acfa8caa2ef59b4c16dfe42c4b5644da96905|aa6acfa8ca]. +D 2009-08-25T05:57:48 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in 73ddeec9dd10b85876c5c2ce1fdce627e1dcc7f8 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -144,7 +144,7 @@ F src/os.c 9fea283e336ee31caa4654d6cb05a129a1c42d2f F src/os.h 00a1334a4eecee7f7bef79ac606b88d325119f21 F src/os_common.h 8c61457df58f1a4bd5f5adc3e90e01b37bf7afbc F src/os_os2.c bed77dc26e3a95ce4a204936b9a1ca6fe612fcc5 -F src/os_unix.c 5fc8443b16d64faf3db374f6dda959cfe3202a03 +F src/os_unix.c 96e2e409df8851a31fdb2d7430ad73fea7b0a104 F src/os_win.c 58bb163f327e79726dd119344d908e4d98483c3f F src/pager.c a47be286477ed6c7b9a342dd53d4e4043f29d8c2 F src/pager.h 11852d044c86cf5a9d6e34171fb0c4fcf1f6265f @@ -747,7 +747,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/vdbe-compress.tcl 672f81d693a03f80f5ae60bfefacd8a349e76746 -P f7eb1efc37d0658d66b3b86d5afd5419d22bfe92 -R 83c4813ff710350c0fba94b0a5e87768 +P 82d1934a428a34c292a612fb67bbcea262990e0f +R d7c1a30840419801458f3ecc7f6aa251 U dan -Z 0b89a0ea45e445bcb467bd70aa77089d +Z 6b17644948440e13ab90b6fbc376f045 diff --git a/manifest.uuid b/manifest.uuid index 2fbcc968e9..d88d55657a 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -82d1934a428a34c292a612fb67bbcea262990e0f \ No newline at end of file +2a5c9e1dbf7f5f4b2081c964450a9305a4516f5b \ No newline at end of file diff --git a/src/os_unix.c b/src/os_unix.c index 65259a7568..b88cc7a8b7 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -3902,7 +3902,7 @@ static int unixOpen( noLock = eType!=SQLITE_OPEN_MAIN_DB; #if SQLITE_PREFER_PROXY_LOCKING - if( zPath!=NULL && !noLock ){ + if( zPath!=NULL && !noLock && pVfs->xOpen ){ char *envforce = getenv("SQLITE_FORCE_PROXY_LOCKING"); int useProxy = 0; @@ -4617,33 +4617,43 @@ static int proxyGetLockPath(const char *dbPath, char *lPath, size_t maxLen){ ** but also for freeing the memory associated with the file descriptor. */ static int proxyCreateUnixFile(const char *path, unixFile **ppFile) { - int fd; - int dirfd = -1; unixFile *pNew; + int flags = SQLITE_OPEN_MAIN_DB|SQLITE_OPEN_CREATE|SQLITE_OPEN_READWRITE; int rc = SQLITE_OK; sqlite3_vfs dummyVfs; - fd = open(path, O_RDWR | O_CREAT, SQLITE_DEFAULT_FILE_PERMISSIONS); - if( fd<0 ){ - return SQLITE_CANTOPEN; - } - pNew = (unixFile *)sqlite3_malloc(sizeof(unixFile)); - if( pNew==NULL ){ - rc = SQLITE_NOMEM; - goto end_create_proxy; + if( !pNew ){ + return SQLITE_NOMEM; } memset(pNew, 0, sizeof(unixFile)); + /* Call unixOpen() to open the proxy file. The flags passed to unixOpen() + ** suggest that the file being opened is a "main database". This is + ** necessary as other file types do not necessarily support locking. It + ** is better to use unixOpen() instead of opening the file directly with + ** open(), as unixOpen() sets up the various mechanisms required to + ** make sure a call to close() does not cause the system to discard + ** POSIX locks prematurely. + ** + ** It is important that the xOpen member of the VFS object passed to + ** unixOpen() is NULL. This tells unixOpen() may try to open a proxy-file + ** for the proxy-file (creating a potential infinite loop). + */ dummyVfs.pAppData = (void*)&autolockIoFinder; - rc = fillInUnixFile(&dummyVfs, fd, dirfd, (sqlite3_file*)pNew, path, 0, 0); - if( rc==SQLITE_OK ){ - *ppFile = pNew; - return SQLITE_OK; + dummyVfs.xOpen = 0; + rc = unixOpen(&dummyVfs, path, (sqlite3_file *)pNew, flags, &flags); + if( rc==SQLITE_OK && (flags&SQLITE_OPEN_READONLY) ){ + pNew->pMethod->xClose((sqlite3_file *)pNew); + rc = SQLITE_CANTOPEN; } -end_create_proxy: - close(fd); /* silently leak fd if error, we're already in error */ - sqlite3_free(pNew); + + if( rc!=SQLITE_OK ){ + sqlite3_free(pNew); + pNew = 0; + } + + *ppFile = pNew; return rc; } From ff104c17b7e3eb31f2d2e9c1682a323cf17263d2 Mon Sep 17 00:00:00 2001 From: drh Date: Tue, 25 Aug 2009 13:10:27 +0000 Subject: [PATCH 06/14] Fix an uninitialized variable in sqlite3VdbeIdxRowid(). FossilOrigin-Name: 6e787e18fa87f5463bf62cd91a0c0855099693f0 --- manifest | 18 +++++++++--------- manifest.uuid | 2 +- src/vdbeaux.c | 4 +--- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/manifest b/manifest index 5252b427ca..100dea490d 100644 --- a/manifest +++ b/manifest @@ -1,8 +1,8 @@ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 -C Merge\stogether\sthe\sos_unix.c\sfix\sof\s[aa6acfa8ca]\sand\sthe\strigger\sfix\sof\n[dee1b8eb40]. -D 2009-08-25T12:11:01 +C Fix\san\suninitialized\svariable\sin\ssqlite3VdbeIdxRowid(). +D 2009-08-25T13:10:27 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in 73ddeec9dd10b85876c5c2ce1fdce627e1dcc7f8 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -211,7 +211,7 @@ F src/vdbe.c 464e2e30b1287554a23cdaa0b6b010a9dcb5eb29 F src/vdbe.h 457b6c70f02885cec1f5225b5e6441d067b55d3f F src/vdbeInt.h 831c254a6eef237ef4664c8381a0137586567007 F src/vdbeapi.c 0ab8ada7260b32031ca97f338caecf0812460624 -F src/vdbeaux.c 974a02fb1719799863492702877d52779d9e6b05 +F src/vdbeaux.c 46c85b2cf1e9c7175aee3b40c9dc9e2bbda7107f F src/vdbeblob.c a3f3e0e877fc64ea50165eec2855f5ada4477611 F src/vdbemem.c c4a5188ff43692f2ca78d3539ad4877e14b70712 F src/vtab.c aedd76e8670d5a5379f93804398d3ba960125547 @@ -750,14 +750,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/vdbe-compress.tcl 672f81d693a03f80f5ae60bfefacd8a349e76746 -P 2a5c9e1dbf7f5f4b2081c964450a9305a4516f5b c0ea4e9a7dcd66c079f917af47157f6ab7d79401 -R 831888fbe6ffc9eaba6547ee83986b1e +P 1e2c6e134e04dd22795ad4839874ec0edd9b0970 +R 13fbbaba6c965af30dc9b700fce69449 U drh -Z 74516868f17d9ef70bc645467b0bcf5a +Z caed388eb8a08b03ca62d76237b8b28e -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) -iD8DBQFKk9TYoxKgR168RlERAl5cAJsHJCCNuwJwIwnMauy0LjcUqDVyZgCfWuXx -VSy4e4yPY24QsPxZpxOVRrY= -=H33X +iD8DBQFKk+LGoxKgR168RlERAowRAJkBTeCELBcU59XsuQvqk9JNNdBFOQCeLBep +wbr+FOU0F0PCobaghDs2Qiw= +=1IT0 -----END PGP SIGNATURE----- diff --git a/manifest.uuid b/manifest.uuid index ede8d957bf..34fc3f0132 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -1e2c6e134e04dd22795ad4839874ec0edd9b0970 \ No newline at end of file +6e787e18fa87f5463bf62cd91a0c0855099693f0 \ No newline at end of file diff --git a/src/vdbeaux.c b/src/vdbeaux.c index 436fcf7680..7726f1ea5b 100644 --- a/src/vdbeaux.c +++ b/src/vdbeaux.c @@ -2613,9 +2613,7 @@ int sqlite3VdbeIdxRowid(sqlite3 *db, BtCursor *pCur, i64 *rowid){ assert( (nCellKey & SQLITE_MAX_U32)==(u64)nCellKey ); /* Read in the complete content of the index entry */ - m.flags = 0; - m.db = db; - m.zMalloc = 0; + memset(&m, 0, sizeof(m)); rc = sqlite3VdbeMemFromBtree(pCur, 0, (int)nCellKey, 1, &m); if( rc ){ return rc; From ec9b31f03327fc7ab85a7201048f203b0a750345 Mon Sep 17 00:00:00 2001 From: drh Date: Tue, 25 Aug 2009 13:53:49 +0000 Subject: [PATCH 07/14] Avoid calling sqite3VdbeRecordCompare() with uninitialized memory following an OOM. Doing so is harmless, but it worries valgrind. FossilOrigin-Name: d33b9eb2567561ccfdc588c95604cce9b697d768 --- manifest | 18 +++++++++--------- manifest.uuid | 2 +- src/btree.c | 5 ++++- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/manifest b/manifest index 100dea490d..e2d58acfb8 100644 --- a/manifest +++ b/manifest @@ -1,8 +1,8 @@ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 -C Fix\san\suninitialized\svariable\sin\ssqlite3VdbeIdxRowid(). -D 2009-08-25T13:10:27 +C Avoid\scalling\ssqite3VdbeRecordCompare()\swith\suninitialized\smemory\sfollowing\nan\sOOM.\s\sDoing\sso\sis\sharmless,\sbut\sit\sworries\svalgrind. +D 2009-08-25T13:53:49 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in 73ddeec9dd10b85876c5c2ce1fdce627e1dcc7f8 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -108,7 +108,7 @@ F src/auth.c 802a9439dfa0b8c208b10055cba400e82ef18025 F src/backup.c 6f1c2d9862c8a3feb7739dfcca02c1f5352e37f3 F src/bitvec.c e08f6c1a9551b88081fc737916c6c3fd5029a6cf F src/btmutex.c 0f43a75bb5b8147b386e8e1c3e71ba734e3863b7 -F src/btree.c 49212ddaee8d7d12b4f1e17b9de62f7ea91ca59d +F src/btree.c 6b60ece56141bbe23aa6efca10f1612d34271c2f F src/btree.h 577448a890c2ab9b21e6ab74f073526184bceebe F src/btreeInt.h 1c86297e69380f6577e7ae67452597dd8d5c2705 F src/build.c a43c959c5953c25989207c929f99ef808d5336a6 @@ -750,14 +750,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/vdbe-compress.tcl 672f81d693a03f80f5ae60bfefacd8a349e76746 -P 1e2c6e134e04dd22795ad4839874ec0edd9b0970 -R 13fbbaba6c965af30dc9b700fce69449 +P 6e787e18fa87f5463bf62cd91a0c0855099693f0 +R c843ef8cfc197304ddaae69605d2f011 U drh -Z caed388eb8a08b03ca62d76237b8b28e +Z 0f5a1e259f27670ef6cc161ed144225c -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) -iD8DBQFKk+LGoxKgR168RlERAowRAJkBTeCELBcU59XsuQvqk9JNNdBFOQCeLBep -wbr+FOU0F0PCobaghDs2Qiw= -=1IT0 +iD8DBQFKk+zxoxKgR168RlERAijqAJ43RxBJwQPCErARYKkGdi8MOrDuKgCaAvhq +0IYbiI92zBuGHT7o+IzNKms= +=uHeB -----END PGP SIGNATURE----- diff --git a/manifest.uuid b/manifest.uuid index 34fc3f0132..8b0663b935 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -6e787e18fa87f5463bf62cd91a0c0855099693f0 \ No newline at end of file +d33b9eb2567561ccfdc588c95604cce9b697d768 \ No newline at end of file diff --git a/src/btree.c b/src/btree.c index e927ba8a54..903b782bcf 100644 --- a/src/btree.c +++ b/src/btree.c @@ -4346,9 +4346,12 @@ int sqlite3BtreeMovetoUnpacked( goto moveto_finish; } rc = accessPayload(pCur, 0, nCell, (unsigned char*)pCellKey, 0); + if( rc ){ + sqlite3_free(pCellKey); + goto moveto_finish; + } c = sqlite3VdbeRecordCompare(nCell, pCellKey, pIdxKey); sqlite3_free(pCellKey); - if( rc ) goto moveto_finish; } } if( c==0 ){ From 560168934cac90045b58f2eb899f167aba347aa0 Mon Sep 17 00:00:00 2001 From: drh Date: Tue, 25 Aug 2009 14:24:04 +0000 Subject: [PATCH 08/14] Make sure that the output of EXPLAIN is right when the P4 argument of an opcode is of type P4_MEM with the MEM having type MEM_Blob. FossilOrigin-Name: 6a623e6cf0370456232497a84366d18fa180debb --- manifest | 18 +++++++++--------- manifest.uuid | 2 +- src/vdbeaux.c | 3 +++ 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/manifest b/manifest index e2d58acfb8..57370cf2cf 100644 --- a/manifest +++ b/manifest @@ -1,8 +1,8 @@ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 -C Avoid\scalling\ssqite3VdbeRecordCompare()\swith\suninitialized\smemory\sfollowing\nan\sOOM.\s\sDoing\sso\sis\sharmless,\sbut\sit\sworries\svalgrind. -D 2009-08-25T13:53:49 +C Make\ssure\sthat\sthe\soutput\sof\sEXPLAIN\sis\sright\swhen\sthe\sP4\sargument\sof\nan\sopcode\sis\sof\stype\sP4_MEM\swith\sthe\sMEM\shaving\stype\sMEM_Blob. +D 2009-08-25T14:24:05 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in 73ddeec9dd10b85876c5c2ce1fdce627e1dcc7f8 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -211,7 +211,7 @@ F src/vdbe.c 464e2e30b1287554a23cdaa0b6b010a9dcb5eb29 F src/vdbe.h 457b6c70f02885cec1f5225b5e6441d067b55d3f F src/vdbeInt.h 831c254a6eef237ef4664c8381a0137586567007 F src/vdbeapi.c 0ab8ada7260b32031ca97f338caecf0812460624 -F src/vdbeaux.c 46c85b2cf1e9c7175aee3b40c9dc9e2bbda7107f +F src/vdbeaux.c 014a60435469fed0b1c2fdf5e4db6273d7632901 F src/vdbeblob.c a3f3e0e877fc64ea50165eec2855f5ada4477611 F src/vdbemem.c c4a5188ff43692f2ca78d3539ad4877e14b70712 F src/vtab.c aedd76e8670d5a5379f93804398d3ba960125547 @@ -750,14 +750,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/vdbe-compress.tcl 672f81d693a03f80f5ae60bfefacd8a349e76746 -P 6e787e18fa87f5463bf62cd91a0c0855099693f0 -R c843ef8cfc197304ddaae69605d2f011 +P d33b9eb2567561ccfdc588c95604cce9b697d768 +R cdd07cee28aacf4af0f9d1f48ec5cddb U drh -Z 0f5a1e259f27670ef6cc161ed144225c +Z 2776bc99d23eafccf549c3762c7feeb6 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) -iD8DBQFKk+zxoxKgR168RlERAijqAJ43RxBJwQPCErARYKkGdi8MOrDuKgCaAvhq -0IYbiI92zBuGHT7o+IzNKms= -=uHeB +iD8DBQFKk/QJoxKgR168RlERAmGHAKCNx7aq1aNIydegMpcEvJaomAhYeACfV0tQ +BHRGLnUTCgB2GRZ9eNE+eVM= +=B2Ti -----END PGP SIGNATURE----- diff --git a/manifest.uuid b/manifest.uuid index 8b0663b935..f6961771fb 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -d33b9eb2567561ccfdc588c95604cce9b697d768 \ No newline at end of file +6a623e6cf0370456232497a84366d18fa180debb \ No newline at end of file diff --git a/src/vdbeaux.c b/src/vdbeaux.c index 7726f1ea5b..76d1d8cbeb 100644 --- a/src/vdbeaux.c +++ b/src/vdbeaux.c @@ -735,6 +735,9 @@ static char *displayP4(Op *pOp, char *zTemp, int nTemp){ sqlite3_snprintf(nTemp, zTemp, "%lld", pMem->u.i); }else if( pMem->flags & MEM_Real ){ sqlite3_snprintf(nTemp, zTemp, "%.16g", pMem->r); + }else{ + assert( pMem->flags & MEM_Blob ); + zP4 = "(blob)"; } break; } From 333ceb9389966f14435e4d53b390a6a238a00feb Mon Sep 17 00:00:00 2001 From: drh Date: Tue, 25 Aug 2009 14:59:37 +0000 Subject: [PATCH 09/14] Attempt to clarify the meaning of a "parameter" in the sqlite3_bind() API documentation. FossilOrigin-Name: 9389e6a7dad7ba70923282d6fe45fbccd22f681e --- manifest | 18 +++++++++--------- manifest.uuid | 2 +- src/sqlite.h.in | 7 ++++--- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/manifest b/manifest index 57370cf2cf..b8d4ba503a 100644 --- a/manifest +++ b/manifest @@ -1,8 +1,8 @@ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 -C Make\ssure\sthat\sthe\soutput\sof\sEXPLAIN\sis\sright\swhen\sthe\sP4\sargument\sof\nan\sopcode\sis\sof\stype\sP4_MEM\swith\sthe\sMEM\shaving\stype\sMEM_Blob. -D 2009-08-25T14:24:05 +C Attempt\sto\sclarify\sthe\smeaning\sof\sa\s"parameter"\sin\sthe\ssqlite3_bind()\sAPI\ndocumentation. +D 2009-08-25T14:59:37 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in 73ddeec9dd10b85876c5c2ce1fdce627e1dcc7f8 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -163,7 +163,7 @@ F src/resolve.c 4a61d03e49b15440878096e6030863fc628828f0 F src/rowset.c c64dafba1f9fd876836c8db8682966b9d197eb1f F src/select.c 67b0778c9585905c8aa75aaa469e76ef3c1d315a F src/shell.c db2643650b9268df89a4bedca3f1c6d9e786f1bb -F src/sqlite.h.in 3ccf717d82101f19548d0b1243f0a6f4854d51ee +F src/sqlite.h.in fdd4e3109e21431797a22e3696d082c271a454fc F src/sqlite3ext.h 1db7d63ab5de4b3e6b83dd03d1a4e64fef6d2a17 F src/sqliteInt.h 20ab1da1a9a652ea673e5bc586382143914381c0 F src/sqliteLimit.h ffe93f5a0c4e7bd13e70cd7bf84cfb5c3465f45d @@ -750,14 +750,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/vdbe-compress.tcl 672f81d693a03f80f5ae60bfefacd8a349e76746 -P d33b9eb2567561ccfdc588c95604cce9b697d768 -R cdd07cee28aacf4af0f9d1f48ec5cddb +P 6a623e6cf0370456232497a84366d18fa180debb +R fcbb968e51afd78ed3c075342c97e2d1 U drh -Z 2776bc99d23eafccf549c3762c7feeb6 +Z f375ffcba1ac2c7cffa691451e61067e -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) -iD8DBQFKk/QJoxKgR168RlERAmGHAKCNx7aq1aNIydegMpcEvJaomAhYeACfV0tQ -BHRGLnUTCgB2GRZ9eNE+eVM= -=B2Ti +iD8DBQFKk/xjoxKgR168RlERAsnbAJ4wPmuxVLQB8GdAW14JVlkINUJ5QwCfYUBz +gzYdveWl3zj0kWAvApoKFIs= +=Gtjj -----END PGP SIGNATURE----- diff --git a/manifest.uuid b/manifest.uuid index f6961771fb..b02765030a 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -6a623e6cf0370456232497a84366d18fa180debb \ No newline at end of file +9389e6a7dad7ba70923282d6fe45fbccd22f681e \ No newline at end of file diff --git a/src/sqlite.h.in b/src/sqlite.h.in index 7212cf66d6..addb893a23 100644 --- a/src/sqlite.h.in +++ b/src/sqlite.h.in @@ -2500,7 +2500,8 @@ typedef struct sqlite3_context sqlite3_context; ** KEYWORDS: {SQL parameter} {SQL parameters} {parameter binding} ** ** In the SQL strings input to [sqlite3_prepare_v2()] and its variants, -** literals may be replaced by a [parameter] in one of these forms: +** literals may be replaced by a [parameter] that matches one of following +** templates: ** **
    **
  • ? @@ -2510,8 +2511,8 @@ typedef struct sqlite3_context sqlite3_context; **
  • $VVV **
** -** In the parameter forms shown above NNN is an integer literal, -** and VVV is an alpha-numeric parameter name. The values of these +** In the templates above, NNN represents an integer literal, +** and VVV represents an alphanumeric identifer. The values of these ** parameters (also called "host parameter names" or "SQL parameters") ** can be set using the sqlite3_bind_*() routines defined here. ** From 011cfca18e23b6b5d34837ef8deab40d1a52800b Mon Sep 17 00:00:00 2001 From: drh Date: Tue, 25 Aug 2009 15:56:51 +0000 Subject: [PATCH 10/14] Initialize variables differently in the range processing logic of where.c in order to make sure variables are always initialized even following an OOM error. FossilOrigin-Name: 3fb3686a4502140720dc3710a28a4f4128ab6554 --- manifest | 18 +++++++++--------- manifest.uuid | 2 +- src/where.c | 11 ++++------- 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/manifest b/manifest index b8d4ba503a..71022e972c 100644 --- a/manifest +++ b/manifest @@ -1,8 +1,8 @@ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 -C Attempt\sto\sclarify\sthe\smeaning\sof\sa\s"parameter"\sin\sthe\ssqlite3_bind()\sAPI\ndocumentation. -D 2009-08-25T14:59:37 +C Initialize\svariables\sdifferently\sin\sthe\srange\sprocessing\slogic\sof\swhere.c\nin\sorder\sto\smake\ssure\svariables\sare\salways\sinitialized\seven\sfollowing\nan\sOOM\serror. +D 2009-08-25T15:56:51 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in 73ddeec9dd10b85876c5c2ce1fdce627e1dcc7f8 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -216,7 +216,7 @@ F src/vdbeblob.c a3f3e0e877fc64ea50165eec2855f5ada4477611 F src/vdbemem.c c4a5188ff43692f2ca78d3539ad4877e14b70712 F src/vtab.c aedd76e8670d5a5379f93804398d3ba960125547 F src/walker.c 1edca756275f158b80f20eb6f104c8d3fcc96a04 -F src/where.c b9ad2d2db4a7d1cda7bed8a7299eb73fde63b5b1 +F src/where.c fc8b33fb469d30c2d933188757ed4d71a775b08a F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2 F test/alias.test 4529fbc152f190268a15f9384a5651bbbabc9d87 F test/all.test 14165b3e32715b700b5f0cbf8f6e3833dda0be45 @@ -750,14 +750,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/vdbe-compress.tcl 672f81d693a03f80f5ae60bfefacd8a349e76746 -P 6a623e6cf0370456232497a84366d18fa180debb -R fcbb968e51afd78ed3c075342c97e2d1 +P 9389e6a7dad7ba70923282d6fe45fbccd22f681e +R ba5f45894b6fc316b385ccdbc215e894 U drh -Z f375ffcba1ac2c7cffa691451e61067e +Z 903cfcbc615b7cc03024df17088e7120 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) -iD8DBQFKk/xjoxKgR168RlERAsnbAJ4wPmuxVLQB8GdAW14JVlkINUJ5QwCfYUBz -gzYdveWl3zj0kWAvApoKFIs= -=Gtjj +iD8DBQFKlAnGoxKgR168RlERAsoLAJ4nH/YFuFnXcU6+a92QUZwF2QQ4ZACeLbl5 +hSBe5ozIRkuFFcem6hDzev0= +=C0Ud -----END PGP SIGNATURE----- diff --git a/manifest.uuid b/manifest.uuid index b02765030a..7c355b3eaf 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -9389e6a7dad7ba70923282d6fe45fbccd22f681e \ No newline at end of file +3fb3686a4502140720dc3710a28a4f4128ab6554 \ No newline at end of file diff --git a/src/where.c b/src/where.c index 8363241562..ba4cb8072c 100644 --- a/src/where.c +++ b/src/where.c @@ -2038,8 +2038,8 @@ static int whereRangeScanEst( if( nEq==0 && p->aSample ){ int iEst; - int iUpper; - int iLower; + int iLower = 0; + int iUpper = SQLITE_INDEX_SAMPLES; u8 aff = p->pTable->aCol[0].affinity; if( pLower ){ @@ -2057,17 +2057,14 @@ static int whereRangeScanEst( goto range_est_fallback; }else if( pLowerVal==0 ){ rc = whereRangeRegion(pParse, p, pUpperVal, &iUpper); - iLower = pLower ? iUpper/2 : 0; + if( pLower ) iLower = iUpper/2; }else if( pUpperVal==0 ){ rc = whereRangeRegion(pParse, p, pLowerVal, &iLower); - iUpper = pUpper ? (iLower + SQLITE_INDEX_SAMPLES + 1)/2 - : SQLITE_INDEX_SAMPLES; + if( pUpper ) iUpper = (iLower + SQLITE_INDEX_SAMPLES + 1)/2; }else{ rc = whereRangeRegion(pParse, p, pUpperVal, &iUpper); if( rc==SQLITE_OK ){ rc = whereRangeRegion(pParse, p, pLowerVal, &iLower); - }else{ - iLower = 0; } } From a8f576126e558971f04efe53ea19227793986a31 Mon Sep 17 00:00:00 2001 From: drh Date: Tue, 25 Aug 2009 16:28:14 +0000 Subject: [PATCH 11/14] Remove an unreachable branch from where.c in order to restore 100% branch test coverage. Add assert() and testcase() macros to verify that the branch is unreachable. FossilOrigin-Name: 58db7e7166ccefef77b237b77e17f47d31ff41e0 --- manifest | 18 +++++++++--------- manifest.uuid | 2 +- src/where.c | 7 ++++--- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/manifest b/manifest index 71022e972c..3e3dffe860 100644 --- a/manifest +++ b/manifest @@ -1,8 +1,8 @@ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 -C Initialize\svariables\sdifferently\sin\sthe\srange\sprocessing\slogic\sof\swhere.c\nin\sorder\sto\smake\ssure\svariables\sare\salways\sinitialized\seven\sfollowing\nan\sOOM\serror. -D 2009-08-25T15:56:51 +C Remove\san\sunreachable\sbranch\sfrom\swhere.c\sin\sorder\sto\srestore\s100%\nbranch\stest\scoverage.\s\sAdd\sassert()\sand\stestcase()\smacros\sto\sverify\nthat\sthe\sbranch\sis\sunreachable. +D 2009-08-25T16:28:14 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in 73ddeec9dd10b85876c5c2ce1fdce627e1dcc7f8 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -216,7 +216,7 @@ F src/vdbeblob.c a3f3e0e877fc64ea50165eec2855f5ada4477611 F src/vdbemem.c c4a5188ff43692f2ca78d3539ad4877e14b70712 F src/vtab.c aedd76e8670d5a5379f93804398d3ba960125547 F src/walker.c 1edca756275f158b80f20eb6f104c8d3fcc96a04 -F src/where.c fc8b33fb469d30c2d933188757ed4d71a775b08a +F src/where.c a3218dfcf32e3d933270b76a72b97065f24b3f2c F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2 F test/alias.test 4529fbc152f190268a15f9384a5651bbbabc9d87 F test/all.test 14165b3e32715b700b5f0cbf8f6e3833dda0be45 @@ -750,14 +750,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/vdbe-compress.tcl 672f81d693a03f80f5ae60bfefacd8a349e76746 -P 9389e6a7dad7ba70923282d6fe45fbccd22f681e -R ba5f45894b6fc316b385ccdbc215e894 +P 3fb3686a4502140720dc3710a28a4f4128ab6554 +R dc2ce485398987f32fbd08b4b9b6e9a2 U drh -Z 903cfcbc615b7cc03024df17088e7120 +Z 0483859ddb44e8db8724d5ac5d7b3598 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) -iD8DBQFKlAnGoxKgR168RlERAsoLAJ4nH/YFuFnXcU6+a92QUZwF2QQ4ZACeLbl5 -hSBe5ozIRkuFFcem6hDzev0= -=C0Ud +iD8DBQFKlBEhoxKgR168RlERAoNOAJwMp0k4JWVXC1dwpKqMRdWTaxDFOgCfQdCh +DU43moi3lq58zHhTjn6ZCMk= +=MsO6 -----END PGP SIGNATURE----- diff --git a/manifest.uuid b/manifest.uuid index 7c355b3eaf..eb5fda7b49 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -3fb3686a4502140720dc3710a28a4f4128ab6554 \ No newline at end of file +58db7e7166ccefef77b237b77e17f47d31ff41e0 \ No newline at end of file diff --git a/src/where.c b/src/where.c index ba4cb8072c..f23133b57e 100644 --- a/src/where.c +++ b/src/where.c @@ -1974,6 +1974,7 @@ static int whereRangeRegion( } } + assert( i>=0 && i<=SQLITE_INDEX_SAMPLES ); *piRegion = i; } return SQLITE_OK; @@ -2069,9 +2070,9 @@ static int whereRangeScanEst( } iEst = iUpper - iLower; - if( iEst>SQLITE_INDEX_SAMPLES ){ - iEst = SQLITE_INDEX_SAMPLES; - }else if( iEst<1 ){ + testcase( iEst==SQLITE_INDEX_SAMPLES ); + assert( iEst<=SQLITE_INDEX_SAMPLES ); + if( iEst<1 ){ iEst = 1; } From 67fba2805541f205749b2bc76cc1e1eba57254d2 Mon Sep 17 00:00:00 2001 From: drh Date: Wed, 26 Aug 2009 00:26:51 +0000 Subject: [PATCH 12/14] Updates to the pluggable page cache documentation. FossilOrigin-Name: 3085ad7612e2c50a2d7906e82b2d057954d9c3f9 --- manifest | 18 +++++----- manifest.uuid | 2 +- src/sqlite.h.in | 89 +++++++++++++++++++++++++------------------------ 3 files changed, 56 insertions(+), 53 deletions(-) diff --git a/manifest b/manifest index 3e3dffe860..498c08a08f 100644 --- a/manifest +++ b/manifest @@ -1,8 +1,8 @@ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 -C Remove\san\sunreachable\sbranch\sfrom\swhere.c\sin\sorder\sto\srestore\s100%\nbranch\stest\scoverage.\s\sAdd\sassert()\sand\stestcase()\smacros\sto\sverify\nthat\sthe\sbranch\sis\sunreachable. -D 2009-08-25T16:28:14 +C Updates\sto\sthe\spluggable\spage\scache\sdocumentation. +D 2009-08-26T00:26:52 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in 73ddeec9dd10b85876c5c2ce1fdce627e1dcc7f8 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -163,7 +163,7 @@ F src/resolve.c 4a61d03e49b15440878096e6030863fc628828f0 F src/rowset.c c64dafba1f9fd876836c8db8682966b9d197eb1f F src/select.c 67b0778c9585905c8aa75aaa469e76ef3c1d315a F src/shell.c db2643650b9268df89a4bedca3f1c6d9e786f1bb -F src/sqlite.h.in fdd4e3109e21431797a22e3696d082c271a454fc +F src/sqlite.h.in 9d03ceaad971882482c158c0e3d39d361c2c18a1 F src/sqlite3ext.h 1db7d63ab5de4b3e6b83dd03d1a4e64fef6d2a17 F src/sqliteInt.h 20ab1da1a9a652ea673e5bc586382143914381c0 F src/sqliteLimit.h ffe93f5a0c4e7bd13e70cd7bf84cfb5c3465f45d @@ -750,14 +750,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/vdbe-compress.tcl 672f81d693a03f80f5ae60bfefacd8a349e76746 -P 3fb3686a4502140720dc3710a28a4f4128ab6554 -R dc2ce485398987f32fbd08b4b9b6e9a2 +P 58db7e7166ccefef77b237b77e17f47d31ff41e0 +R 9f12b5b75ef341ad213d2e64e3b8bf27 U drh -Z 0483859ddb44e8db8724d5ac5d7b3598 +Z 1d42b9a29de3d8a356c2ced8b35a64c1 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) -iD8DBQFKlBEhoxKgR168RlERAoNOAJwMp0k4JWVXC1dwpKqMRdWTaxDFOgCfQdCh -DU43moi3lq58zHhTjn6ZCMk= -=MsO6 +iD8DBQFKlIFPoxKgR168RlERAk9bAJ0VKEBOAKWI3SN/4tpXs8KZIAdMzACgir+A +32mtwR9OZj3gr61fgTQ88fE= +=+tcK -----END PGP SIGNATURE----- diff --git a/manifest.uuid b/manifest.uuid index eb5fda7b49..fea0005d9e 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -58db7e7166ccefef77b237b77e17f47d31ff41e0 \ No newline at end of file +3085ad7612e2c50a2d7906e82b2d057954d9c3f9 \ No newline at end of file diff --git a/src/sqlite.h.in b/src/sqlite.h.in index addb893a23..eabed6e710 100644 --- a/src/sqlite.h.in +++ b/src/sqlite.h.in @@ -5251,6 +5251,7 @@ typedef struct sqlite3_pcache sqlite3_pcache; /* ** CAPI3REF: Application Defined Page Cache. +** KEYWORDS: {page cache} ** EXPERIMENTAL ** ** The [sqlite3_config]([SQLITE_CONFIG_PCACHE], ...) interface can @@ -5260,12 +5261,14 @@ typedef struct sqlite3_pcache sqlite3_pcache; ** from, or ready to be written to, the database file. By implementing a ** custom page cache using this API, an application can control more ** precisely the amount of memory consumed by SQLite, the way in which -** said memory is allocated and released, and the policies used to +** that memory is allocated and released, and the policies used to ** determine exactly which parts of a database file are cached and for ** how long. ** -** The contents of the structure are copied to an internal buffer by SQLite -** within the call to [sqlite3_config]. +** The contents of the sqlite3_pcache_methods structure are copied to an +** internal buffer by SQLite within the call to [sqlite3_config]. Hence +** the application may discard the parameter after the call to +** [sqlite3_config()] returns. ** ** The xInit() method is called once for each call to [sqlite3_initialize()] ** (usually only once during the lifetime of the process). It is passed @@ -5286,71 +5289,71 @@ typedef struct sqlite3_pcache sqlite3_pcache; ** SQLite will never invoke xInit() more than once without an intervening ** call to xShutdown(). ** -** The xCreate() method is used to construct a new cache instance. The +** The xCreate() method is used to construct a new cache instance. SQLite +** will typically create one cache instance for each open database file, +** though this is not guaranteed. The ** first parameter, szPage, is the size in bytes of the pages that must -** be allocated by the cache. szPage will not be a power of two. The -** second argument, bPurgeable, is true if the cache being created will -** be used to cache database pages read from a file stored on disk, or +** be allocated by the cache. szPage will not be a power of two. szPage +** will the page size of the database file that is to be cached plus an +** increment (here called "R") of about 100 or 200. SQLite will use the +** extra R bytes on each page to store metadata about the underlying +** database page on disk. The value of R depends +** on the SQLite version, the target platform, and how SQLite was compiled. +** R is constant for a particular build of SQLite. The second argument to +** xCreate(), bPurgeable, is true if the cache being created will +** be used to cache database pages of a file stored on disk, or ** false if it is used for an in-memory database. The cache implementation -** does not have to do anything special based on the value of bPurgeable, -** it is purely advisory. +** does not have to do anything special based with the value of bPurgeable; +** it is purely advisory. On a cache where bPurgeable is false, SQLite will +** never invoke xUnpin() except to deliberately delete a page. +** In other words, a cache created with bPurgeable set to false will +** never contain any unpinned pages. ** ** The xCachesize() method may be called at any time by SQLite to set the ** suggested maximum cache-size (number of pages stored by) the cache ** instance passed as the first argument. This is the value configured using ** the SQLite "[PRAGMA cache_size]" command. As with the bPurgeable parameter, -** the implementation is not required to do anything special with this -** value, it is advisory only. +** the implementation is not required to do anything with this +** value; it is advisory only. ** ** The xPagecount() method should return the number of pages currently -** stored in the cache supplied as an argument. +** stored in the cache. ** ** The xFetch() method is used to fetch a page and return a pointer to it. ** A 'page', in this context, is a buffer of szPage bytes aligned at an ** 8-byte boundary. The page to be fetched is determined by the key. The ** mimimum key value is 1. After it has been retrieved using xFetch, the page -** is considered to be pinned. +** is considered to be "pinned". ** -** If the requested page is already in the page cache, then a pointer to -** the cached buffer should be returned with its contents intact. If the -** page is not already in the cache, then the expected behaviour of the -** cache is determined by the value of the createFlag parameter passed -** to xFetch, according to the following table: +** If the requested page is already in the page cache, then the page cache +** implementation must return a pointer to the page buffer with its content +** intact. If the requested page is not already in the cache, then the +** behavior of the cache implementation is determined by the value of the +** createFlag parameter passed to xFetch, according to the following table: ** ** -**
createFlagExpected Behaviour -**
0NULL should be returned. No new cache entry is created. -**
1If createFlag is set to 1, this indicates that -** SQLite is holding pinned pages that can be unpinned -** by writing their contents to the database file (a -** relatively expensive operation). In this situation the -** cache implementation has two choices: it can return NULL, -** in which case SQLite will attempt to unpin one or more -** pages before re-requesting the same page, or it can -** allocate a new page and return a pointer to it. If a new -** page is allocated, then the first sizeof(void*) bytes of -** it (at least) must be zeroed before it is returned. -**
2If createFlag is set to 2, then SQLite is not holding any -** pinned pages associated with the specific cache passed -** as the first argument to xFetch() that can be unpinned. The -** cache implementation should attempt to allocate a new -** cache entry and return a pointer to it. Again, the first -** sizeof(void*) bytes of the page should be zeroed before -** it is returned. If the xFetch() method returns NULL when -** createFlag==2, SQLite assumes that a memory allocation -** failed and returns SQLITE_NOMEM to the user. +**
createFlag Behaviour when page is not already in cache +**
0 Do not allocate a new page. Return NULL. +**
1 Allocate a new page if it easy and convenient to do so. +** Otherwise return NULL. +**
2 Make every effort to allocate a new page. Only return +** NULL if allocating a new page is effectively impossible. **
** +** SQLite will normally invoke xFetch() with a createFlag of 0 or 1. If +** a call to xFetch() with createFlag==1 returns NULL, then SQLite will +** attempt to unpin one or more cache pages by spilling the content of +** pinned pages to disk and synching the operating system disk cache. After +** attempting to unpin pages, the xFetch() method will be invoked again with +** a createFlag of 2. +** ** xUnpin() is called by SQLite with a pointer to a currently pinned page ** as its second argument. If the third parameter, discard, is non-zero, ** then the page should be evicted from the cache. In this case SQLite ** assumes that the next time the page is retrieved from the cache using ** the xFetch() method, it will be zeroed. If the discard parameter is ** zero, then the page is considered to be unpinned. The cache implementation -** may choose to reclaim (free or recycle) unpinned pages at any time. -** SQLite assumes that next time the page is retrieved from the cache -** it will either be zeroed, or contain the same data that it did when it -** was unpinned. +** may choose to evict unpinned pages at any time. ** ** The cache is not required to perform any reference counting. A single ** call to xUnpin() unpins the page regardless of the number of prior calls From 2238dcccc747782d09d178800e1aaf86ab63e96a Mon Sep 17 00:00:00 2001 From: drh Date: Thu, 27 Aug 2009 17:56:20 +0000 Subject: [PATCH 13/14] Patch to the named semaphore locking mechanism used by VxWorks. FossilOrigin-Name: 609c5341bea16e4e8bcd15388b209c753ca9e0bb --- manifest | 18 +++++++++--------- manifest.uuid | 2 +- src/os_unix.c | 6 +++--- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/manifest b/manifest index 498c08a08f..034d565a41 100644 --- a/manifest +++ b/manifest @@ -1,8 +1,8 @@ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 -C Updates\sto\sthe\spluggable\spage\scache\sdocumentation. -D 2009-08-26T00:26:52 +C Patch\sto\sthe\snamed\ssemaphore\slocking\smechanism\sused\sby\sVxWorks. +D 2009-08-27T17:56:21 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in 73ddeec9dd10b85876c5c2ce1fdce627e1dcc7f8 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -147,7 +147,7 @@ F src/os.c 9fea283e336ee31caa4654d6cb05a129a1c42d2f F src/os.h 00a1334a4eecee7f7bef79ac606b88d325119f21 F src/os_common.h 8c61457df58f1a4bd5f5adc3e90e01b37bf7afbc F src/os_os2.c bed77dc26e3a95ce4a204936b9a1ca6fe612fcc5 -F src/os_unix.c 96e2e409df8851a31fdb2d7430ad73fea7b0a104 +F src/os_unix.c f14ff07aec3c3c0796e1a743d1bdafddc15d1af1 F src/os_win.c 58bb163f327e79726dd119344d908e4d98483c3f F src/pager.c a47be286477ed6c7b9a342dd53d4e4043f29d8c2 F src/pager.h 11852d044c86cf5a9d6e34171fb0c4fcf1f6265f @@ -750,14 +750,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/vdbe-compress.tcl 672f81d693a03f80f5ae60bfefacd8a349e76746 -P 58db7e7166ccefef77b237b77e17f47d31ff41e0 -R 9f12b5b75ef341ad213d2e64e3b8bf27 +P 3085ad7612e2c50a2d7906e82b2d057954d9c3f9 +R eb6cdaf2b41f45632e4ffa41607deedf U drh -Z 1d42b9a29de3d8a356c2ced8b35a64c1 +Z 5b4ebf8fbae5e7723a0a2368612970c6 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) -iD8DBQFKlIFPoxKgR168RlERAk9bAJ0VKEBOAKWI3SN/4tpXs8KZIAdMzACgir+A -32mtwR9OZj3gr61fgTQ88fE= -=+tcK +iD8DBQFKlsjJoxKgR168RlERAssgAJ92pcc54lz5EchnTROW+NqcjQPjwgCfQfd4 +nM1PY4vHFHDUwnaKpIG1j/A= +=7GYl -----END PGP SIGNATURE----- diff --git a/manifest.uuid b/manifest.uuid index fea0005d9e..438c537a17 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -3085ad7612e2c50a2d7906e82b2d057954d9c3f9 \ No newline at end of file +609c5341bea16e4e8bcd15388b209c753ca9e0bb \ No newline at end of file diff --git a/src/os_unix.c b/src/os_unix.c index b88cc7a8b7..15bd8cc638 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -764,7 +764,7 @@ struct unixOpenCnt { UnixUnusedFd *pUnused; /* Unused file descriptors to close */ #if OS_VXWORKS sem_t *pSem; /* Named POSIX semaphore */ - char aSemName[MAX_PATHNAME+1]; /* Name of that semaphore */ + char aSemName[MAX_PATHNAME+2]; /* Name of that semaphore */ #endif struct unixOpenCnt *pNext, *pPrev; /* List of all unixOpenCnt objects */ }; @@ -3536,9 +3536,9 @@ static int fillInUnixFile( if( (rc==SQLITE_OK) && (pNew->pOpen->pSem==NULL) ){ char *zSemName = pNew->pOpen->aSemName; int n; - sqlite3_snprintf(MAX_PATHNAME, zSemName, "%s.sem", + sqlite3_snprintf(MAX_PATHNAME, zSemName, "/%s.sem", pNew->pId->zCanonicalName); - for( n=0; zSemName[n]; n++ ) + for( n=1; zSemName[n]; n++ ) if( zSemName[n]=='/' ) zSemName[n] = '_'; pNew->pOpen->pSem = sem_open(zSemName, O_CREAT, 0666, 1); if( pNew->pOpen->pSem == SEM_FAILED ){ From 5d00d0a8dcb4d9c46164d18c614296ad1fc5db0a Mon Sep 17 00:00:00 2001 From: drh Date: Fri, 28 Aug 2009 00:49:03 +0000 Subject: [PATCH 14/14] Add a new source code logo gif. FossilOrigin-Name: 6abcba1021b237452f542f1fbb69eb75d9f50f53 --- art/src_logo.gif | Bin 0 -> 3348 bytes manifest | 17 +++++++++-------- manifest.uuid | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) create mode 100644 art/src_logo.gif diff --git a/art/src_logo.gif b/art/src_logo.gif new file mode 100644 index 0000000000000000000000000000000000000000..c63ff6dcd121d839fd6698942115a058dbd043e8 GIT binary patch literal 3348 zcmV+v4eRnpNk%w1VMhUB0OJq<`~3Xk>gd_z;l$O@&)wPR@9lo1n3A%nwadh%z_;`E z_3rcW`1<+w`1k++|NZ^_EC2ui07n5~000F3(8)=wy*TU5yZ>M)j$~<`XsWJk>%MR- zn@>R?Nv}Ja7Zi~k4Q%VaWFWa(C7gnSR}95tajUa5E9X__<2YW7~Hga%}y4Y z zd6}rGswfK!rz#Aj6a)qZtGBqhTmVhBy1&4D4+;SU12|KaM1Zxy&d*skOk)VjLVyQB z(A(TF4-3L(2YVB%5aB>)W`U<2#<`Wy_Bay&i)IYCE4lo@Ln9w2a{ zZJ)!3{+{q4P(ay&cM=hD64H>1?|Cr$+`6A}a%TXLSvUp(a0!Tz4VQAd8ifk^ zUd1d*^K=BdKS7ZEJQ)ES1pbgx2z&hpTMHc(a)S;%sP=+1vrRD{2j3Jhp%LbU0U$S9 zjiFu#$JK^Hfde@>g8-h5alnQvpa{kU66aPRD-sb=cxCiJfFZ3| zXabpY+U2MPMTPNW2suLW;RfBE3QT7uN)T$D8|4S4q8xxlotP>F5FP?QxZ(nWOI1bY(nfmI0zBpj|2G!QBRJ9crW0kFF8#+-KO^uf2%mM|_E zeOizqn1QbH27eSN0A{xoum@eT8^{XRs51N+#{k%hQ0lG)05Hr#Q%Pj8C^7*6zGVh*DT98TL5JWLyu!OG3Se>v7RxcfX1XqguLR3-#e#eu9BTlfshAZh zjy6}EVss-!o97Hss)$#v;@s8lyFVkPU${kZ3a-4kb;%368a&XW6VHb56d9^wk<_=S z4QIk81Gg&y$_A8u0o+f>T?DZP@GFefY*s+#$5us1uWoKrFkMKWUeQ{$;SDge1zU>| z*9HnjVYlJ_W9Ti!m1WelfWmy(8V1i2M80!E{!-_g4JKl69MQr=f{Yjm)C28n- z>Bzb@hR8B7pq~_#_Ar3$`NmfW5Ho-`M#KW!HDBuO<<;6TFH;Uw)RzqNHF7M|8Ce)L z>TFlUCjgN65{w7yQnt9G^a22rmI?L+^_A^)gpP+c>E#q)z&qT73ekxnY!?uo7^v2- z#2iL)@gjjFk^wo~xi2IVP{8mqvVy>Y2`?v^kV(Qsfv-(LDrb`j0q~{4a~usY)N7KL z7DxiT*)4u6(*T)B=Ku>f4Ir07gfh?uro?$5DY(fVMi@vlv>0$d+R##a(5EaEaqkx~ zlt})U6lk9kaM4ttq8$rnQzxszBLP&DK+Bjj58i+&dk!eo0gU)IywS@|r~%&YE|tSe zjE#0Hv0A!JBL+p?iH9cWjxSo+sVfS~eQCr%1FqwerIjua0L+#k$w9x9^bZ3C5Ktis zfCxnt<^g@Q#P?3Ou?R)71Kg2=Mh>}xFYX6gow`=7F33a*Owt{K`;i=V$C3yEsFO&# zk@?_K2Oj7#6^DyLQ*;#t&CR6(xZ~NKdKm(H$pI8*l)^J55KcB`Kug_ON&wu35zR$2 zJq~z4M0B};Qj<~ zG;ewb1I{x_CHw`a-_YcEu4!L2w{azHcxIdw_)?t+IsyHlbeA-=Wpi*tM+vZPq;Zto zIrmjlmW;!7v*A`8Pg2mBh-OWad*v!{x1rg*)B(I}3f)-g0R23!15;(?x@r+iGCYo& zMVtWMB8p49Jk>FC^Gu|oM8H2ZW_XpN2sg}!kFGwUs1%6aKpGkbY3YZdAIK`9Zu2wG z;4`Nls<-0^0I=iX)LH|PfCyq>IdVu1cHQup7TD6co*}CSW+SbHo|d&M&<`TjCc zQyF$8!>7Kuls;}XcK`?#Z!6G`?!3kiv5d+JNG2?wf@!?2;uAT;a4G}0;7;mg2h!_L7rjBrjTZooadZZa@yQG(IiA~suoAW;S6%3A4m_BNs*zD?b0U{H>jd$f zykf^sD5C*c49|7#oX!KW*nt;lwG@JzT}Tb3M_7txmNh`0rMQh_93kZbQY)zoTH6T` z^Pyd+FdqiU*wqo11F8cZEQ<9IwHh#AmW8cF6WrJUgg2 zxyz}F6O#waZfjh+6I4Yk+x|MK`P$%JG}VG*iDXaa1_5J=zHPMuA^y|1i;!m4iFmH68IyfY6sHe>A>Dl&CKKi%#}P(fRbdO0@B9>ccrZ?X)4zn5l>E- z30%F)Sk<~>a-GY-3IqXY_%Fx($KEr1r+ybaR47KHa?F>a?MO(@2Xuxg$I0v8uIHf1eH*A4~-c-nyl zUH}Jr)Cl*d4qHVr|Ahd=fHiI00}YHw>^@b~Y2chKETI2B;7PDDVU@fGCaiHoHfN zmM{jF5CA~k1QTG1iU^Fs_=>(*0mm4NvIvUGNQ{ee64?ia{n)Mvb9pjoX-w@hFeoD2l>J zjQ7Zm$moo{h>!f3kNTL88*vi-aWK~Bj+4lXuIP^e$&lm7kMsD87l4lS_>kPVkQe!n z`nUl%rEp46EC`7S_Nb8=*^nh^krPRdD5(J$NsshMi5$?8pz&=&7m|fYk}g@1I;oQ_ zd5tQ$jT_06IJuKT362~YLKQ&OXf5Kvykt@jo&6tx>`H~PBlW_17i}8p| z*@*x-kDeHoL|K$r8I(XNl~-AmCYh6Kx0NtaGrsqgt!R|zIF{cCk$Gv3DQTDW2#s_DxtOwbQG{7HiP@QKKzM`HBTMO- zq$vaFkuG32nx(m#EJ{(S5raoI(&#swtet eNh*D%hR3;_G