Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Back out check-in (6380). Replace it with a proper fix to the xFullPathname method in the async VFS. (CVS 6398) |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
767a7f7b55456df404a7f8966a0c4831 |
User & Date: | drh 2009-03-28 15:04:24.000 |
Context
2009-03-28
| ||
17:21 | Fix thread related problems in test modules test_async.c and test_journal.c. (CVS 6399) (check-in: 45df27a22d user: danielk1977 tags: trunk) | |
15:04 | Back out check-in (6380). Replace it with a proper fix to the xFullPathname method in the async VFS. (CVS 6398) (check-in: 767a7f7b55 user: drh tags: trunk) | |
10:54 | The fix in (6395) was not correct. Fix #3756 a different way. (CVS 6397) (check-in: 9278f7b1e1 user: danielk1977 tags: trunk) | |
Changes
Changes to src/test_async.c.
1 2 3 4 5 6 7 8 9 10 11 12 | /* ** 2005 December 14 ** ** 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 | /* ** 2005 December 14 ** ** 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. ** ************************************************************************* ** ** $Id: test_async.c,v 1.54 2009/03/28 15:04:24 drh Exp $ ** ** This file contains an example implementation of an asynchronous IO ** backend for SQLite. ** ** WHAT IS ASYNCHRONOUS I/O? ** ** With asynchronous I/O, write requests are handled by a separate thread |
︙ | ︙ | |||
1281 1282 1283 1284 1285 1286 1287 | rc = pVfs->xFullPathname(pVfs, zPath, nPathOut, zPathOut); /* Because of the way intra-process file locking works, this backend ** needs to return a canonical path. The following block assumes the ** file-system uses unix style paths. */ if( rc==SQLITE_OK ){ | | | | | < | < < | | < | < < < < | | | | < | < < | | < < | | | | | | 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 | rc = pVfs->xFullPathname(pVfs, zPath, nPathOut, zPathOut); /* Because of the way intra-process file locking works, this backend ** needs to return a canonical path. The following block assumes the ** file-system uses unix style paths. */ if( rc==SQLITE_OK ){ int i, j; int n = nPathOut; char *z = zPathOut; while( n>1 && z[n-1]=='/' ){ n--; } for(i=j=0; i<n; i++){ if( z[i]=='/' ){ if( z[i+1]=='/' ) continue; if( z[i+1]=='.' && i+2<n && z[i+2]=='/' ){ i += 1; continue; } if( z[i+1]=='.' && i+3<n && z[i+2]=='.' && z[i+3]=='/' ){ while( j>0 && z[j-1]!='/' ){ j--; } if( j>0 ){ j--; } i += 2; continue; } } z[j++] = z[i]; } z[j] = 0; } return rc; } static void *asyncDlOpen(sqlite3_vfs *pAsyncVfs, const char *zPath){ sqlite3_vfs *pVfs = (sqlite3_vfs *)pAsyncVfs->pAppData; return pVfs->xDlOpen(pVfs, zPath); |
︙ | ︙ |
Changes to test/async.test.
1 2 3 4 5 6 7 8 | # # 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 runs all tests. # | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # # 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 runs all tests. # # $Id: async.test,v 1.16 2009/03/28 15:04:24 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl if {[catch {sqlite3async_enable}]} { # The async logic is not built into this system finish_test |
︙ | ︙ | |||
50 51 52 53 54 55 56 | sqlite3async_wait sqlite3async_halt never } foreach testfile [lsort -dictionary [glob $testdir/*.test]] { set tail [file tail $testfile] if {[lsearch -exact $INCLUDE $tail]<0} continue | < < | 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | sqlite3async_wait sqlite3async_halt never } foreach testfile [lsort -dictionary [glob $testdir/*.test]] { set tail [file tail $testfile] if {[lsearch -exact $INCLUDE $tail]<0} continue source $testfile # Make sure everything is flushed through. This is because [source]ing # the next test file will delete the database file on disk (using # [file delete]). If the asynchronous backend still has the file # open, it will become confused. # sqlite3async_halt idle |
︙ | ︙ |
Changes to test/lock.test.
1 2 3 4 5 6 7 8 9 10 11 12 13 | # 2001 September 15 # # 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 regression tests for SQLite library. The # focus of this script is database locks. # | | < < < | | | | < | 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 | # 2001 September 15 # # 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 regression tests for SQLite library. The # focus of this script is database locks. # # $Id: lock.test,v 1.39 2009/03/28 15:04:24 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Create an alternative connection to the database # do_test lock-1.0 { # Give a complex pathname to stress the path simplification logic in # the vxworks driver and in test_async. file mkdir tempdir/t1/t2 sqlite3 db2 ./tempdir/../tempdir/t1/.//t2/../../..//test.db set dummy {} } {} do_test lock-1.1 { execsql {SELECT name FROM sqlite_master WHERE type='table' ORDER BY name} } {} do_test lock-1.2 { execsql {SELECT name FROM sqlite_master WHERE type='table' ORDER BY name} db2 |
︙ | ︙ |
Changes to test/lock3.test.
︙ | ︙ | |||
9 10 11 12 13 14 15 | # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this script is database locks and the operation of the # DEFERRED, IMMEDIATE, and EXCLUSIVE keywords as modifiers to the # BEGIN command. # | | < | | < < < | 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 | # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this script is database locks and the operation of the # DEFERRED, IMMEDIATE, and EXCLUSIVE keywords as modifiers to the # BEGIN command. # # $Id: lock3.test,v 1.4 2009/03/28 15:04:24 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Establish two connections to the same database. Put some # sample data into the database. # do_test lock3-1.1 { file mkdir tempdir/t1/t2/t3 sqlite3 db2 ./tempdir/t1//t2/./t3//./../..//./../../tempdir/..//test.db// execsql { CREATE TABLE t1(a); INSERT INTO t1 VALUES(1); } execsql { SELECT * FROM t1 } db2 |
︙ | ︙ |