aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2011-12-11 22:44:09 +0000
committerdrh <drh@noemail.net>2011-12-11 22:44:09 +0000
commit58cd3c61628d4b52301a8ca32e488bef64c75df8 (patch)
tree6ab27e15b8073e6eef0c19e8b78490479b45b1ce /src
parent630d296c57e9a94f0d209a9f4eb215c26132372d (diff)
downloadsqlite-58cd3c61628d4b52301a8ca32e488bef64c75df8.tar.gz
sqlite-58cd3c61628d4b52301a8ca32e488bef64c75df8.zip
In the multiplexor shim, when using 8+3 filenames, begin numbering journal
overflow files with 101 instead of 001 to avoid name collisions with the main database file. FossilOrigin-Name: 05bf8a0b17a13a581ac973dc84ceaf66532d7f92
Diffstat (limited to 'src')
-rw-r--r--src/test_multiplex.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/test_multiplex.c b/src/test_multiplex.c
index 2ca8bf8d5..84c14f757 100644
--- a/src/test_multiplex.c
+++ b/src/test_multiplex.c
@@ -304,6 +304,13 @@ static int multiplexSubFilename(multiplexGroup *pGroup, int iChunk){
int i;
for(i=n-1; i>0 && i>=n-4 && z[i]!='.'; i--){}
if( i>=n-4 ) n = i+1;
+ if( pGroup->flags & (SQLITE_OPEN_MAIN_JOURNAL|SQLITE_OPEN_TEMP_JOURNAL) ){
+ /* The extensions on overflow files for main databases are 001, 002,
+ ** 003 and so forth. To avoid name collisions, add 100 to the
+ ** extensions of journal files so that they are 101, 102, 103, ....
+ */
+ iChunk += 100;
+ }
#endif
sqlite3_snprintf(4,&z[n],"%03d",iChunk);
}