CoolFace
Modelpublic

AryaWu/sqlite

sourceHugging Faceupdated 9mo agoView on Hugging Face
0likes
tkt-d11f09d36e.test62 linesDownload Raw Back to test
1# 2010 June 262#3# The author disclaims copyright to this source code.  In place of4# 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 has13# been fixed.14#15 16set testdir [file dirname $argv0]17source $testdir/tester.tcl18 19set a_string_counter 120proc a_string {n} {21  global a_string_counter22  incr a_string_counter23  string range [string repeat "${a_string_counter}." $n] 1 $n24}25db func a_string a_string26 27do_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 COMMIT38} {}39do_test tkt-d11f09d36e.2 {40  execsql {41    BEGIN;42      UPDATE t1 set x = x+10000;43    ROLLBACK;44  }45} {}46do_test tkt-d11f09d36e.3 {47  execsql { PRAGMA integrity_check }48} {ok}49do_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} {}57do_test tkt-d11f09d36e.5 {58  execsql { PRAGMA integrity_check }59} {ok}60 61finish_test62