drh | e19d594 | 2006-01-06 03:29:56 +0000 | [diff] [blame] | 1 | # 2005 December 29 |
| 2 | # |
| 3 | # The author disclaims copyright to this source code. In place of |
| 4 | # 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 | # This file implements regression tests for SQLite library. |
| 12 | # |
| 13 | # This file implements tests to verify that the new serial_type |
| 14 | # values of 8 (integer 0) and 9 (integer 1) work correctly. |
| 15 | # |
| 16 | |
| 17 | set testdir [file dirname $argv0] |
| 18 | source $testdir/tester.tcl |
| 19 | |
drh | 76fe803 | 2006-07-11 14:17:51 +0000 | [diff] [blame] | 20 | db eval {PRAGMA legacy_file_format=OFF} |
drh | ff91c45 | 2006-06-27 12:51:12 +0000 | [diff] [blame] | 21 | |
drh | 3765df4 | 2006-06-28 18:18:09 +0000 | [diff] [blame] | 22 | # The size of the database depends on whether or not autovacuum |
| 23 | # is enabled. |
| 24 | # |
drh | 847d3ab | 2007-05-04 14:36:22 +0000 | [diff] [blame] | 25 | ifcapable autovacuum { |
| 26 | if {[db one {PRAGMA auto_vacuum}]} { |
| 27 | set small 3072 |
| 28 | set large 5120 |
| 29 | } else { |
| 30 | set small 2048 |
| 31 | set large 4096 |
| 32 | } |
drh | 3765df4 | 2006-06-28 18:18:09 +0000 | [diff] [blame] | 33 | } else { |
| 34 | set small 2048 |
| 35 | set large 4096 |
| 36 | } |
| 37 | |
drh | e19d594 | 2006-01-06 03:29:56 +0000 | [diff] [blame] | 38 | do_test format4-1.1 { |
| 39 | execsql { |
| 40 | CREATE TABLE t1(x0,x1,x2,x3,x4,x5,x6,x7,x8,x9); |
| 41 | INSERT INTO t1 VALUES(0,0,0,0,0,0,0,0,0,0); |
| 42 | INSERT INTO t1 SELECT * FROM t1; |
| 43 | INSERT INTO t1 SELECT * FROM t1; |
| 44 | INSERT INTO t1 SELECT * FROM t1; |
| 45 | INSERT INTO t1 SELECT * FROM t1; |
| 46 | INSERT INTO t1 SELECT * FROM t1; |
| 47 | INSERT INTO t1 SELECT * FROM t1; |
| 48 | } |
| 49 | file size test.db |
drh | 3765df4 | 2006-06-28 18:18:09 +0000 | [diff] [blame] | 50 | } $small |
drh | e19d594 | 2006-01-06 03:29:56 +0000 | [diff] [blame] | 51 | do_test format4-1.2 { |
| 52 | execsql { |
| 53 | UPDATE t1 SET x0=1, x1=1, x2=1, x3=1, x4=1, x5=1, x6=1, x7=1, x8=1, x9=1 |
| 54 | } |
| 55 | file size test.db |
drh | 3765df4 | 2006-06-28 18:18:09 +0000 | [diff] [blame] | 56 | } $small |
drh | e19d594 | 2006-01-06 03:29:56 +0000 | [diff] [blame] | 57 | do_test format4-1.3 { |
| 58 | execsql { |
| 59 | UPDATE t1 SET x0=2, x1=2, x2=2, x3=2, x4=2, x5=2, x6=2, x7=2, x8=2, x9=2 |
| 60 | } |
| 61 | file size test.db |
drh | 3765df4 | 2006-06-28 18:18:09 +0000 | [diff] [blame] | 62 | } $large |
drh | e19d594 | 2006-01-06 03:29:56 +0000 | [diff] [blame] | 63 | |
| 64 | |
| 65 | finish_test |