/ Check-in [5b8c44cd]
Login

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

Overview
Comment:Add an extra IO-error test to windowfault.test.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 5b8c44cd39c529e8adbc51f67088409e963515b988868856120a59e6c7160210
User & Date: dan 2019-03-30 17:07:23
Context
2019-03-30
17:30
Add the blobio.c extension module implementing readblob() and writeblob(). Experimental. check-in: e3fde56d user: drh tags: trunk
17:07
Add an extra IO-error test to windowfault.test. check-in: 5b8c44cd user: dan tags: trunk
2019-03-29
15:21
Remove the unused P5 flag from the OP_Rewind opcode. check-in: c2edbf3b user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/windowfault.test.

   157    157         WINDOW win1 AS (PARTITION BY a ),
   158    158                win2 AS (PARTITION BY b )
   159    159       ORDER BY a;
   160    160     }
   161    161   } -test {
   162    162     faultsim_test_result {0 {1 2 5 6 9 10}}
   163    163   }
          164  +
          165  +#-------------------------------------------------------------------------
          166  +# The following test causes a cursor in REQURESEEK state to be passed
          167  +# to sqlite3BtreeDelete(). An error is simulated within the seek operation
          168  +# to restore the cursors position.
          169  +#
          170  +reset_db
          171  +set big [string repeat x 900]
          172  +do_execsql_test 9.0 {
          173  +  PRAGMA page_size = 512;
          174  +  PRAGMA cache_size = 2;
          175  +  CREATE TABLE t(x INTEGER PRIMARY KEY, y TEXT);
          176  +  WITH s(i) AS (
          177  +    VALUES(1) UNION ALL SELECT i+1 FROM s WHERE i<1900
          178  +  )
          179  +  INSERT INTO t(y) SELECT $big FROM s;
          180  +}
          181  +db close
          182  +
          183  +testvfs tvfs -default 1
          184  +tvfs script vfs_callback
          185  +tvfs filter xRead
          186  +
          187  +sqlite3 db test.db
          188  +proc vfs_callback {method file args} {
          189  +  if {$file=="" && [info exists ::tmp_read_fail]} {
          190  +    incr ::tmp_read_fail -1
          191  +    if {$::tmp_read_fail<=0} {
          192  +      return "SQLITE_IOERR"
          193  +    }
          194  +  }
          195  +  return "SQLITE_OK"
          196  +}
          197  +
          198  +set FAULTSIM(tmpread) [list                \
          199  +  -injectstart   tmpread_injectstart       \
          200  +  -injectstop    tmpread_injectstop        \
          201  +  -injecterrlist {{1 {disk I/O error}}}    \
          202  +]
          203  +proc tmpread_injectstart {iFail} {
          204  +  set ::tmp_read_fail $iFail
          205  +}
          206  +proc tmpread_injectstop {} {
          207  +  set ret [expr $::tmp_read_fail<=0]
          208  +  unset -nocomplain ::tmp_read_fail 
          209  +  return $ret
          210  +}
          211  +
          212  +do_faultsim_test 9 -end 25 -faults tmpread -body {
          213  +  execsql {
          214  +    SELECT sum(y) OVER win FROM t
          215  +    WINDOW win AS (
          216  +      ORDER BY x ROWS BETWEEN UNBOUNDED PRECEDING AND 1800 FOLLOWING
          217  +    )
          218  +  }
          219  +} -test {
          220  +  faultsim_test_result {0 {}}
          221  +}
          222  +
          223  +catch {db close}
          224  +tvfs delete
   164    225   
   165    226   finish_test