Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: third_party/sqlite/src/test/softheap1.test

Issue 901033002: Import SQLite 3.8.7.4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Chromium changes to support SQLite 3.8.7.4. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # 2007 Aug 10 1 # 2007 Aug 10
2 # 2 #
3 # The author disclaims copyright to this source code. In place of 3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing: 4 # a legal notice, here is a blessing:
5 # 5 #
6 # May you do good and not evil. 6 # May you do good and not evil.
7 # May you find forgiveness for yourself and forgive others. 7 # May you find forgiveness for yourself and forgive others.
8 # May you share freely, never taking more than you give. 8 # May you share freely, never taking more than you give.
9 # 9 #
10 #*********************************************************************** 10 #***********************************************************************
11 # 11 #
12 # This test script reproduces the problem reported by ticket #2565, 12 # This test script reproduces the problem reported by ticket #2565,
13 # A database corruption bug that occurs in auto_vacuum mode when 13 # A database corruption bug that occurs in auto_vacuum mode when
14 # the soft_heap_limit is set low enough to be triggered. 14 # the soft_heap_limit is set low enough to be triggered.
15 # 15 #
16 # $Id: softheap1.test,v 1.5 2008/07/08 17:13:59 danielk1977 Exp $ 16 # $Id: softheap1.test,v 1.5 2008/07/08 17:13:59 danielk1977 Exp $
17 17
18 18
19 set testdir [file dirname $argv0] 19 set testdir [file dirname $argv0]
20 source $testdir/tester.tcl 20 source $testdir/tester.tcl
21 21
22 ifcapable !integrityck { 22 ifcapable !integrityck {
23 finish_test 23 finish_test
24 return 24 return
25 } 25 }
26 26
27 sqlite3_soft_heap_limit -1 27 do_test softheap1-1.0 {
28 sqlite3_soft_heap_limit 0 28 execsql {PRAGMA soft_heap_limit}
29 } [sqlite3_soft_heap_limit -1]
30 do_test softheap1-1.1 {
31 execsql {PRAGMA soft_heap_limit=123456; PRAGMA soft_heap_limit;}
32 } {123456 123456}
33 do_test softheap1-1.2 {
34 sqlite3_soft_heap_limit -1
35 } {123456}
36 do_test softheap1-1.3 {
37 execsql {PRAGMA soft_heap_limit(-1); PRAGMA soft_heap_limit;}
38 } {123456 123456}
39 do_test softheap1-1.4 {
40 execsql {PRAGMA soft_heap_limit(0); PRAGMA soft_heap_limit;}
41 } {0 0}
42
29 sqlite3_soft_heap_limit 5000 43 sqlite3_soft_heap_limit 5000
30 do_test softheap1-1.1 { 44 do_test softheap1-2.0 {
45 execsql {PRAGMA soft_heap_limit}
46 } {5000}
47 do_test softheap1-2.1 {
31 execsql { 48 execsql {
32 PRAGMA auto_vacuum=1; 49 PRAGMA auto_vacuum=1;
33 CREATE TABLE t1(x); 50 CREATE TABLE t1(x);
34 INSERT INTO t1 VALUES(hex(randomblob(1000))); 51 INSERT INTO t1 VALUES(hex(randomblob(1000)));
35 BEGIN; 52 BEGIN;
36 } 53 }
37 execsql { 54 execsql {
38 CREATE TABLE t2 AS SELECT * FROM t1; 55 CREATE TABLE t2 AS SELECT * FROM t1;
39 } 56 }
40 execsql { 57 execsql {
41 ROLLBACK; 58 ROLLBACK;
42 } 59 }
43 execsql { 60 execsql {
44 PRAGMA integrity_check; 61 PRAGMA integrity_check;
45 } 62 }
46 } {ok} 63 } {ok}
47 64
48 sqlite3_soft_heap_limit $cmdlinearg(soft-heap-limit) 65 sqlite3_soft_heap_limit $cmdlinearg(soft-heap-limit)
49 finish_test 66 finish_test
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698