CoolFace
Modelpublic

AryaWu/sqlite

sourceHugging Faceupdated 9mo agoView on Hugging Face
0likes
reservebytes.test52 linesDownload Raw Back to test
1# 2025 August 272#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#12 13set testdir [file dirname $argv0]14source $testdir/tester.tcl15set testprefix reservebytes16 17 18 19reset_db20file_control_reservebytes db 021 22 23do_execsql_test 1.0 {24  CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c);25  CREATE INDEX i1 ON t1(b, c);26  WITH s(i) AS (27    VALUES(1) UNION ALL SELECT i+1 FROM s WHERE i<100028  )29  INSERT INTO t1 SELECT NULL, i, hex(randomblob(500)) FROM s;30}31 32sqlite3 db2 test.db33if {[permutation]=="prepare"} { db2 cache size 0 }34 35do_execsql_test -db db2 1.1 { PRAGMA integrity_check } {ok}36 37file_control_reservebytes db 838do_test 1.2.1 { hexio_read test.db 20 1 } {00}39do_execsql_test -db db2 1.2.2 { PRAGMA integrity_check } {ok}40 41do_execsql_test 1.3.2 { VACUUM }42do_execsql_test -db db2 1.3.4 { PRAGMA integrity_check } {ok}43do_test 1.3.5 { hexio_read test.db 20 1 } {08}44 45file_control_reservebytes db 1646do_test 1.4.1 { hexio_read test.db 20 1 } {08}47do_execsql_test 1.4.2 { VACUUM }48do_execsql_test -db db2 1.4.3 { PRAGMA integrity_check } {ok}49do_test 1.4.4 { hexio_read test.db 20 1 } {10}50 51finish_test52