/ Check-in [49763fc3]
Login

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

Overview
Comment:Add another OOM test to this branch.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | session-retry
Files: files | file ages | folders
SHA1: 49763fc3ae2fb6117b0443ea28661568467f9bf2
User & Date: dan 2016-03-31 15:08:10
Context
2016-04-04
14:57
Enhance sqlite3session_apply() and sqlite3session_apply_strm() so that conflicts are retried before the xConflict() callback is invoked, as long as the "apply" operation is making forward progress. check-in: 42a21966 user: drh tags: trunk
2016-03-31
15:08
Add another OOM test to this branch. Closed-Leaf check-in: 49763fc3 user: dan tags: session-retry
10:50
Add further tests for the code on this branch. Fix a problem in OOM handling. check-in: 195f3340 user: dan tags: session-retry
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/session/sessionfault2.test.

    66     66     } else {
    67     67       if {
    68     68            $res != "1 2 2 3 3 4 1 0 2 1 3 2"
    69     69         && $res != "1 1 2 2 3 3 1 1 2 2 3 3"
    70     70       } { error "data error!! $res" }
    71     71     }
    72     72   }
           73  +
           74  +#-------------------------------------------------------------------------
           75  +# OOM when applying a changeset for which one of the tables has a name
           76  +# 99 bytes in size. This happens to cause an extra malloc in within the
           77  +# sessions_strm permutation.
           78  +#
           79  +reset_db
           80  +set nm [string repeat t 99]
           81  +do_execsql_test 2.0.0 [string map "%TBL% $nm" {
           82  +  CREATE TABLE %TBL%(a PRIMARY KEY, b UNIQUE);
           83  +}]
           84  +faultsim_save_and_close
           85  +
           86  +faultsim_restore_and_reopen
           87  +do_test 1.0.1 {
           88  +  set ::C [changeset_from_sql [string map "%TBL% $nm" {
           89  +    INSERT INTO %TBL% VALUES(1, 2);
           90  +    INSERT INTO %TBL% VALUES(3, 4);
           91  +  }]]
           92  +  set {} {}
           93  +} {}
           94  +
           95  +proc xConflict args { return "OMIT" }
           96  +do_faultsim_test 2 -faults oom-p* -prep {
           97  +  faultsim_restore_and_reopen
           98  +} -body {
           99  +  sqlite3changeset_apply db $::C xConflict
          100  +} -test {
          101  +  faultsim_test_result {0 {}} {1 SQLITE_NOMEM}
          102  +  faultsim_integrity_check
          103  +}
    73    104   
    74    105   finish_test
    75    106