0
0
mirror of https://github.com/tursodatabase/libsql.git synced 2025-03-13 09:38:06 +00:00
libsql/test/dbpagefault.test

53 lines
1.2 KiB
Plaintext
Raw Normal View History

# 2022 July 06
#
# 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.
#
#***********************************************************************
#
set testdir [file dirname $argv0]
source $testdir/tester.tcl
source $testdir/lock_common.tcl
source $testdir/malloc_common.tcl
if {[permutation] == "inmemory_journal"} {
finish_test
return
}
set testprefix dbpagefault
faultsim_save_and_close
do_faultsim_test 1 -prep {
faultsim_restore_and_reopen
execsql { ATTACH 'test.db2' AS aux; }
} -body {
execsql {
CREATE VIRTUAL TABLE t1 USING sqlite_dbpage();
}
} -test {
execsql { PRAGMA journal_mode = off }
faultsim_test_result {0 {}}
}
do_faultsim_test 2 -prep {
sqlite3 db "xyz.db" -vfs memdb
execsql { ATTACH 'test.db2' AS aux; }
} -body {
execsql {
CREATE VIRTUAL TABLE t1 USING sqlite_dbpage();
INSERT INTO t1 DEFAULT VALUES;
}
} -test {
execsql { PRAGMA journal_mode = off }
faultsim_test_result {1 {no such schema}} {1 {SQL logic error}}
}
finish_test