3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
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.
10 #***********************************************************************
11 # This file implements regression tests for SQLite library. The
12 # focus of this file is testing the SQLITE_DIRECT_OVERFLOW_READ logic.
15 set testdir [file dirname $argv0]
16 source $testdir/tester.tcl
21 # CREATE TABLE t1(c1 TEXT, c2 TEXT);
23 # with 2000 rows. In each row, c2 spans multiple overflow pages. The text
24 # value of c1 ranges in size from 1 to 2000 bytes. The idea is to create
25 # at least one row where the first byte of c2 is also the first byte of
26 # an overflow page. This was at one point exposing an obscure bug in the
27 # SQLITE_DIRECT_OVERFLOW_READ logic.
30 set c2 [string repeat abcdefghij 200]
32 PRAGMA cache_size = 10;
33 CREATE TABLE t1(c1 TEXT, c2 TEXT);
36 for {set i 1} {$i <= 2000} {incr i} {
37 set c1 [string repeat . $i]
38 execsql { INSERT INTO t1 VALUES($c1, $c2) }
44 SELECT sum(length(c2)) FROM t1;