/ Check-in [5debf12fa4]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:On windows, avoid running those tests in exclusive.test that require the journal file to be externally accessed while SQLite is holding it open. This doesn't work on windows. (CVS 5742)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 5debf12fa46520946ac5da44c03448fffbc9940c
User & Date: danielk1977 2008-09-24 14:03:43
Context
2008-09-26
17:31
Performance enhancement: avoid calling reparentChildPages() from balance_nonroot(). (CVS 5743) check-in: 28fd0a50ca user: danielk1977 tags: trunk
2008-09-24
14:03
On windows, avoid running those tests in exclusive.test that require the journal file to be externally accessed while SQLite is holding it open. This doesn't work on windows. (CVS 5742) check-in: 5debf12fa4 user: danielk1977 tags: trunk
09:58
Add file fts3_icu.c to the amalgamation. Because of the way header files are included into sqlite3.c, fts3_icu.c has to appear after all the other fts3 and icu extension files. Ticket #3398. (CVS 5741) check-in: 0acca5842f user: danielk1977 tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/exclusive.test.

     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library. The focus
    12     12   # of these tests is exclusive access mode (i.e. the thing activated by 
    13     13   # "PRAGMA locking_mode = EXCLUSIVE").
    14     14   #
    15         -# $Id: exclusive.test,v 1.8 2008/04/17 14:16:42 drh Exp $
           15  +# $Id: exclusive.test,v 1.9 2008/09/24 14:03:43 danielk1977 Exp $
    16     16   
    17     17   set testdir [file dirname $argv0]
    18     18   source $testdir/tester.tcl
    19     19   
    20     20   ifcapable {!pager_pragmas} {
    21     21     finish_test
    22     22     return
................................................................................
   253    253   db2 close
   254    254   
   255    255   #----------------------------------------------------------------------
   256    256   # Tests exclusive-3.X - test that a connection in exclusive mode 
   257    257   # truncates instead of deletes the journal file when committing 
   258    258   # a transaction.
   259    259   #
   260         -proc filestate {fname} {
   261         -  set exists 0
   262         -  set content 0
   263         -  if {[file exists $fname]} {
   264         -    set exists 1
   265         -    set hdr [hexio_read $fname 0 28]
   266         -    set content \
   267         -      [expr {$hdr!="00000000000000000000000000000000000000000000000000000000"}]
   268         -  }
   269         -  list $exists $content
   270         -}
   271         -do_test exclusive-3.0 {
   272         -  filestate test.db-journal
   273         -} {0 0}
   274         -do_test exclusive-3.1 {
   275         -  execsql {
   276         -    PRAGMA locking_mode = exclusive;
   277         -    BEGIN;
   278         -    DELETE FROM abc;
   279         -  }
   280         -  filestate test.db-journal
   281         -} {1 1}
   282         -do_test exclusive-3.2 {
   283         -  execsql {
   284         -    COMMIT;
   285         -  }
   286         -  filestate test.db-journal
   287         -} {1 0}
   288         -do_test exclusive-3.3 {
   289         -  execsql {
   290         -    INSERT INTO abc VALUES('A', 'B', 'C');
   291         -    SELECT * FROM abc;
   292         -  }
   293         -} {A B C}
   294         -do_test exclusive-3.4 {
   295         -  execsql {
   296         -    BEGIN;
   297         -    UPDATE abc SET a = 1, b = 2, c = 3;
   298         -    ROLLBACK;
   299         -    SELECT * FROM abc;
   300         -  }
   301         -} {A B C}
   302         -do_test exclusive-3.5 {
   303         -  filestate test.db-journal
   304         -} {1 0}
   305         -do_test exclusive-3.6 {
   306         -  execsql {
   307         -    PRAGMA locking_mode = normal;
   308         -    SELECT * FROM abc;
   309         -  }
   310         -  filestate test.db-journal
   311         -} {0 0}
          260  +# These tests are not run on windows because the windows backend
          261  +# opens the journal file for exclusive access, preventing its contents 
          262  +# from being inspected externally.
          263  +#
          264  +if {$tcl_platform(platform) != "windows"} {
          265  +  proc filestate {fname} {
          266  +    set exists 0
          267  +    set content 0
          268  +    if {[file exists $fname]} {
          269  +      set exists 1
          270  +      set hdr [hexio_read $fname 0 28]
          271  +      set content \
          272  +       [expr {$hdr!="00000000000000000000000000000000000000000000000000000000"}]
          273  +    }
          274  +    list $exists $content
          275  +  }
          276  +  do_test exclusive-3.0 {
          277  +    filestate test.db-journal
          278  +  } {0 0}
          279  +  do_test exclusive-3.1 {
          280  +    execsql {
          281  +      PRAGMA locking_mode = exclusive;
          282  +      BEGIN;
          283  +      DELETE FROM abc;
          284  +    }
          285  +    filestate test.db-journal
          286  +  } {1 1}
          287  +  do_test exclusive-3.2 {
          288  +    execsql {
          289  +      COMMIT;
          290  +    }
          291  +    filestate test.db-journal
          292  +  } {1 0}
          293  +  do_test exclusive-3.3 {
          294  +    execsql {
          295  +      INSERT INTO abc VALUES('A', 'B', 'C');
          296  +      SELECT * FROM abc;
          297  +    }
          298  +  } {A B C}
          299  +  do_test exclusive-3.4 {
          300  +    execsql {
          301  +      BEGIN;
          302  +      UPDATE abc SET a = 1, b = 2, c = 3;
          303  +      ROLLBACK;
          304  +      SELECT * FROM abc;
          305  +    }
          306  +  } {A B C}
          307  +  do_test exclusive-3.5 {
          308  +    filestate test.db-journal
          309  +  } {1 0}
          310  +  do_test exclusive-3.6 {
          311  +    execsql {
          312  +      PRAGMA locking_mode = normal;
          313  +      SELECT * FROM abc;
          314  +    }
          315  +    filestate test.db-journal
          316  +  } {0 0}
          317  +}
   312    318   
   313    319   #----------------------------------------------------------------------
   314    320   # Tests exclusive-4.X - test that rollback works correctly when
   315    321   # in exclusive-access mode.
   316    322   #
   317    323   
   318    324   # The following procedure computes a "signature" for table "t3".  If