3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
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.
10 #***********************************************************************
11 # This file implements regression tests for SQLite library.
15 set testdir [file dirname $argv0]
16 source $testdir/tester.tcl
17 source $testdir/malloc_common.tcl
18 set ::testprefix rowvaluefault
21 CREATE TABLE xyz(one, two, thr, fou);
22 INSERT INTO xyz VALUES('A', 'A', 'A', 1);
23 INSERT INTO xyz VALUES('B', 'B', 'B', 2);
24 INSERT INTO xyz VALUES('C', 'C', 'C', 3);
25 INSERT INTO xyz VALUES('D', 'D', 'D', 4);
27 CREATE UNIQUE INDEX xyz_one_two ON xyz(one, two);
30 do_faultsim_test 1 -faults oom* -body {
31 execsql { SELECT fou FROM xyz WHERE (one, two, thr) = ('B', 'B', 'B') }
33 faultsim_test_result {0 2}
36 do_faultsim_test 2 -faults oom* -body {
37 execsql { SELECT fou FROM xyz WHERE (two, thr) IS ('C', 'C') }
39 faultsim_test_result {0 3}
42 do_faultsim_test 3 -faults oom* -body {
43 execsql { SELECT fou FROM xyz WHERE (one, two, thr) > ('B', 'B', 'B') }
45 faultsim_test_result {0 {3 4}}
48 do_faultsim_test 4 -faults oom* -body {
49 execsql { SELECT fou FROM xyz WHERE (one, two) IN (SELECT one, two FROM xyz) }
51 faultsim_test_result {0 {1 2 3 4}}
54 do_faultsim_test 5 -faults oom* -body {
57 WHERE (one, two, thr) IN (SELECT one, two, thr FROM xyz)
60 faultsim_test_result {0 {1 2 3 4}}
63 do_faultsim_test 6 -faults oom* -body {
66 WHERE (one, two, thr) BETWEEN ('B', 'B', 'B') AND ('C', 'C', 'C') }
68 faultsim_test_result {0 {2 3}}