/ Check-in [56a9ce77]
Login

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

Overview
Comment:Fix some test failures found running releasetest.tcl.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 56a9ce7774a6f163a62684dd8d5357ce16a07de1
User & Date: dan 2010-09-14 10:53:46
Context
2010-09-14
18:23
Clarify the documentation to better explain when an automatic re-prepare can be induced by rebinding parameters. Add evidence marks to the automatic re-prepare logic. check-in: 3e11f515 user: drh tags: trunk
10:53
Fix some test failures found running releasetest.tcl. check-in: 56a9ce77 user: dan tags: trunk
2010-09-13
19:03
Fix walmode.test so that all tests pass with SQLITE_TEMP_STORE=3. check-in: 6ba6e59a user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/exclusive2.test.

    79     79     readPagerChangeCounter test.db
    80     80   } {0}
    81     81   
    82     82   #-----------------------------------------------------------------------
    83     83   # The following tests - exclusive2-1.X - check that:
    84     84   #
    85     85   # 1-3:   Build a database with connection 1, calculate a signature.
    86         -# 4-9:   Modify the database using a second connection in a way that
           86  +# 4-7:   Modify the database using a second connection in a way that
    87     87   #        does not modify the freelist, then reset the pager change-counter
    88     88   #        to the value it had before the modifications.
    89     89   # 8:     Check that using the first connection, the database signature
    90     90   #        is still the same. This is because it uses the in-memory cache.
    91     91   #        It can't tell the db has changed because we reset the change-counter.
    92     92   # 9:     Increment the change-counter.
    93     93   # 10:    Ensure that the first connection now sees the updated database. It
