/ Check-in [f267ce80]
Login

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

Overview
Comment:Add a test case to reproduce the database corruption problem reported by ticket #2565. (CVS 4204)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f267ce809424ec2cc167bf9750989413a8f925c1
User & Date: drh 2007-08-10 19:46:44
Context
2007-08-10
23:47
Convert fts2 to use sqlite3_prepare_v2() to prevent certain logic errors around SQLITE_SCHEMA handling. This also allows sql_step_statement() and sql_step_leaf_statement() to be replaced with sqlite3_step().

Also fix a logic error in flushPendingTerms() which was clearing the term table in case of error. This was wrong in the face of SQLITE_SCHEMA. Even though the change to sqlite3_prepare_v2() should cause us not to see SQLITE_SCHEMA any longer, it was still a logic error... (CVS 4205) check-in: 16730cb1 user: shess tags: trunk

19:46
Add a test case to reproduce the database corruption problem reported by ticket #2565. (CVS 4204) check-in: f267ce80 user: drh tags: trunk
19:46
Update tests so that they work properly even if the soft-heap-limit is set low. (CVS 4203) check-in: e01eb99e user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Added test/softheap1.test.









































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# 2007 Aug 10
#
# The author disclaims copyright to this source code.  In place of
# a legal notice, here is a blessing:
#
#    May you do good and not evil.
#    May you find forgiveness for yourself and forgive others.
#    May you share freely, never taking more than you give.
#
#***********************************************************************
# 
# This test script reproduces the problem reported by ticket #2565,
# A database corruption bug that occurs in auto_vacuum mode when
# the soft_heap_limit is set low enough to be triggered.
#
# $Id: softheap1.test,v 1.1 2007/08/10 19:46:44 drh Exp $


set testdir [file dirname $argv0]
source $testdir/tester.tcl

sqlite3_soft_heap_limit 5000
do_test softheap1-1.1 {
  execsql {
    PRAGMA auto_vacuum=1;
    CREATE TABLE t1(x);
    INSERT INTO t1 VALUES(hex(randomblob(5000)));
    BEGIN;
    CREATE TABLE t2 AS SELECT * FROM t1;
    ROLLBACK;
    PRAGMA integrity_check;
  }
} {ok}
sqlite3_soft_heap_limit $soft_limit
   
finish_test