Debian Codegraph @

test/eqp2.test

raw
1 # 2024 March 20
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
16 set testprefix eqp2
17
18 do_execsql_test 1.0 {
19 CREATE TABLE t1(a, b, c, d);
20 CREATE INDEX i1 ON t1(a, b, c);
21 }
22
23 do_eqp_test 1.1 {
24 SELECT * FROM t1 ORDER BY a, b, c
25 } {
26 QUERY PLAN
27 `--SCAN t1 USING INDEX i1
28 }
29
30
31 do_eqp_test 1.2 {
32 SELECT * FROM t1 ORDER BY a, b, +c
33 } {
34 QUERY PLAN
35 |--SCAN t1 USING INDEX i1
36 `--USE TEMP B-TREE FOR LAST TERM OF ORDER BY
37 }
38
39 do_eqp_test 1.3 {
40 SELECT * FROM t1 ORDER BY a, +b, +c
41 } {
42 QUERY PLAN
43 |--SCAN t1 USING INDEX i1
44 `--USE TEMP B-TREE FOR LAST 2 TERMS OF ORDER BY
45 }
46
47 finish_test
48
49