gitlab.com/CoiaPrant/sqlite3@v1.19.1/testdata/tcl/tkt-d11f09d36e.test (about)

     1  # 2010 June 26
     2  #
     3  # The author disclaims copyright to this source code.  In place of
     4  # a legal notice, here is a blessing:
     5  #
     6  #    May you do good and not evil.
     7  #    May you find forgiveness for yourself and forgive others.
     8  #    May you share freely, never taking more than you give.
     9  #
    10  #***********************************************************************
    11  #
    12  # Test that the bug reported by ticket d11f09d36e7cb0821e01f4 has
    13  # been fixed.
    14  #
    15  
    16  set testdir [file dirname $argv0]
    17  source $testdir/tester.tcl
    18  
    19  set a_string_counter 1
    20  proc a_string {n} {
    21    global a_string_counter
    22    incr a_string_counter
    23    string range [string repeat "${a_string_counter}." $n] 1 $n
    24  }
    25  db func a_string a_string
    26  
    27  do_test tkt-d11f09d36e.1 {
    28    execsql {
    29      PRAGMA synchronous = NORMAL;
    30      PRAGMA cache_size = 10;
    31      CREATE TABLE t1(x, y, UNIQUE(x, y));
    32      BEGIN;
    33    }
    34    for {set i 0} {$i < 10000} {incr i} {
    35      execsql { INSERT INTO t1 VALUES($i, $i) }
    36    }
    37    execsql COMMIT
    38  } {}
    39  do_test tkt-d11f09d36e.2 {
    40    execsql {
    41      BEGIN;
    42        UPDATE t1 set x = x+10000;
    43      ROLLBACK;
    44    }
    45  } {}
    46  do_test tkt-d11f09d36e.3 {
    47    execsql { PRAGMA integrity_check }
    48  } {ok}
    49  do_test tkt-d11f09d36e.4 {
    50    execsql {
    51      SAVEPOINT tr;
    52        UPDATE t1 set x = x+10000;
    53      ROLLBACK TO tr;
    54      RELEASE tr;
    55    }
    56  } {}
    57  do_test tkt-d11f09d36e.5 {
    58    execsql { PRAGMA integrity_check }
    59  } {ok}
    60  
    61  finish_test