................................................................................
    94     94   #        sees the change-counter has been incremented and discards the 
    95     95   #        invalid in-memory cache.
    96     96   #
    97     97   # This will only work if the database cache is large enough to hold 
    98     98   # the entire database. In the case of 1024 byte pages, this means
    99     99   # the cache size must be at least 17. Otherwise, some pages will be
   100    100   # loaded from the database file in step 8.
          101  +#
          102  +# For similar reasons, this test does not work with the memsubsys1 permutation.
          103  +# Permutation memsubsys1 configures the pcache subsystem to use a static
          104  +# allocation of 24 pages (shared between all pagers). This is not enough for
          105  +# this test.
   101    106   #
   102    107   do_test exclusive2-1.1 {
   103    108     execsql {
   104    109       BEGIN;
   105    110       CREATE TABLE t1(a, b);
   106    111       INSERT INTO t1(a) VALUES(randstr(10, 400));
   107    112       INSERT INTO t1(a) VALUES(randstr(10, 400));
................................................................................
   142    147   } 0
   143    148   do_test exclusive2-1.6 {
   144    149     readPagerChangeCounter test.db
   145    150   } {2}
   146    151   do_test exclusive2-1.7 {
   147    152     pagerChangeCounter test.db 1
   148    153   } {1}
   149         -do_test exclusive2-1.9 {
   150         -  t1sig
   151         -  expr {[t1sig] eq $::sig}
   152         -} {1}
          154  +if {[permutation] != "memsubsys1"} {
          155  +  do_test exclusive2-1.9 {
          156  +    t1sig
          157  +    expr {[t1sig] eq $::sig}
          158  +  } {1}
          159  +}
   153    160   do_test exclusive2-1.10 {
   154    161     pagerChangeCounter test.db 2
   155    162   } {2}
   156    163   do_test exclusive2-1.11 {
   157    164     expr {[t1sig] eq $::sig}
   158    165   } {0}
   159    166   

Changes to test/incrblob.test.

   416    416   #     another connection has the database RESERVED lock.
   417    417   #
   418    418   #     Then test that blob writes that take place inside of a
   419    419   #     transaction are not visible to external connections until
   420    420   #     after the transaction is commited and the blob channel 
   421    421   #     closed.
   422    422   #
          423  +#     This test does not work with the "memsubsys1" configuration.
          424  +#     Permutation memsubsys1 configures a very small static allocation 
          425  +#     for use as page-cache memory. This causes SQLite to upgrade
          426  +#     to an exclusive lock when writing earlier than usual, which
          427  +#     makes some of these tests fail.
          428  +#
   423    429   sqlite3_soft_heap_limit 0
   424         -do_test incrblob-6.1 {
   425         -  sqlite3 db2 test.db
   426         -  execsql {
   427         -    BEGIN;
   428         -    INSERT INTO blobs(k, v, i) VALUES('a', 'different', 'connection');
   429         -  } db2
   430         -} {}
   431         -do_test incrblob-6.2 {
   432         -  execsql {
   433         -    SELECT rowid FROM blobs
   434         -  }
   435         -} {1 2 3}
   436         -do_test incrblob-6.3 {
   437         -  set rc [catch {
   438         -    db incrblob blobs v 1
   439         -  } msg]
   440         -  list $rc $msg
   441         -} {1 {database is locked}}
   442         -do_test incrblob-6.4 {
   443         -  set rc [catch {
   444         -    db incrblob blobs v 3
   445         -  } msg]
   446         -  list $rc $msg
   447         -} {1 {database is locked}}
   448         -do_test incrblob-6.5 {
   449         -  set ::blob [db incrblob -readonly blobs v 3]
   450         -  read $::blob
   451         -} {hello}
   452         -do_test incrblob-6.6 {
   453         -  close $::blob
   454         -} {}
   455         -
   456         -do_test incrblob-6.7 {
   457         -  set ::blob [db2 incrblob blobs i 4]
   458         -  gets $::blob
   459         -} {connection}
   460         -do_test incrblob-6.8 {
   461         -  tell $::blob
   462         -} {10}
   463         -do_test incrblob-6.9 {
   464         -  seek $::blob 0
   465         -  puts -nonewline $::blob "invocation"
   466         -  flush $::blob
   467         -} {}
   468         -
   469         -# At this point rollback should be illegal (because 
   470         -# there is an open blob channel).  But commit is also illegal because
   471         -# the open blob is read-write.
   472         -#
   473         -do_test incrblob-6.10 {
   474         -  catchsql {
   475         -    ROLLBACK;
   476         -  } db2
   477         -} {1 {cannot rollback transaction - SQL statements in progress}}
   478         -do_test incrblob-6.11 {
   479         -  catchsql {
   480         -    COMMIT;
   481         -  } db2
   482         -} {1 {cannot commit transaction - SQL statements in progress}}
   483         -
   484         -do_test incrblob-6.12 {
   485         -  execsql {
   486         -    SELECT * FROM blobs WHERE rowid = 4;
   487         -  }
   488         -} {}
   489         -do_test incrblob-6.13 {
   490         -  close $::blob
   491         -} {}
   492         -do_test incrblob-6.14 {
   493         -  catchsql {
   494         -    COMMIT;
   495         -  } db2
   496         -} {0 {}}
   497         -do_test incrblob-6.15 {
   498         -  execsql {
   499         -    SELECT * FROM blobs WHERE rowid = 4;
   500         -  }
   501         -} {a different invocation}
   502         -db2 close
          430  +if {[permutation] != "memsubsys1"} {
          431  +  do_test incrblob-6.1 {
          432  +    sqlite3 db2 test.db
          433  +    execsql {
          434  +      BEGIN;
          435  +      INSERT INTO blobs(k, v, i) VALUES('a', 'different', 'connection');
          436  +    } db2
          437  +  } {}
          438  +  do_test incrblob-6.2 {
          439  +    execsql {
          440  +      SELECT rowid FROM blobs
          441  +    }
          442  +  } {1 2 3}
          443  +  do_test incrblob-6.3 {
          444  +    set rc [catch {
          445  +      db incrblob blobs v 1
          446  +    } msg]
          447  +    list $rc $msg
          448  +  } {1 {database is locked}}
          449  +  do_test incrblob-6.4 {
          450  +    set rc [catch {
          451  +      db incrblob blobs v 3
          452  +    } msg]
          453  +    list $rc $msg
          454  +  } {1 {database is locked}}
          455  +  do_test incrblob-6.5 {
          456  +    set ::blob [db incrblob -readonly blobs v 3]
          457  +    read $::blob
          458  +  } {hello}
          459  +  do_test incrblob-6.6 {
          460  +    close $::blob
          461  +  } {}
          462  +  
          463  +  do_test incrblob-6.7 {
          464  +    set ::blob [db2 incrblob blobs i 4]
          465  +    gets $::blob
          466  +  } {connection}
          467  +  do_test incrblob-6.8 {
          468  +    tell $::blob
          469  +  } {10}
          470  +  do_test incrblob-6.9 {
          471  +    seek $::blob 0
          472  +    puts -nonewline $::blob "invocation"
          473  +    flush $::blob
          474  +  } {}
          475  +  
          476  +  # At this point rollback should be illegal (because 
          477  +  # there is an open blob channel).  But commit is also illegal because
          478  +  # the open blob is read-write.
          479  +  #
          480  +  do_test incrblob-6.10 {
          481  +    catchsql {
          482  +      ROLLBACK;
          483  +    } db2
          484  +  } {1 {cannot rollback transaction - SQL statements in progress}}
          485  +  do_test incrblob-6.11 {
          486  +    catchsql {
          487  +      COMMIT;
          488  +    } db2
          489  +  } {1 {cannot commit transaction - SQL statements in progress}}
          490  +  
          491  +  do_test incrblob-6.12 {
          492  +    execsql {
          493  +      SELECT * FROM blobs WHERE rowid = 4;
          494  +    }
          495  +  } {}
          496  +  do_test incrblob-6.13 {
          497  +    close $::blob
          498  +  } {}
          499  +  do_test incrblob-6.14 {
          500  +    catchsql {
          501  +      COMMIT;
          502  +    } db2
          503  +  } {0 {}}
          504  +  do_test incrblob-6.15 {
          505  +    execsql {
          506  +      SELECT * FROM blobs WHERE rowid = 4;
          507  +    }
          508  +  } {a different invocation}
          509  +  db2 close
          510  +}
   503    511   sqlite3_soft_heap_limit $cmdlinearg(soft-heap-limit)
   504    512   
   505    513   #-----------------------------------------------------------------------
   506    514   # The following tests verify the behaviour of the incremental IO
   507    515   # APIs in the following cases:
   508    516   #
   509    517   #     7.1 A row that containing an open blob is modified.

Changes to test/pagerfault.test.

   670    670     faultsim_restore_and_reopen
   671    671   } -body {
   672    672     if {[catch {db backup test.db2} msg]} { error [regsub {.*: } $msg {}] }
   673    673   } -test {
   674    674     faultsim_test_result {0 {}} {1 {}} {1 {SQL logic error or missing database}}
   675    675   }
   676    676   
   677         -do_faultsim_test pagerfault-14b -prep {
   678         -  catch { db2 close }
   679         -  faultsim_restore_and_reopen
   680         -  sqlite3 db2 ""
   681         -  db2 eval { PRAGMA page_size = 4096; CREATE TABLE xx(a) }
   682         -} -body {
   683         -  sqlite3_backup B db2 main db main
   684         -  B step 200
   685         -  set rc [B finish]
   686         -  if {[string match SQLITE_IOERR_* $rc]} {set rc SQLITE_IOERR}
   687         -  if {$rc != "SQLITE_OK"} { error [sqlite3_test_errstr $rc] }
   688         -  set {} {}
   689         -} -test {
   690         -  faultsim_test_result {0 {}} {1 {sqlite3_backup_init() failed}}
          677  +# If TEMP_STORE is 2 or greater, then the database [db2] will be created
          678  +# as an in-memory database. This test will not work in that case, as it
          679  +# is not possible to change the page-size of an in-memory database. Even
          680  +# using the backup API.
          681  +#
          682  +if {$TEMP_STORE<2} {
          683  +  do_faultsim_test pagerfault-14b -prep {
          684  +    catch { db2 close }
          685  +    faultsim_restore_and_reopen
          686  +    sqlite3 db2 ""
          687  +    db2 eval { PRAGMA page_size = 4096; CREATE TABLE xx(a) }
          688  +  } -body {
          689  +    sqlite3_backup B db2 main db main
          690  +    B step 200
          691  +    set rc [B finish]
          692  +    if {[string match SQLITE_IOERR_* $rc]} {set rc SQLITE_IOERR}
          693  +    if {$rc != "SQLITE_OK"} { error [sqlite3_test_errstr $rc] }
          694  +    set {} {}
          695  +  } -test {
          696  +    faultsim_test_result {0 {}} {1 {sqlite3_backup_init() failed}}
          697  +  }
   691    698   }
          699  +
   692    700   do_faultsim_test pagerfault-14c -prep {
   693    701     catch { db2 close }
   694    702     faultsim_restore_and_reopen
   695    703     sqlite3 db2 test.db2
   696    704     db2 eval { 
   697    705       PRAGMA synchronous = off; 
   698    706       PRAGMA page_size = 4096; 

Changes to test/permutations.test.

    91     91   
    92     92   if {$::tcl_platform(platform)!="unix"} {
    93     93     set alltests [test_set $alltests -exclude crash.test crash2.test]
    94     94   }
    95     95   set alltests [test_set $alltests -exclude {
    96     96     all.test        async.test         quick.test  veryquick.test
    97     97     memleak.test    permutations.test  soak.test   fts3.test
    98         -  mallocAll.tes   rtree.test
           98  +  mallocAll.test  rtree.test
    99     99   }]
   100    100   
   101    101   set allquicktests [test_set $alltests -exclude {
   102    102     async2.test async3.test backup_ioerr.test corrupt.test
   103    103     corruptC.test crash.test crash2.test crash3.test crash4.test crash5.test
   104    104     crash6.test crash7.test delete3.test e_fts3.test fts3rnd.test
   105    105     fkey_malloc.test fuzz.test fuzz3.test fuzz_malloc.test in2.test loadext.test