Files
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

119 lines
2.8 KiB
Plaintext

# 2011 May 16
#
# The author disclaims copyright to this source code. In place of
# a legal notice, here is a blessing:
#
# May you do good and not evil.
# May you find forgiveness for yourself and forgive others.
# May you share freely, never taking more than you give.
#
#***********************************************************************
# This file implements regression tests for SQLite library. The
# focus of this file is testing the PRAGMA journal_size_limit when
# in WAL mode.
#
set testdir [file dirname $argv0]
source $testdir/tester.tcl
ifcapable !wal {finish_test ; return }
# Case 1: No size limit. Journal can get large.
#
do_test wal7-1.0 {
db close
forcedelete test.db
sqlite3 db test.db
db eval {
PRAGMA page_size=1024;
PRAGMA journal_mode=WAL;
PRAGMA wal_autocheckpoint=50; -- 50 pages
CREATE TABLE t1(x, y UNIQUE);
INSERT INTO t1 VALUES(1,2);
INSERT INTO t1 VALUES(zeroblob(200000),4);
CREATE TABLE t2(z);
DELETE FROM t1;
INSERT INTO t2 SELECT x FROM t1;
}
expr {[file size test.db-wal]>50*1100}
} 1
do_test wal7-1.1 {
db eval {PRAGMA wal_checkpoint}
expr {[file size test.db-wal]>50*1100}
} 1
do_test wal7-1.2 {
db eval {INSERT INTO t2 VALUES('hi');}
expr {[file size test.db-wal]>50*1100}
} 1
# Case 2: Size limit at half the autocheckpoint size.
#
do_test wal7-2.0 {
db close
forcedelete test.db
sqlite3 db test.db
db eval {
PRAGMA page_size=1024;
PRAGMA journal_mode=WAL;
PRAGMA wal_autocheckpoint=50; -- 50 pages
PRAGMA journal_size_limit=25000;
CREATE TABLE t1(x, y UNIQUE);
INSERT INTO t1 VALUES(1,2);
INSERT INTO t1 VALUES(zeroblob(200000),4);
CREATE TABLE t2(z);
DELETE FROM t1;
INSERT INTO t2 VALUES(1);
}
file size test.db-wal
} 25000
# Case 3: Size limit of zero.
#
do_test wal7-3.0 {
db close
forcedelete test.db
sqlite3 db test.db
db eval {
PRAGMA page_size=1024;
PRAGMA journal_mode=WAL;
PRAGMA wal_autocheckpoint=50; -- 50 pages
PRAGMA journal_size_limit=0;
CREATE TABLE t1(x, y UNIQUE);
INSERT INTO t1 VALUES(1,2);
INSERT INTO t1 VALUES(zeroblob(200000),4);
CREATE TABLE t2(z);
DELETE FROM t1;
INSERT INTO t2 VALUES(1);
}
set sz [file size test.db-wal]
expr {$sz>0 && $sz<13700}
} 1
# Case 4: Size limit set before going WAL
#
do_test wal7-4.0 {
db close
forcedelete test.db
sqlite3 db test.db
db eval {
PRAGMA page_size=1024;
PRAGMA journal_size_limit=25000;
PRAGMA journal_mode=WAL;
PRAGMA wal_autocheckpoint=50; -- 50 pages
CREATE TABLE t1(x, y UNIQUE);
INSERT INTO t1 VALUES(1,2);
INSERT INTO t1 VALUES(zeroblob(200000),4);
CREATE TABLE t2(z);
DELETE FROM t1;
INSERT INTO t2 VALUES(1);
}
set sz [file size test.db-wal]
} 25000
finish_test