/ Check-in [abccda76]
Login

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

Overview
Comment:Update a couple of test cases to account for the fact that ROLLBACK does not always abort all running SELECT statements.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: abccda769a3f6b755c3bf70b5fb31a5e16718ef3
User & Date: drh 2014-11-18 20:16:27
Context
2014-11-18
20:22
Fix a bug in the sqlite3TripAllCursors() routine that prevents it from reporting errors. It is unknown at this time whether or not this omission can result in any incorrect result in an actual query. check-in: 2896f264 user: drh tags: trunk
20:16
Update a couple of test cases to account for the fact that ROLLBACK does not always abort all running SELECT statements. check-in: abccda76 user: drh tags: trunk
2014-11-17
19:42
Avoid calling sqlite3BtreeKeysize() on a b-tree cursor in SKIPNEXT or SKIPPREV state. check-in: 54e7d3fc user: dan tags: trunk
15:22
Update a couple of test cases to account for the fact that ROLLBACK does not always abort all running SELECT statements. check-in: eba171e9 user: dan tags: branch-3.8.7
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/ioerr2.test.

   108    108       set ::sqlite_io_error_pending $::N
   109    109   
   110    110       foreach {::go res} [catchsql $sql] {}
   111    111       check_db ioerr2-4.[expr {$bPersist+2}].$::N
   112    112     }
   113    113   }
   114    114   
          115  +# When this test was written, an IO error within the UPDATE statement caused
          116  +# a rollback, which tripped all read-cursors, causing the outer SELECT to
          117  +# fail with "abort due to ROLLBACK". Now, the loop continues until the UPDATE
          118  +# is run successfully. At this point the next IO error occurs within the 
          119  +# SELECT - throwing the "disk I/O error" that the test case now expects.
          120  +#
   115    121   do_test ioerr2-5 {
   116    122     execsql {
   117    123       CREATE TABLE t2 AS SELECT * FROM t1;
   118    124       PRAGMA temp_store = memory;
   119    125     }
   120    126     set ::sqlite_io_error_persist 0
   121    127     set ::go 1
................................................................................
   126    132           set ::sqlite_io_error_pending $::N
   127    133           set sql {UPDATE t2 SET b = randstr(400,400)}
   128    134           foreach {::go res} [catchsql $sql] {}
   129    135         }
   130    136       }
   131    137     } msg]
   132    138     list $rc $msg
   133         -} {1 {abort due to ROLLBACK}}
          139  +} {1 {disk I/O error}} ;# used to be "{1 {abort due to ROLLBACK}}"
   134    140   
   135    141   if {$::tcl_platform(platform) == "unix"} {
   136    142     # Cause the call to xAccess used by [pragma temp_store_directory] to
   137    143     # determine if the specified directory is writable to fail. This causes
   138    144     # SQLite to report "not a writable directory", which is probably the
   139    145     # right answer.
   140    146     #

Changes to test/shared_err.test.

   442    442         ($rc1=="SQLITE_ERROR" && $rc2=="SQLITE_NOMEM") ||
   443    443         ($rc1=="SQLITE_ERROR" && $rc2=="SQLITE_IOERR") ||
   444    444         ($rc1=="SQLITE_ERROR" && $rc2=="SQLITE_CORRUPT")
   445    445       }
   446    446     } {1}
   447    447     db2 close
   448    448   }
          449  +
          450  +# When this test case was written, OOM errors in write statements would 
          451  +# cause transaction rollback, which would trip cursors in other statements,
          452  +# aborting them. This no longer happens.
          453  +#
   449    454   do_test shared_malloc-8.X {
   450    455     # Test that one or more queries were aborted due to the malloc() failure.
   451         -  expr $::aborted>=1
          456  +  # expr $::aborted>=1
          457  +  expr $::aborted==0
   452    458   } {1}
   453    459   
   454    460   # This test is designed to catch a specific bug that was present during
   455    461   # development of 3.5.0. If a malloc() failed while setting the page-size,
   456    462   # a buffer (Pager.pTmpSpace) was being freed. This could cause a seg-fault
   457    463   # later if another connection tried to use the pager.
   458    464   #