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
98 lines
2.1 KiB
Plaintext
98 lines
2.1 KiB
Plaintext
# 2022 October 14
|
|
#
|
|
# 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.
|
|
#
|
|
#***********************************************************************
|
|
#
|
|
|
|
source [file join [file dirname [info script]] recover_common.tcl]
|
|
|
|
db close
|
|
sqlite3_test_control_pending_byte 0x1000000
|
|
|
|
set testprefix recoverpgsz
|
|
|
|
foreach {pgsz bOverflow} {
|
|
512 0 1024 0 2048 0 4096 0 8192 0 16384 0 32768 0 65536 0
|
|
512 1 1024 1 2048 1 4096 1 8192 1 16384 1 32768 1 65536 1
|
|
} {
|
|
reset_db
|
|
execsql "PRAGMA page_size = $pgsz"
|
|
execsql "PRAGMA auto_vacuum = 0"
|
|
do_execsql_test 1.$pgsz.$bOverflow.1 {
|
|
CREATE TABLE t1(a, b, c);
|
|
CREATE INDEX i1 ON t1(b, a, c);
|
|
INSERT INTO t1(a, b) VALUES(1, 2), (3, 4), (5, 6);
|
|
DELETE FROM t1 WHERE a=3;
|
|
}
|
|
if {$bOverflow} {
|
|
do_execsql_test 1.$pgsz.$bOverflow.1a {
|
|
UPDATE t1 SET c = randomblob(100000);
|
|
}
|
|
}
|
|
db close
|
|
|
|
|
|
set fd [open test.db]
|
|
fconfigure $fd -translation binary
|
|
seek $fd $pgsz
|
|
set pg1 [read $fd $pgsz]
|
|
set pg2 [read $fd $pgsz]
|
|
close $fd
|
|
|
|
set fd2 [open test.db2 w]
|
|
fconfigure $fd2 -translation binary
|
|
seek $fd2 $pgsz
|
|
puts -nonewline $fd2 $pg1
|
|
close $fd2
|
|
|
|
sqlite3 db2 test.db2
|
|
do_test 1.$pgsz.$bOverflow.2 {
|
|
set R [sqlite3_recover_init db2 main test.db3]
|
|
$R run
|
|
$R finish
|
|
} {}
|
|
|
|
sqlite3 db3 test.db3
|
|
do_test 1.$pgsz.$bOverflow.3 {
|
|
db3 eval { SELECT * FROM sqlite_schema }
|
|
db3 eval { PRAGMA page_size }
|
|
} $pgsz
|
|
|
|
db2 close
|
|
db3 close
|
|
|
|
forcedelete test.db3
|
|
forcedelete test.db2
|
|
|
|
set fd2 [open test.db2 w]
|
|
fconfigure $fd2 -translation binary
|
|
seek $fd2 $pgsz
|
|
puts -nonewline $fd2 $pg2
|
|
close $fd2
|
|
|
|
sqlite3 db2 test.db2
|
|
do_test 1.$pgsz.$bOverflow.4 {
|
|
set R [sqlite3_recover_init db2 main test.db3]
|
|
$R run
|
|
$R finish
|
|
} {}
|
|
|
|
sqlite3 db3 test.db3
|
|
do_test 1.$pgsz.$bOverflow.5 {
|
|
db3 eval { SELECT * FROM sqlite_schema }
|
|
db3 eval { PRAGMA page_size }
|
|
} $pgsz
|
|
|
|
db2 close
|
|
db3 close
|
|
}
|
|
|
|
|
|
finish_test
|