xref: /sqlite-3.40.0/test/schemafault.test (revision 77f3f402)
1*77f3f402Sdan# 2018-08-19
2*77f3f402Sdan#
3*77f3f402Sdan# The author disclaims copyright to this source code.  In place of
4*77f3f402Sdan# a legal notice, here is a blessing:
5*77f3f402Sdan#
6*77f3f402Sdan#    May you do good and not evil.
7*77f3f402Sdan#    May you find forgiveness for yourself and forgive others.
8*77f3f402Sdan#    May you share freely, never taking more than you give.
9*77f3f402Sdan#
10*77f3f402Sdan#***********************************************************************
11*77f3f402Sdan# Test OOM injection in schema-related operations.
12*77f3f402Sdan#
13*77f3f402Sdan
14*77f3f402Sdanset testdir [file dirname $argv0]
15*77f3f402Sdansource $testdir/tester.tcl
16*77f3f402Sdansource $testdir/malloc_common.tcl
17*77f3f402Sdanset testprefix schemafault
18*77f3f402Sdan
19*77f3f402Sdando_execsql_test 1.0 {
20*77f3f402Sdan  CREATE TABLE t2(aaa INTTT);
21*77f3f402Sdan  CREATE VIEW v2(xxx , yyy) AS SELECT aaa, aaa+1 FROM t2;
22*77f3f402Sdan}
23*77f3f402Sdan
24*77f3f402Sdando_faultsim_test 1 -faults oom-* -prep {
25*77f3f402Sdan} -body {
26*77f3f402Sdan  execsql { SELECT * FROM v2 }
27*77f3f402Sdan} -test {
28*77f3f402Sdan  faultsim_test_result {0 {}}
29*77f3f402Sdan}
30*77f3f402Sdan
31*77f3f402Sdanfinish_test
32