CoolFace
Modelpublic

AryaWu/sqlite

sourceHugging Faceupdated 9mo agoView on Hugging Face
0likes
format4.test67 linesDownload Raw Back to test
1# 2005 December 292#3# The author disclaims copyright to this source code.  In place of4# 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_type14# values of 8 (integer 0) and 9 (integer 1) work correctly.15#16 17set testdir [file dirname $argv0]18source $testdir/tester.tcl19 20#db eval {PRAGMA legacy_file_format=OFF}21sqlite3_db_config db LEGACY_FILE_FORMAT 022 23# The size of the database depends on whether or not autovacuum24# is enabled.25#26ifcapable autovacuum {27  if {[db one {PRAGMA auto_vacuum}]} {28    set small 307229    set large 512030  } else {31    set small 204832    set large 409633  }34} else {35  set small 204836  set large 409637}38 39do_test format4-1.1 {40  execsql {41    CREATE TABLE t1(x0,x1,x2,x3,x4,x5,x6,x7,x8,x9);42    INSERT INTO t1 VALUES(0,0,0,0,0,0,0,0,0,0);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    INSERT INTO t1 SELECT * FROM t1;49  }50  file size test.db51} $small52do_test format4-1.2 {53  execsql {54    UPDATE t1 SET x0=1, x1=1, x2=1, x3=1, x4=1, x5=1, x6=1, x7=1, x8=1, x9=155  }56  file size test.db57} $small58do_test format4-1.3 {59  execsql {60    UPDATE t1 SET x0=2, x1=2, x2=2, x3=2, x4=2, x5=2, x6=2, x7=2, x8=2, x9=261  }62  file size test.db63} $large64 65 66finish_test67