sl@0: # 2007 Sep 13 sl@0: # sl@0: # The author disclaims copyright to this source code. In place of sl@0: # a legal notice, here is a blessing: sl@0: # sl@0: # May you do good and not evil. sl@0: # May you find forgiveness for yourself and forgive others. sl@0: # May you share freely, never taking more than you give. sl@0: # sl@0: #*********************************************************************** sl@0: # sl@0: # This file attempts to duplicate an error scenario seen on a sl@0: # customer system using version 3.2.2. The problem appears to sl@0: # have been fixed (perhaps by accident) with check-in [3503]. sl@0: # These tests will prevent an accidental recurrance. sl@0: # sl@0: # $Id: shortread1.test,v 1.1 2007/09/14 01:48:12 drh Exp $ sl@0: # sl@0: sl@0: set testdir [file dirname $argv0] sl@0: source $testdir/tester.tcl sl@0: sl@0: do_test shortread1-1.1 { sl@0: execsql { sl@0: CREATE TABLE t1(a TEXT); sl@0: BEGIN; sl@0: INSERT INTO t1 VALUES(hex(randomblob(5000))); sl@0: INSERT INTO t1 VALUES(hex(randomblob(100))); sl@0: PRAGMA freelist_count; sl@0: } sl@0: } {0} sl@0: do_test shortread1-1.2 { sl@0: execsql { sl@0: DELETE FROM t1 WHERE rowid=1; sl@0: PRAGMA freelist_count; sl@0: } sl@0: } {11} sl@0: do_test shortread1-1.3 { sl@0: sqlite3_release_memory [expr {1024*9}] sl@0: execsql { sl@0: INSERT INTO t1 VALUES(hex(randomblob(5000))); sl@0: PRAGMA freelist_count; sl@0: } sl@0: } {0} sl@0: do_test shortread1-1.4 { sl@0: execsql { sl@0: COMMIT; sl@0: SELECT count(*) FROM t1; sl@0: } sl@0: } {2} sl@0: sl@0: finish_test