1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Improvements to the way that truncation is implemented in sqlite_dbpage().

FossilOrigin-Name: ac4bb2e4ecf0bdb0d8ac12b1ccb42d51af02f519a038cfc79faab5c216971056
This commit is contained in:
drh
2025-01-02 15:03:13 +00:00
parent e0b6ee5185
commit a683b055fb
5 changed files with 152 additions and 20 deletions

View File

@ -82,5 +82,31 @@ do_catchsql_test 3.2 {
# faultsim_test_result {0 {}}
#}
reset_db
forcedelete test.db2
do_execsql_test 4.0 {
CREATE TABLE t1(x);
INSERT INTO t1 VALUES('one');
CREATE TABLE t2(x);
INSERT INTO t2 VALUES('two');
ATTACH 'test.db2' AS aux;
CREATE TABLE aux.x1(x);
}
set pgno [db one {SELECT max(rootpage) FROM sqlite_schema}]
faultsim_save_and_close
do_faultsim_test 4 -prep {
faultsim_restore_and_reopen
execsql { ATTACH 'test.db2' AS aux; }
} -body {
execsql {
UPDATE sqlite_dbpage SET data = (
SELECT data FROM sqlite_dbpage WHERE pgno=($pgno-1)
) WHERE pgno = $pgno;
}
} -test {
faultsim_test_result {0 {}} {1 {unable to open a temporary database file for storing temporary tables}}
}
finish_test