sqlite
[Ported from github.com/sqlite/sqlite] Fix bugs in and improve the interface to the ".check" command of the CLI.
Brought by drakestapleton
| 1 | # 2023 March 30 |
| 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 | |
| 13 | set testdir [file dirname $argv0] |
| 14 | source $testdir/tester.tcl |
| 15 | set testprefix aggfault |
| 16 | |
| 17 | |
| 18 | do_execsql_test 1 { |
| 19 | CREATE TABLE t1(x); |
| 20 | CREATE INDEX t1x ON t1(x, x=0); |
| 21 | } |
| 22 | faultsim_save_and_close |
| 23 | |
| 24 | do_faultsim_test 2 -faults oom* -prep { |
| 25 | faultsim_restore_and_reopen |
| 26 | execsql { SELECT * FROM sqlite_schema } |
| 27 | } -body { |
| 28 | execsql { |
| 29 | SELECT * FROM t1 AS a1 WHERE ( |
| 30 | SELECT count(x AND 0=a1.x) FROM t1 GROUP BY abs(1) |
| 31 | ) AND x=( |
| 32 | SELECT * FROM t1 AS a1 |
| 33 | WHERE (SELECT count(x IS 1 AND a1.x=0) |
| 34 | FROM t1 |
| 35 | GROUP BY abs(1)) AND x=0 |
| 36 | ); |
| 37 | } |
| 38 | } -test { |
| 39 | faultsim_test_result {0 {}} |
| 40 | } |
| 41 | |
| 42 | |
| 43 | finish_test |