From 94dfe476fa32b6b56787ba3e564d0f712513ed22 Mon Sep 17 00:00:00 2001 From: drh Date: Sat, 28 Mar 2009 15:04:24 +0000 Subject: [PATCH] Back out check-in (6380). Replace it with a proper fix to the xFullPathname method in the async VFS. (CVS 6398) FossilOrigin-Name: 767a7f7b55456df404a7f8966a0c48318ddac120 --- manifest | 20 +++++++++--------- manifest.uuid | 2 +- src/test_async.c | 53 ++++++++++++++++++------------------------------ test/async.test | 4 +--- test/lock.test | 14 +++++-------- test/lock3.test | 10 +++------ 6 files changed, 40 insertions(+), 63 deletions(-) diff --git a/manifest b/manifest index 896c43a595..a5528cf709 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C The\sfix\sin\s(6395)\swas\snot\scorrect.\sFix\s#3756\sa\sdifferent\sway.\s(CVS\s6397) -D 2009-03-28T10:54:23 +C Back\sout\scheck-in\s(6380).\s\sReplace\sit\swith\sa\sproper\sfix\sto\sthe\nxFullPathname\smethod\sin\sthe\sasync\sVFS.\s(CVS\s6398) +D 2009-03-28T15:04:24 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in 583e87706abc3026960ed759aff6371faf84c211 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -173,7 +173,7 @@ F src/test6.c 1a0a7a1f179469044b065b4a88aab9faee114101 F src/test7.c b94e68c2236de76889d82b8d7d8e00ad6a4d80b1 F src/test8.c 3637439424d0d21ff2dcf9b015c30fcc1e7bcb24 F src/test9.c 904ebe0ed1472d6bad17a81e2ecbfc20017dc237 -F src/test_async.c 3e25752ff42bd14b45ff8de3e6cd69aa385323c4 +F src/test_async.c 9d75004dfee306f823cc26525cfef718c2e024d2 F src/test_autoext.c f53b0cdf7bf5f08100009572a5d65cdb540bd0ad F src/test_backup.c 79ac8daa03f0b3d360ff1eb56b23c7df0c14ecd1 F src/test_btree.c d7b8716544611c323860370ee364e897c861f1b0 @@ -219,7 +219,7 @@ F test/alter3.test 25b95a136708f22b87184fa6a4309eea03d65153 F test/alter4.test 9386ffd1e9c7245f43eca412b2058d747509cc1f F test/altermalloc.test e81ac9657ed25c6c5bb09bebfa5a047cd8e4acfc F test/analyze.test ad5329098fe4de4a96852231d53e3e9e6283ad4b -F test/async.test ec30ff44dd42ec38853d6a380d0cc9461bde8f6e +F test/async.test e7e6c5ef30c67531aad5c961e224bac91b88de16 F test/async2.test d3f23363553c2c02f15da98ae8bbc43420efd04c F test/async3.test 9ffa0977a78cc6351862a1583be2b1eecd41736d F test/attach.test 75a5d22f88e730967d68f2c9f95e786e3953d8e3 @@ -430,9 +430,9 @@ F test/like2.test 3b2ee13149ba4a8a60b59756f4e5d345573852da F test/limit.test 2db7b3b34fb925b8e847d583d2eb67531d0ce67e F test/loadext.test 0393ce12d9616aa87597dd0ec88181de181f6db0 F test/loadext2.test 0bcaeb4d81cd5b6e883fdfea3c1bdbe1f173cbca -F test/lock.test 18cbb77cd9261554d3f78a4e993951b9d8e88f73 +F test/lock.test edf5585398a33534db71a2a6108308d9e89c16d1 F test/lock2.test d4f941d1f659e5fc782b4912b1a872d77d4b5470 -F test/lock3.test cfe91ac74038cd9931164885b8d98fbc70ec43fc +F test/lock3.test f271375930711ae044080f4fe6d6eda930870d00 F test/lock4.test 991b57669a868bbfd39fe0c0df0d493985829105 F test/lock5.test 6b1f78f09ad1522843dad571b76b321e6f439bf7 F test/lock6.test 862aa71e97b288d6b3f92ba3313f51bd0b003776 @@ -710,7 +710,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e -P c9fa329f54736de517cddaf747595c9eca931f32 -R 45685c730f301fd232a550e830ed7088 -U danielk1977 -Z 0debd657750e70bfc6e8d14fa070690c +P 9278f7b1e1f2d0d4c2f8829ca801a769e512c2a6 +R 121873619f687e25693398fc7592b8b5 +U drh +Z 4d0af7748a59ba8b5aec187f6438633a diff --git a/manifest.uuid b/manifest.uuid index 5d9082648f..a689bcee5e 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -9278f7b1e1f2d0d4c2f8829ca801a769e512c2a6 \ No newline at end of file +767a7f7b55456df404a7f8966a0c48318ddac120 \ No newline at end of file diff --git a/src/test_async.c b/src/test_async.c index 3ff29b8b7f..9cd5957cc3 100644 --- a/src/test_async.c +++ b/src/test_async.c @@ -10,7 +10,7 @@ ** ************************************************************************* ** -** $Id: test_async.c,v 1.53 2009/03/27 09:10:12 danielk1977 Exp $ +** $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. @@ -1285,40 +1285,27 @@ static int asyncFullPathname( ** file-system uses unix style paths. */ if( rc==SQLITE_OK ){ - int iIn; - int iOut = 0; - int nPathOut = strlen(zPathOut); - - for(iIn=0; iIn1 && z[n-1]=='/' ){ n--; } + for(i=j=0; i0 && z[j-1]!='/' ){ j--; } + if( j>0 ){ j--; } + i += 2; + continue; + } } - - /* Replace any occurences of "/./" with "/" */ - if( iIn<=(nPathOut-3) - && zPathOut[iIn]=='/' && zPathOut[iIn+1]=='.' && zPathOut[iIn+2]=='/' - ){ - iIn++; - continue; - } - - /* Replace any occurences of "/../" with "" */ - if( iOut>0 && iIn<=(nPathOut-4) - && zPathOut[iIn]=='/' && zPathOut[iIn+1]=='.' - && zPathOut[iIn+2]=='.' && zPathOut[iIn+3]=='/' - ){ - iIn += 3; - iOut--; - for( ; iOut>0 && zPathOut[iOut-1]!='/'; iOut--); - continue; - } - - zPathOut[iOut++] = zPathOut[iIn]; + z[j++] = z[i]; } - zPathOut[iOut] = '\0'; + z[j] = 0; } return rc; diff --git a/test/async.test b/test/async.test index e916ac2e3f..6519f99df1 100644 --- a/test/async.test +++ b/test/async.test @@ -6,7 +6,7 @@ #*********************************************************************** # This file runs all tests. # -# $Id: async.test,v 1.15 2009/03/24 16:55:44 drh Exp $ +# $Id: async.test,v 1.16 2009/03/28 15:04:24 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -54,9 +54,7 @@ proc do_test {name args} { foreach testfile [lsort -dictionary [glob $testdir/*.test]] { set tail [file tail $testfile] if {[lsearch -exact $INCLUDE $tail]<0} continue - set ::ASYNC 1 source $testfile - unset ::ASYNC # Make sure everything is flushed through. This is because [source]ing # the next test file will delete the database file on disk (using diff --git a/test/lock.test b/test/lock.test index b01bf7b129..03cd0e50dd 100644 --- a/test/lock.test +++ b/test/lock.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. The # focus of this script is database locks. # -# $Id: lock.test,v 1.38 2009/03/24 16:55:44 drh Exp $ +# $Id: lock.test,v 1.39 2009/03/28 15:04:24 drh Exp $ set testdir [file dirname $argv0] @@ -20,14 +20,10 @@ source $testdir/tester.tcl # Create an alternative connection to the database # do_test lock-1.0 { - if {[info exists ::ASYNC]} { - sqlite3 db2 test.db - } else { - # Give a complex pathnme to stress the path simplification logic in - # the vxworks driver. - file mkdir tempdir/t1/t2 - sqlite3 db2 ./tempdir/../tempdir/t1/.//t2/../../..//test.db - } + # 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 { diff --git a/test/lock3.test b/test/lock3.test index 3dd559b46d..f771a19370 100644 --- a/test/lock3.test +++ b/test/lock3.test @@ -13,7 +13,7 @@ # DEFERRED, IMMEDIATE, and EXCLUSIVE keywords as modifiers to the # BEGIN command. # -# $Id: lock3.test,v 1.3 2009/03/24 16:55:44 drh Exp $ +# $Id: lock3.test,v 1.4 2009/03/28 15:04:24 drh Exp $ set testdir [file dirname $argv0] @@ -23,12 +23,8 @@ source $testdir/tester.tcl # sample data into the database. # do_test lock3-1.1 { - if {![info exists ::ASYNC]} { - file mkdir tempdir/t1/t2/t3 - sqlite3 db2 ./tempdir/t1//t2/./t3//./../..//./../../tempdir/..//test.db// - } else { - sqlite3 db2 test.db - } + 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);