CoolFace
Modelpublic

AryaWu/sqlite

sourceHugging Faceupdated 9mo agoView on Hugging Face
0likes
existsfault.test50 linesDownload Raw Back to test
1# 2024 May 252#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.tcl15source $testdir/lock_common.tcl16source $testdir/malloc_common.tcl17set testprefix existsfault18 19db close20sqlite3_shutdown21sqlite3_config_lookaside 0 022sqlite3_initialize23autoinstall_test_functions24sqlite3 db test.db25 26do_execsql_test 1.0 {27  CREATE TABLE x1(a, b);28  INSERT INTO x1 VALUES(1, 2), (3, 4), (5, 6);29  CREATE UNIQUE INDEX x1a ON x1(a);30  CREATE INDEX x1b ON x1(b);31 32  CREATE TABLE x2(x, y);33  INSERT INTO x2 VALUES(1, 2), (3, 4), (5, 6);34}35 36do_faultsim_test 1 -faults oom* -prep {37  sqlite3 db test.db38  execsql { SELECT * FROM sqlite_schema }39} -body {40  execsql {41    SELECT count(*) FROM x2 WHERE EXISTS (SELECT 1 FROM x1 WHERE a=x) AND y!=1142  }43} -test {44  faultsim_test_result {0 3}45}46 47finish_test48 49 50