Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Merge the latest trunk changes into the sessions branch. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | sessions |
Files: | files | file ages | folders |
SHA1: |
832886b1e6edb916d9824924c7d88202 |
User & Date: | drh 2011-05-30 13:39:20.980 |
Context
2011-06-20
| ||
10:44 | Merge the latest trunk changes into the sessions branch. (check-in: 4c5e276c90 user: drh tags: sessions) | |
2011-05-30
| ||
13:39 | Merge the latest trunk changes into the sessions branch. (check-in: 832886b1e6 user: drh tags: sessions) | |
2011-05-28
| ||
19:24 | Fix a "#ifdef" from check-in [03f7d36a8a] that should have been "#ifndef". (check-in: edb865c354 user: drh tags: trunk) | |
2011-05-19
| ||
02:48 | Merge all the latest trunk changes into the sessions branch, especially the disappearing WAL transaction fix. (check-in: 5b1b536cf8 user: drh tags: sessions) | |
Changes
Changes to ext/fts3/fts3.c.
︙ | ︙ | |||
973 974 975 976 977 978 979 980 981 982 983 984 985 986 | p->nPendingData = 0; p->azColumn = (char **)&p[1]; p->pTokenizer = pTokenizer; p->nNodeSize = 1000; p->nMaxPendingData = FTS3_MAX_PENDING_DATA; p->bHasDocsize = (isFts4 && bNoDocsize==0); p->bHasStat = isFts4; fts3HashInit(&p->pendingTerms, FTS3_HASH_STRING, 1); /* Fill in the zName and zDb fields of the vtab structure. */ zCsr = (char *)&p->azColumn[nCol]; p->zName = zCsr; memcpy(zCsr, argv[2], nName); zCsr += nName; | > > | 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 | p->nPendingData = 0; p->azColumn = (char **)&p[1]; p->pTokenizer = pTokenizer; p->nNodeSize = 1000; p->nMaxPendingData = FTS3_MAX_PENDING_DATA; p->bHasDocsize = (isFts4 && bNoDocsize==0); p->bHasStat = isFts4; TESTONLY( p->inTransaction = -1 ); TESTONLY( p->mxSavepoint = -1 ); fts3HashInit(&p->pendingTerms, FTS3_HASH_STRING, 1); /* Fill in the zName and zDb fields of the vtab structure. */ zCsr = (char *)&p->azColumn[nCol]; p->zName = zCsr; memcpy(zCsr, argv[2], nName); zCsr += nName; |
︙ | ︙ | |||
3270 3271 3272 3273 3274 3275 3276 | } /* ** Implementation of xBegin() method. This is a no-op. */ static int fts3BeginMethod(sqlite3_vtab *pVtab){ UNUSED_PARAMETER(pVtab); | > | > > > > | > > > > | > > > | 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 | } /* ** Implementation of xBegin() method. This is a no-op. */ static int fts3BeginMethod(sqlite3_vtab *pVtab){ UNUSED_PARAMETER(pVtab); TESTONLY( Fts3Table *p = (Fts3Table*)pVtab ); assert( p->nPendingData==0 ); assert( p->inTransaction!=1 ); TESTONLY( p->inTransaction = 1 ); TESTONLY( p->mxSavepoint = -1; ); return SQLITE_OK; } /* ** Implementation of xCommit() method. This is a no-op. The contents of ** the pending-terms hash-table have already been flushed into the database ** by fts3SyncMethod(). */ static int fts3CommitMethod(sqlite3_vtab *pVtab){ UNUSED_PARAMETER(pVtab); TESTONLY( Fts3Table *p = (Fts3Table*)pVtab ); assert( p->nPendingData==0 ); assert( p->inTransaction!=0 ); TESTONLY( p->inTransaction = 0 ); TESTONLY( p->mxSavepoint = -1; ); return SQLITE_OK; } /* ** Implementation of xRollback(). Discard the contents of the pending-terms ** hash-table. Any changes made to the database are reverted by SQLite. */ static int fts3RollbackMethod(sqlite3_vtab *pVtab){ Fts3Table *p = (Fts3Table*)pVtab; sqlite3Fts3PendingTermsClear(p); assert( p->inTransaction!=0 ); TESTONLY( p->inTransaction = 0 ); TESTONLY( p->mxSavepoint = -1; ); return SQLITE_OK; } /* ** Load the doclist associated with expression pExpr to pExpr->aDoclist. ** The loaded doclist contains positions as well as the document ids. ** This is used by the matchinfo(), snippet() and offsets() auxillary |
︙ | ︙ | |||
3646 3647 3648 3649 3650 3651 3652 | "ALTER TABLE %Q.'%q_segdir' RENAME TO '%q_segdir';", p->zDb, p->zName, zName ); return rc; } static int fts3SavepointMethod(sqlite3_vtab *pVtab, int iSavepoint){ | > > > > > | > > > > > > > > > > > | | 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 | "ALTER TABLE %Q.'%q_segdir' RENAME TO '%q_segdir';", p->zDb, p->zName, zName ); return rc; } static int fts3SavepointMethod(sqlite3_vtab *pVtab, int iSavepoint){ Fts3Table *p = (Fts3Table*)pVtab; UNUSED_PARAMETER(iSavepoint); assert( p->inTransaction ); assert( p->mxSavepoint < iSavepoint ); TESTONLY( p->mxSavepoint = iSavepoint ); return sqlite3Fts3PendingTermsFlush(p); } static int fts3ReleaseMethod(sqlite3_vtab *pVtab, int iSavepoint){ TESTONLY( Fts3Table *p = (Fts3Table*)pVtab ); UNUSED_PARAMETER(iSavepoint); UNUSED_PARAMETER(pVtab); assert( p->inTransaction ); assert( p->mxSavepoint >= iSavepoint ); TESTONLY( p->mxSavepoint = iSavepoint-1 ); return SQLITE_OK; } static int fts3RollbackToMethod(sqlite3_vtab *pVtab, int iSavepoint){ Fts3Table *p = (Fts3Table*)pVtab; UNUSED_PARAMETER(iSavepoint); assert( p->inTransaction ); assert( p->mxSavepoint >= iSavepoint ); TESTONLY( p->mxSavepoint = iSavepoint ); sqlite3Fts3PendingTermsClear(p); return SQLITE_OK; } static const sqlite3_module fts3Module = { /* iVersion */ 2, /* xCreate */ fts3CreateMethod, /* xConnect */ fts3ConnectMethod, |
︙ | ︙ |
Changes to ext/fts3/fts3Int.h.
︙ | ︙ | |||
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | /* ** Internal types used by SQLite. */ typedef unsigned char u8; /* 1-byte (or larger) unsigned integer */ typedef short int i16; /* 2-byte (or larger) signed integer */ typedef unsigned int u32; /* 4-byte unsigned integer */ typedef sqlite3_uint64 u64; /* 8-byte unsigned integer */ /* ** Macro used to suppress compiler warnings for unused parameters. */ #define UNUSED_PARAMETER(x) (void)(x) #endif typedef struct Fts3Table Fts3Table; typedef struct Fts3Cursor Fts3Cursor; typedef struct Fts3Expr Fts3Expr; typedef struct Fts3Phrase Fts3Phrase; typedef struct Fts3PhraseToken Fts3PhraseToken; | > > > > > > > > > > > > > > > > > > > > | 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | /* ** Internal types used by SQLite. */ typedef unsigned char u8; /* 1-byte (or larger) unsigned integer */ typedef short int i16; /* 2-byte (or larger) signed integer */ typedef unsigned int u32; /* 4-byte unsigned integer */ typedef sqlite3_uint64 u64; /* 8-byte unsigned integer */ /* ** Macro used to suppress compiler warnings for unused parameters. */ #define UNUSED_PARAMETER(x) (void)(x) /* ** Activate assert() only if SQLITE_TEST is enabled. */ #if !defined(NDEBUG) && !defined(SQLITE_DEBUG) # define NDEBUG 1 #endif /* ** The TESTONLY macro is used to enclose variable declarations or ** other bits of code that are needed to support the arguments ** within testcase() and assert() macros. */ #if defined(SQLITE_DEBUG) || defined(SQLITE_COVERAGE_TEST) # define TESTONLY(X) X #else # define TESTONLY(X) #endif #endif /* SQLITE_AMALGAMATION */ typedef struct Fts3Table Fts3Table; typedef struct Fts3Cursor Fts3Cursor; typedef struct Fts3Expr Fts3Expr; typedef struct Fts3Phrase Fts3Phrase; typedef struct Fts3PhraseToken Fts3PhraseToken; |
︙ | ︙ | |||
147 148 149 150 151 152 153 154 155 156 157 158 159 160 | ** automatically. Variable iPrevDocid is the docid of the most recently ** inserted record. */ int nMaxPendingData; int nPendingData; sqlite_int64 iPrevDocid; Fts3Hash pendingTerms; }; /* ** When the core wants to read from the virtual table, it creates a ** virtual table cursor (an instance of the following structure) using ** the xOpen method. Cursors are destroyed using the xClose method. */ | > > > > > > > > > > | 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 | ** automatically. Variable iPrevDocid is the docid of the most recently ** inserted record. */ int nMaxPendingData; int nPendingData; sqlite_int64 iPrevDocid; Fts3Hash pendingTerms; #if defined(SQLITE_DEBUG) /* State variables used for validating that the transaction control ** methods of the virtual table are called at appropriate times. These ** values do not contribution to the FTS computation; they are used for ** verifying the SQLite core. */ int inTransaction; /* True after xBegin but before xCommit/xRollback */ int mxSavepoint; /* Largest valid xSavepoint integer */ #endif }; /* ** When the core wants to read from the virtual table, it creates a ** virtual table cursor (an instance of the following structure) using ** the xOpen method. Cursors are destroyed using the xClose method. */ |
︙ | ︙ |
Changes to ext/fts3/fts3_aux.c.
︙ | ︙ | |||
338 339 340 341 342 343 344 345 346 347 348 349 350 351 | ){ Fts3auxCursor *pCsr = (Fts3auxCursor *)pCursor; Fts3Table *pFts3 = ((Fts3auxTable *)pCursor->pVtab)->pFts3Tab; int rc; int isScan; UNUSED_PARAMETER(nVal); assert( idxStr==0 ); assert( idxNum==FTS4AUX_EQ_CONSTRAINT || idxNum==0 || idxNum==FTS4AUX_LE_CONSTRAINT || idxNum==FTS4AUX_GE_CONSTRAINT || idxNum==(FTS4AUX_LE_CONSTRAINT|FTS4AUX_GE_CONSTRAINT) ); isScan = (idxNum!=FTS4AUX_EQ_CONSTRAINT); | > | 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 | ){ Fts3auxCursor *pCsr = (Fts3auxCursor *)pCursor; Fts3Table *pFts3 = ((Fts3auxTable *)pCursor->pVtab)->pFts3Tab; int rc; int isScan; UNUSED_PARAMETER(nVal); UNUSED_PARAMETER(idxStr); assert( idxStr==0 ); assert( idxNum==FTS4AUX_EQ_CONSTRAINT || idxNum==0 || idxNum==FTS4AUX_LE_CONSTRAINT || idxNum==FTS4AUX_GE_CONSTRAINT || idxNum==(FTS4AUX_LE_CONSTRAINT|FTS4AUX_GE_CONSTRAINT) ); isScan = (idxNum!=FTS4AUX_EQ_CONSTRAINT); |
︙ | ︙ | |||
455 456 457 458 459 460 461 | fts3auxRowidMethod, /* xRowid */ 0, /* xUpdate */ 0, /* xBegin */ 0, /* xSync */ 0, /* xCommit */ 0, /* xRollback */ 0, /* xFindFunction */ | | > > > | 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 | fts3auxRowidMethod, /* xRowid */ 0, /* xUpdate */ 0, /* xBegin */ 0, /* xSync */ 0, /* xCommit */ 0, /* xRollback */ 0, /* xFindFunction */ 0, /* xRename */ 0, /* xSavepoint */ 0, /* xRelease */ 0 /* xRollbackTo */ }; int rc; /* Return code */ rc = sqlite3_create_module(db, "fts4aux", &fts3aux_module, 0); return rc; } #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */ |
Changes to ext/rtree/rtree.c.
︙ | ︙ | |||
2845 2846 2847 2848 2849 2850 2851 | rc = sqlite3_exec(pRtree->db, zSql, 0, 0, 0); sqlite3_free(zSql); } return rc; } static sqlite3_module rtreeModule = { | | | > > > | 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 | rc = sqlite3_exec(pRtree->db, zSql, 0, 0, 0); sqlite3_free(zSql); } return rc; } static sqlite3_module rtreeModule = { 0, /* iVersion */ rtreeCreate, /* xCreate - create a table */ rtreeConnect, /* xConnect - connect to an existing table */ rtreeBestIndex, /* xBestIndex - Determine search strategy */ rtreeDisconnect, /* xDisconnect - Disconnect from a table */ rtreeDestroy, /* xDestroy - Drop a table */ rtreeOpen, /* xOpen - open a cursor */ rtreeClose, /* xClose - close a cursor */ rtreeFilter, /* xFilter - configure scan constraints */ rtreeNext, /* xNext - advance a cursor */ rtreeEof, /* xEof */ rtreeColumn, /* xColumn - read data */ rtreeRowid, /* xRowid - read data */ rtreeUpdate, /* xUpdate - write data */ 0, /* xBegin - begin transaction */ 0, /* xSync - sync transaction */ 0, /* xCommit - commit transaction */ 0, /* xRollback - rollback transaction */ 0, /* xFindFunction - function overloading */ rtreeRename, /* xRename - rename the table */ 0, /* xSavepoint */ 0, /* xRelease */ 0 /* xRollbackTo */ }; static int rtreeSqlInit( Rtree *pRtree, sqlite3 *db, const char *zDb, const char *zPrefix, |
︙ | ︙ |
Changes to src/pager.c.
︙ | ︙ | |||
5751 5752 5753 5754 5755 5756 5757 | if( pList==0 ){ /* Must have at least one page for the WAL commit flag. ** Ticket [2d1a5c67dfc2363e44f29d9bbd57f] 2011-05-18 */ rc = sqlite3PagerGet(pPager, 1, &pPageOne); pList = pPageOne; pList->pDirty = 0; } | | | | 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 | if( pList==0 ){ /* Must have at least one page for the WAL commit flag. ** Ticket [2d1a5c67dfc2363e44f29d9bbd57f] 2011-05-18 */ rc = sqlite3PagerGet(pPager, 1, &pPageOne); pList = pPageOne; pList->pDirty = 0; } assert( rc==SQLITE_OK ); if( ALWAYS(pList) ){ rc = pagerWalFrames(pPager, pList, pPager->dbSize, 1, (pPager->fullSync ? pPager->syncFlags : 0) ); } sqlite3PagerUnref(pPageOne); if( rc==SQLITE_OK ){ sqlite3PcacheCleanAll(pPager->pPCache); |
︙ | ︙ |
Changes to src/pcache.c.
︙ | ︙ | |||
249 250 251 252 253 254 255 256 257 258 259 260 261 262 | ); pCache->pSynced = pPg; if( !pPg ){ for(pPg=pCache->pDirtyTail; pPg && pPg->nRef; pPg=pPg->pDirtyPrev); } if( pPg ){ int rc; rc = pCache->xStress(pCache->pStress, pPg); if( rc!=SQLITE_OK && rc!=SQLITE_BUSY ){ return rc; } } pPage = sqlite3GlobalConfig.pcache.xFetch(pCache->pCache, pgno, 2); | > > > > > > > | 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 | ); pCache->pSynced = pPg; if( !pPg ){ for(pPg=pCache->pDirtyTail; pPg && pPg->nRef; pPg=pPg->pDirtyPrev); } if( pPg ){ int rc; #ifdef SQLITE_LOG_CACHE_SPILL sqlite3_log(SQLITE_FULL, "spill page %d making room for %d - cache used: %d/%d", pPg->pgno, pgno, sqlite3GlobalConfig.pcache.xPagecount(pCache->pCache), pCache->nMax); #endif rc = pCache->xStress(pCache->pStress, pPg); if( rc!=SQLITE_OK && rc!=SQLITE_BUSY ){ return rc; } } pPage = sqlite3GlobalConfig.pcache.xFetch(pCache->pCache, pgno, 2); |
︙ | ︙ |
Changes to src/sqlite.h.in.
︙ | ︙ | |||
755 756 757 758 759 760 761 | ** ** Mutexes are created using [sqlite3_mutex_alloc()]. */ typedef struct sqlite3_mutex sqlite3_mutex; /* ** CAPI3REF: OS Interface Object | < | > | 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 | ** ** Mutexes are created using [sqlite3_mutex_alloc()]. */ typedef struct sqlite3_mutex sqlite3_mutex; /* ** CAPI3REF: OS Interface Object ** ** An instance of the sqlite3_vfs object defines the interface between ** the SQLite core and the underlying operating system. The "vfs" ** in the name of the object stands for "virtual file system". See ** the [VFS | VFS documentation] for further information. ** ** The value of the iVersion field is initially 1 but may be larger in ** future versions of SQLite. Additional fields may be appended to this ** object when the iVersion value is increased. Note that the structure ** of the sqlite3_vfs object changes in the transaction between ** SQLite version 3.5.9 and 3.6.0 and yet the iVersion field was not ** modified. |
︙ | ︙ |
Changes to src/sqliteInt.h.
︙ | ︙ | |||
1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 | */ struct VTable { sqlite3 *db; /* Database connection associated with this table */ Module *pMod; /* Pointer to module implementation */ sqlite3_vtab *pVtab; /* Pointer to vtab instance */ int nRef; /* Number of pointers to this structure */ u8 bConstraint; /* True if constraints are supported */ VTable *pNext; /* Next in linked list (see above) */ }; /* ** Each SQL table is represented in memory by an instance of the ** following structure. ** | > | 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 | */ struct VTable { sqlite3 *db; /* Database connection associated with this table */ Module *pMod; /* Pointer to module implementation */ sqlite3_vtab *pVtab; /* Pointer to vtab instance */ int nRef; /* Number of pointers to this structure */ u8 bConstraint; /* True if constraints are supported */ int iSavepoint; /* Depth of the SAVEPOINT stack */ VTable *pNext; /* Next in linked list (see above) */ }; /* ** Each SQL table is represented in memory by an instance of the ** following structure. ** |
︙ | ︙ |
Changes to src/test_demovfs.c.
1 2 3 4 5 6 7 8 9 10 11 12 | /* ** 2010 April 7 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** | | | | | > < < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | /* ** 2010 April 7 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** ** This file implements an example of a simple VFS implementation that ** omits complex features often not required or not possible on embedded ** platforms. Code is included to buffer writes to the journal file, ** which can be a significant performance improvement on some embedded ** platforms. ** ** OVERVIEW ** ** The code in this file implements a minimal SQLite VFS that can be ** used on Linux and other posix-like operating systems. The following ** system calls are used: ** ** File-system: access(), unlink(), getcwd() |
︙ | ︙ |
Changes to src/test_journal.c.
︙ | ︙ | |||
10 11 12 13 14 15 16 | ** ****************************************************************************** ** ** This file contains code for a VFS layer that acts as a wrapper around ** an existing VFS. The code in this file attempts to verify that SQLite ** correctly populates and syncs a journal file before writing to a ** corresponding database file. | | < < < < < < | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | ** ****************************************************************************** ** ** This file contains code for a VFS layer that acts as a wrapper around ** an existing VFS. The code in this file attempts to verify that SQLite ** correctly populates and syncs a journal file before writing to a ** corresponding database file. ** ** INTERFACE ** ** The public interface to this wrapper VFS is two functions: ** ** jt_register() ** jt_unregister() ** |
︙ | ︙ | |||
95 96 97 98 99 100 101 102 103 104 105 106 107 108 | ** a) A block of zeroes (or anything else that is not a valid ** journal-header) is written to the start of the journal file. ** ** b) A journal file is truncated to zero bytes in size using xTruncate. ** ** c) The journal file is deleted using xDelete. */ /* ** Maximum pathname length supported by the jt backend. */ #define JT_MAX_PATHNAME 512 /* | > > > > | 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | ** a) A block of zeroes (or anything else that is not a valid ** journal-header) is written to the start of the journal file. ** ** b) A journal file is truncated to zero bytes in size using xTruncate. ** ** c) The journal file is deleted using xDelete. */ #if SQLITE_TEST /* This file is used for testing only */ #include "sqlite3.h" #include "sqliteInt.h" /* ** Maximum pathname length supported by the jt backend. */ #define JT_MAX_PATHNAME 512 /* |
︙ | ︙ |
Changes to src/test_multiplex.c.
1 2 3 4 5 6 7 8 9 10 11 12 13 | /* ** 2010 October 28 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** ** This file contains a VFS "shim" - a layer that sits in between the | | > > > > > > > > | < < > > > > > > > > | > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | /* ** 2010 October 28 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** ** This file contains a VFS "shim" - a layer that sits in between the ** pager and the real VFS - that breaks up a very large database file ** into two or more smaller files on disk. This is useful, for example, ** in order to support large, multi-gigabyte databases on older filesystems ** that limit the maximum file size to 2 GiB. ** ** USAGE: ** ** Compile this source file and link it with your application. Then ** at start-time, invoke the following procedure: ** ** int sqlite3_multiplex_initialize( ** const char *zOrigVfsName, // The underlying real VFS ** int makeDefault // True to make multiplex the default VFS ** ); ** ** The procedure call above will create and register a new VFS shim named ** "multiplex". The multiplex VFS will use the VFS named by zOrigVfsName to ** do the actual disk I/O. (The zOrigVfsName parameter may be NULL, in ** which case the default VFS at the moment sqlite3_multiplex_initialize() ** is called will be used as the underlying real VFS.) ** ** If the makeDefault parameter is TRUE then multiplex becomes the new ** default VFS. Otherwise, you can use the multiplex VFS by specifying ** "multiplex" as the 4th parameter to sqlite3_open_v2() or by employing ** URI filenames and adding "vfs=multiplex" as a parameter to the filename ** URI. ** ** The multiplex VFS allows databases up to 32 GiB in size. But it splits ** the files up into 1 GiB pieces, so that they will work even on filesystems ** that do not support large files. */ #include "sqlite3.h" #include <string.h> #include <assert.h> #include "test_multiplex.h" #ifndef SQLITE_CORE |
︙ | ︙ |
Changes to src/test_vfs.c.
1 2 3 4 5 6 7 8 9 10 11 12 | /* ** 2010 May 05 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** ** | < < < < > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | /* ** 2010 May 05 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** ** ** This file contains the implementation of the Tcl [testvfs] command, ** used to create SQLite VFS implementations with various properties and ** instrumentation to support testing SQLite. ** ** testvfs VFSNAME ?OPTIONS? ** ** Available options are: ** ** -noshm BOOLEAN (True to omit shm methods. Default false) ** -default BOOLEAN (True to make the vfs default. Default false) ** -szosfile INTEGER (Value for sqlite3_vfs.szOsFile) ** -mxpathname INTEGER (Value for sqlite3_vfs.mxPathname) ** -iversion INTEGER (Value for sqlite3_vfs.iVersion) */ #if SQLITE_TEST /* This file is used for testing only */ #include "sqlite3.h" #include "sqliteInt.h" typedef struct Testvfs Testvfs; typedef struct TestvfsShm TestvfsShm; typedef struct TestvfsBuffer TestvfsBuffer; |
︙ | ︙ |
Changes to src/test_vfstrace.c.
︙ | ︙ | |||
8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** ** ** This file contains code implements a VFS shim that writes diagnostic ** output for each VFS call, similar to "strace". */ #include <stdlib.h> #include <string.h> #include "sqlite3.h" /* ** An instance of this structure is attached to the each trace VFS to | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** ** ** This file contains code implements a VFS shim that writes diagnostic ** output for each VFS call, similar to "strace". ** ** USAGE: ** ** This source file exports a single symbol which is the name of a ** function: ** ** int vfstrace_register( ** const char *zTraceName, // Name of the newly constructed VFS ** const char *zOldVfsName, // Name of the underlying VFS ** int (*xOut)(const char*,void*), // Output routine. ex: fputs ** void *pOutArg, // 2nd argument to xOut. ex: stderr ** int makeDefault // Make the new VFS the default ** ); ** ** Applications that want to trace their VFS usage must provide a callback ** function with this prototype: ** ** int traceOutput(const char *zMessage, void *pAppData); ** ** This function will "output" the trace messages, where "output" can ** mean different things to different applications. The traceOutput function ** for the command-line shell (see shell.c) is "fputs" from the standard ** library, which means that all trace output is written on the stream ** specified by the second argument. In the case of the command-line shell ** the second argument is stderr. Other applications might choose to output ** trace information to a file, over a socket, or write it into a buffer. ** ** The vfstrace_register() function creates a new "shim" VFS named by ** the zTraceName parameter. A "shim" VFS is an SQLite backend that does ** not really perform the duties of a true backend, but simply filters or ** interprets VFS calls before passing them off to another VFS which does ** the actual work. In this case the other VFS - the one that does the ** real work - is identified by the second parameter, zOldVfsName. If ** the the 2nd parameter is NULL then the default VFS is used. The common ** case is for the 2nd parameter to be NULL. ** ** The third and fourth parameters are the pointer to the output function ** and the second argument to the output function. For the SQLite ** command-line shell, when the -vfstrace option is used, these parameters ** are fputs and stderr, respectively. ** ** The fifth argument is true (non-zero) to cause the newly created VFS ** to become the default VFS. The common case is for the fifth parameter ** to be true. ** ** The call to vfstrace_register() simply creates the shim VFS that does ** tracing. The application must also arrange to use the new VFS for ** all database connections that are created and for which tracing is ** desired. This can be done by specifying the trace VFS using URI filename ** notation, or by specifying the trace VFS as the 4th parameter to ** sqlite3_open_v2() or by making the trace VFS be the default (by setting ** the 5th parameter of vfstrace_register() to 1). ** ** ** ENABLING VFSTRACE IN A COMMAND-LINE SHELL ** ** The SQLite command line shell implemented by the shell.c source file ** can be used with this module. To compile in -vfstrace support, first ** gather this file (test_vfstrace.c), the shell source file (shell.c), ** and the SQLite amalgamation source files (sqlite3.c, sqlite3.h) into ** the working directory. Then compile using a command like the following: ** ** gcc -o sqlite3 -Os -I. -DSQLITE_ENABLE_VFSTRACE \ ** -DSQLITE_THREADSAFE=0 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE \ ** -DHAVE_READLINE -DHAVE_USLEEP=1 \ ** shell.c test_vfstrace.c sqlite3.c -ldl -lreadline -lncurses ** ** The gcc command above works on Linux and provides (in addition to the ** -vfstrace option) support for FTS3 and FTS4, RTREE, and command-line ** editing using the readline library. The command-line shell does not ** use threads so we added -DSQLITE_THREADSAFE=0 just to make the code ** run a little faster. For compiling on a Mac, you'll probably need ** to omit the -DHAVE_READLINE, the -lreadline, and the -lncurses options. ** The compilation could be simplified to just this: ** ** gcc -DSQLITE_ENABLE_VFSTRACE \ ** shell.c test_vfstrace.c sqlite3.c -ldl -lpthread ** ** In this second example, all unnecessary options have been removed ** Note that since the code is now threadsafe, we had to add the -lpthread ** option to pull in the pthreads library. ** ** To cross-compile for windows using MinGW, a command like this might ** work: ** ** /opt/mingw/bin/i386-mingw32msvc-gcc -o sqlite3.exe -Os -I \ ** -DSQLITE_THREADSAFE=0 -DSQLITE_ENABLE_VFSTRACE \ ** shell.c test_vfstrace.c sqlite3.c ** ** Similar compiler commands will work on different systems. The key ** invariants are (1) you must have -DSQLITE_ENABLE_VFSTRACE so that ** the shell.c source file will know to include the -vfstrace command-line ** option and (2) you must compile and link the three source files ** shell,c, test_vfstrace.c, and sqlite3.c. */ #include <stdlib.h> #include <string.h> #include "sqlite3.h" /* ** An instance of this structure is attached to the each trace VFS to |
︙ | ︙ |
Changes to src/vdbe.c.
︙ | ︙ | |||
2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 | */ sqlite3SetString(&p->zErrMsg, db, "cannot open savepoint - " "SQL statements in progress"); rc = SQLITE_BUSY; }else{ nName = sqlite3Strlen30(zName); /* This call is Ok even if this savepoint is actually a transaction ** savepoint (and therefore should not prompt xSavepoint()) callbacks. ** If this is a transaction savepoint being opened, it is guaranteed ** that the db->aVTrans[] array is empty. */ assert( db->autoCommit==0 || db->nVTrans==0 ); | > | > > | 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 | */ sqlite3SetString(&p->zErrMsg, db, "cannot open savepoint - " "SQL statements in progress"); rc = SQLITE_BUSY; }else{ nName = sqlite3Strlen30(zName); #ifndef SQLITE_OMIT_VIRTUAL_TABLE /* This call is Ok even if this savepoint is actually a transaction ** savepoint (and therefore should not prompt xSavepoint()) callbacks. ** If this is a transaction savepoint being opened, it is guaranteed ** that the db->aVTrans[] array is empty. */ assert( db->autoCommit==0 || db->nVTrans==0 ); rc = sqlite3VtabSavepoint(db, SAVEPOINT_BEGIN, db->nStatement+db->nSavepoint); if( rc!=SQLITE_OK ) goto abort_due_to_error; #endif /* Create a new savepoint structure. */ pNew = sqlite3DbMallocRaw(db, sizeof(Savepoint)+nName+1); if( pNew ){ pNew->zName = (char *)&pNew[1]; memcpy(pNew->zName, zName, nName+1); |
︙ | ︙ | |||
2845 2846 2847 2848 2849 2850 2851 | assert( sqlite3BtreeIsInTrans(pBt) ); if( p->iStatement==0 ){ assert( db->nStatement>=0 && db->nSavepoint>=0 ); db->nStatement++; p->iStatement = db->nSavepoint + db->nStatement; } | | | 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 | assert( sqlite3BtreeIsInTrans(pBt) ); if( p->iStatement==0 ){ assert( db->nStatement>=0 && db->nSavepoint>=0 ); db->nStatement++; p->iStatement = db->nSavepoint + db->nStatement; } rc = sqlite3VtabSavepoint(db, SAVEPOINT_BEGIN, p->iStatement-1); if( rc==SQLITE_OK ){ rc = sqlite3BtreeBeginStmt(pBt, p->iStatement); } /* Store the current value of the database handles deferred constraint ** counter. If the statement transaction needs to be rolled back, ** the value of this counter needs to be restored too. */ |
︙ | ︙ |
Changes to src/vdbeaux.c.
︙ | ︙ | |||
2199 2200 2201 2202 2203 2204 2205 | } /* If eStatementOp is non-zero, then a statement transaction needs to ** be committed or rolled back. Call sqlite3VdbeCloseStatement() to ** do so. If this operation returns an error, and the current statement ** error code is SQLITE_OK or SQLITE_CONSTRAINT, then promote the ** current statement error code. | < < < < < < | | 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 | } /* If eStatementOp is non-zero, then a statement transaction needs to ** be committed or rolled back. Call sqlite3VdbeCloseStatement() to ** do so. If this operation returns an error, and the current statement ** error code is SQLITE_OK or SQLITE_CONSTRAINT, then promote the ** current statement error code. */ if( eStatementOp ){ rc = sqlite3VdbeCloseStatement(p, eStatementOp); if( rc ){ if( p->rc==SQLITE_OK || p->rc==SQLITE_CONSTRAINT ){ p->rc = rc; sqlite3DbFree(db, p->zErrMsg); p->zErrMsg = 0; } invalidateCursorsOnModifiedBtrees(db); sqlite3RollbackAll(db); sqlite3CloseSavepoints(db); |
︙ | ︙ |
Changes to src/vtab.c.
︙ | ︙ | |||
573 574 575 576 577 578 579 | sqlite3ErrorMsg(pParse, "%s", zErr); } sqlite3DbFree(db, zErr); } return rc; } | < | > | > > > > > > > > < | 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 | sqlite3ErrorMsg(pParse, "%s", zErr); } sqlite3DbFree(db, zErr); } return rc; } /* ** Grow the db->aVTrans[] array so that there is room for at least one ** more v-table. Return SQLITE_NOMEM if a malloc fails, or SQLITE_OK otherwise. */ static int growVTrans(sqlite3 *db){ const int ARRAY_INCR = 5; /* Grow the sqlite3.aVTrans array if required */ if( (db->nVTrans%ARRAY_INCR)==0 ){ VTable **aVTrans; int nBytes = sizeof(sqlite3_vtab *) * (db->nVTrans + ARRAY_INCR); aVTrans = sqlite3DbRealloc(db, (void *)db->aVTrans, nBytes); if( !aVTrans ){ return SQLITE_NOMEM; } memset(&aVTrans[db->nVTrans], 0, sizeof(sqlite3_vtab *)*ARRAY_INCR); db->aVTrans = aVTrans; } return SQLITE_OK; } /* ** Add the virtual table pVTab to the array sqlite3.aVTrans[]. Space should ** have already been reserved using growVTrans(). */ static void addToVTrans(sqlite3 *db, VTable *pVTab){ /* Add pVtab to the end of sqlite3.aVTrans */ db->aVTrans[db->nVTrans++] = pVTab; sqlite3VtabLock(pVTab); } /* ** This function is invoked by the vdbe to call the xCreate method ** of the virtual table named zTab in database iDb. ** ** If an error occurs, *pzErr is set to point an an English language |
︙ | ︙ | |||
633 634 635 636 637 638 639 | }else{ rc = vtabCallConstructor(db, pTab, pMod, pMod->pModule->xCreate, pzErr); } /* Justification of ALWAYS(): The xConstructor method is required to ** create a valid sqlite3_vtab if it returns SQLITE_OK. */ if( rc==SQLITE_OK && ALWAYS(sqlite3GetVTable(db, pTab)) ){ | > > | > | 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 | }else{ rc = vtabCallConstructor(db, pTab, pMod, pMod->pModule->xCreate, pzErr); } /* Justification of ALWAYS(): The xConstructor method is required to ** create a valid sqlite3_vtab if it returns SQLITE_OK. */ if( rc==SQLITE_OK && ALWAYS(sqlite3GetVTable(db, pTab)) ){ rc = growVTrans(db); if( rc==SQLITE_OK ){ addToVTrans(db, sqlite3GetVTable(db, pTab)); } } return rc; } /* ** This function is used to set the schema of a virtual table. It is only |
︙ | ︙ | |||
749 750 751 752 753 754 755 756 757 758 759 760 761 762 | VTable *pVTab = db->aVTrans[i]; sqlite3_vtab *p = pVTab->pVtab; if( p ){ int (*x)(sqlite3_vtab *); x = *(int (**)(sqlite3_vtab *))((char *)p->pModule + offset); if( x ) x(p); } sqlite3VtabUnlock(pVTab); } sqlite3DbFree(db, db->aVTrans); db->nVTrans = 0; db->aVTrans = 0; } } | > | 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 | VTable *pVTab = db->aVTrans[i]; sqlite3_vtab *p = pVTab->pVtab; if( p ){ int (*x)(sqlite3_vtab *); x = *(int (**)(sqlite3_vtab *))((char *)p->pModule + offset); if( x ) x(p); } pVTab->iSavepoint = 0; sqlite3VtabUnlock(pVTab); } sqlite3DbFree(db, db->aVTrans); db->nVTrans = 0; db->aVTrans = 0; } } |
︙ | ︙ | |||
838 839 840 841 842 843 844 | /* If pVtab is already in the aVTrans array, return early */ for(i=0; i<db->nVTrans; i++){ if( db->aVTrans[i]==pVTab ){ return SQLITE_OK; } } | | > > > | | | > | 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 | /* If pVtab is already in the aVTrans array, return early */ for(i=0; i<db->nVTrans; i++){ if( db->aVTrans[i]==pVTab ){ return SQLITE_OK; } } /* Invoke the xBegin method. If successful, add the vtab to the ** sqlite3.aVTrans[] array. */ rc = growVTrans(db); if( rc==SQLITE_OK ){ rc = pModule->xBegin(pVTab->pVtab); if( rc==SQLITE_OK ){ addToVTrans(db, pVTab); } } } return rc; } /* ** Invoke either the xSavepoint, xRollbackTo or xRelease method of all |
︙ | ︙ | |||
866 867 868 869 870 871 872 873 874 875 | ** function immediately. If all calls to virtual table methods are successful, ** SQLITE_OK is returned. */ int sqlite3VtabSavepoint(sqlite3 *db, int op, int iSavepoint){ int rc = SQLITE_OK; assert( op==SAVEPOINT_RELEASE||op==SAVEPOINT_ROLLBACK||op==SAVEPOINT_BEGIN ); if( db->aVTrans ){ int i; for(i=0; rc==SQLITE_OK && i<db->nVTrans; i++){ | > > | > > | > | 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 | ** function immediately. If all calls to virtual table methods are successful, ** SQLITE_OK is returned. */ int sqlite3VtabSavepoint(sqlite3 *db, int op, int iSavepoint){ int rc = SQLITE_OK; assert( op==SAVEPOINT_RELEASE||op==SAVEPOINT_ROLLBACK||op==SAVEPOINT_BEGIN ); assert( iSavepoint>=0 ); if( db->aVTrans ){ int i; for(i=0; rc==SQLITE_OK && i<db->nVTrans; i++){ VTable *pVTab = db->aVTrans[i]; const sqlite3_module *pMod = pVTab->pMod->pModule; if( pMod->iVersion>=2 ){ int (*xMethod)(sqlite3_vtab *, int); switch( op ){ case SAVEPOINT_BEGIN: xMethod = pMod->xSavepoint; pVTab->iSavepoint = iSavepoint+1; break; case SAVEPOINT_ROLLBACK: xMethod = pMod->xRollbackTo; break; default: xMethod = pMod->xRelease; break; } if( xMethod && pVTab->iSavepoint>iSavepoint ){ rc = xMethod(db->aVTrans[i]->pVtab, iSavepoint); } } } } return rc; } /* |
︙ | ︙ |
Changes to src/wal.c.
︙ | ︙ | |||
2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 | /* Limit the size of WAL file if the journal_size_limit PRAGMA is ** set to a non-negative value. Log errors encountered ** during the truncation attempt. */ if( pWal->mxWalSize>=0 ){ i64 sz; int rx; rx = sqlite3OsFileSize(pWal->pWalFd, &sz); if( rx==SQLITE_OK && (sz > pWal->mxWalSize) ){ rx = sqlite3OsTruncate(pWal->pWalFd, pWal->mxWalSize); } if( rx ){ sqlite3_log(rx, "cannot limit WAL size: %s", pWal->zWalName); } } pWal->nCkpt++; pWal->hdr.mxFrame = 0; | > > | 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 | /* Limit the size of WAL file if the journal_size_limit PRAGMA is ** set to a non-negative value. Log errors encountered ** during the truncation attempt. */ if( pWal->mxWalSize>=0 ){ i64 sz; int rx; sqlite3BeginBenignMalloc(); rx = sqlite3OsFileSize(pWal->pWalFd, &sz); if( rx==SQLITE_OK && (sz > pWal->mxWalSize) ){ rx = sqlite3OsTruncate(pWal->pWalFd, pWal->mxWalSize); } sqlite3EndBenignMalloc(); if( rx ){ sqlite3_log(rx, "cannot limit WAL size: %s", pWal->zWalName); } } pWal->nCkpt++; pWal->hdr.mxFrame = 0; |
︙ | ︙ |
Changes to test/tkt-2d1a5c67d.test.
︙ | ︙ | |||
13 14 15 16 17 18 19 20 | # been resolved. # # # set testdir [file dirname $argv0] source $testdir/tester.tcl | > | | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | # been resolved. # # # set testdir [file dirname $argv0] source $testdir/tester.tcl set testprefix tkt-2d1a5c67d ifcapable {!wal || !vtab} {finish_test; return} for {set ii 1} {$ii<=10} {incr ii} { do_test tkt-2d1a5c67d.1.$ii { db close forcedelete test.db test.db-wal sqlite3 db test.db db eval "PRAGMA cache_size=$::ii" |
︙ | ︙ | |||
65 66 67 68 69 70 71 72 73 | INSERT INTO t1(a,b) VALUES(1,2); SELECT sum(length(y)) FROM t2; COMMIT; SELECT * FROM t1; } } {1000000 1 2} } finish_test | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | INSERT INTO t1(a,b) VALUES(1,2); SELECT sum(length(y)) FROM t2; COMMIT; SELECT * FROM t1; } } {1000000 1 2} } db close sqlite3 db test.db do_execsql_test 3.1 { PRAGMA cache_size = 10; CREATE TABLE t3(a INTEGER PRIMARY KEY, b); CREATE TABLE t4(a); } do_execsql_test 3.2 { INSERT INTO t3 VALUES(NULL, randomblob(500)); INSERT INTO t3 SELECT NULL, b||b FROM t3; -- 2 INSERT INTO t3 SELECT NULL, b||b FROM t3; -- 4 INSERT INTO t3 SELECT NULL, b||b FROM t3; -- 8 INSERT INTO t3 SELECT NULL, b||b FROM t3; -- 16 INSERT INTO t3 SELECT NULL, b||b FROM t3; -- 32 INSERT INTO t3 SELECT NULL, b||b FROM t3; -- 64 INSERT INTO t3 SELECT NULL, b||b FROM t3; -- 128 } do_execsql_test 3.3 { BEGIN; INSERT INTO t4 VALUES('xyz'); } do_test 3.4 { set blobs [list] for {set i 1} {$i<100} {incr i} { set b [db incrblob -readonly t3 b $i] read $b lappend blobs $b } execsql COMMIT execsql { SELECT * FROM t4 WHERE a = 'xyz' } } {xyz} do_test 3.5 { foreach b $blobs { close $b } execsql { SELECT * FROM t4 WHERE a = 'xyz' } } {xyz} # Check that recovery works on the WAL file. # forcedelete test.db2-wal test.db2 do_test 3.6 { file copy test.db-wal test.db2-wal file copy test.db test.db2 sqlite3 db2 test.db2 execsql { SELECT * FROM t4 WHERE a = 'xyz' } db2 } {xyz} finish_test |
Changes to test/uri.test.
︙ | ︙ | |||
42 43 44 45 46 47 48 | 7 file:test.db?mork=1#boris test.db 8 file:test.db#boris test.db 9 test.db#boris test.db#boris 10 file:test%2Edb test.db 11 file file 12 http:test.db http:test.db 13 file:test.db%00extra test.db | | > | 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | 7 file:test.db?mork=1#boris test.db 8 file:test.db#boris test.db 9 test.db#boris test.db#boris 10 file:test%2Edb test.db 11 file file 12 http:test.db http:test.db 13 file:test.db%00extra test.db 14 file:testdb%00.db%00extra testdb 15 test.db?mork=1#boris test.db?mork=1#boris 16 file://localhostPWD/test.db%3Fhello test.db?hello } { if {$tcl_platform(platform)=="windows"} { if {$tn>14} break set uri [string map [list PWD /[pwd]] $uri] } else { set uri [string map [list PWD [pwd]] $uri] } if {[file isdir $file]} {error "$file is a directory"} forcedelete $file do_test 1.$tn.1 { file exists $file } 0 set DB [sqlite3_open $uri] do_test 1.$tn.2 { file exists $file } 1 sqlite3_close $DB forcedelete $file |
︙ | ︙ | |||
86 87 88 89 90 91 92 | } foreach {tn uri kvlist} { 1 file:test.db?hello=world {hello world} 2 file:test.db?hello&world {hello {} world {}} 3 file:test.db?hello=1&world=2&vfs=tvfs {hello 1 world 2 vfs tvfs} 4 file:test.db?hello=1&world=2&vfs=tvfs2 {} 5 file:test.db?%68%65%6C%6C%6F=%77%6F%72%6C%64 {hello world} | | | | | 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | } foreach {tn uri kvlist} { 1 file:test.db?hello=world {hello world} 2 file:test.db?hello&world {hello {} world {}} 3 file:test.db?hello=1&world=2&vfs=tvfs {hello 1 world 2 vfs tvfs} 4 file:test.db?hello=1&world=2&vfs=tvfs2 {} 5 file:test.db?%68%65%6C%6C%6F=%77%6F%72%6C%64 {hello world} 6 file:testdb%00.db?hello%00extra=world%00ex {hello world} 7 file:testdb%00.db?hello%00=world%00 {hello world} 8 file:testdb%00.db?=world&xyz=abc {xyz abc} 9 file:test.db?%00hello=world&xyz=abc {xyz abc} 10 file:test.db?hello=%00world&xyz= {hello {} xyz {}} 11 file:test.db?=#ravada {} 12 file:test.db?&&&&&&&&hello=world&&&&&&& {hello world} 13 test.db?&&&&&&&&hello=world&&&&&&& {} 14 http:test.db?hello&world {} |
︙ | ︙ |