xref: /sqlite-3.40.0/test/returningfault.test (revision c6977c1c)
1# 2022 January 5
2#
3# The author disclaims copyright to this source code.  In place of
4# 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.tcl
15source $testdir/malloc_common.tcl
16
17
18do_execsql_test 1.0 {
19  CREATE TABLE t1 (b);
20} {}
21faultsim_save_and_close
22
23do_faultsim_test pagerfault-1 -faults oom-t* -prep {
24  faultsim_restore_and_reopen
25} -body {
26  execsql {
27    INSERT INTO t1(b) VALUES(65) RETURNING (
28      SELECT * FROM sqlite_temp_schema
29    ) AS aaa;
30  }
31} -test {
32  faultsim_test_result {1 {sub-select returns 5 columns - expected 1}}
33}
34
35
36finish_test
37