interplane.Get Omega
Read in your language

sqlite

[Ported from github.com/sqlite/sqlite] Fix bugs in and improve the interface to the ".check" command of the CLI.

Brought by drakestapleton

branch master Branches Tags History

sqlite / test / qrf02.test

47 lines · 1294 bytes Raw Blame History
1# 2025-11-05
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# Test cases for the Query Result Formatter (QRF)
13#
14# These tests are for EXPLAIN and EXPLAIN QUERY PLAN formatting, the
15# output of which can change when enhancments are made to the query
16# planner. So expect to have to modify the expected results of these
17# test cases in the future.
18#
19
20set testdir [file dirname $argv0]
21source $testdir/tester.tcl
22set testprefix qrf02
23
24do_execsql_test 1.0 {
25 CREATE TABLE t1(a);
26 INSERT INTO t1 VALUES(1);
27}
28
29set result [db format {EXPLAIN SELECT * FROM t1}]
30do_test 1.10 {
31 set result
32} {/*addr opcode p1 p2 p3 p4 p5 comment
33---- ------------- ---- ---- ---- ------------- -- -------------
340 Init */}
35regsub -all {\d+} $result {N} result2
36do_test 1.11 {
37 set result2
38} "/.*\nN Rewind .*\nN Column .*/"
39
40do_test 1.20 {
41 set result "\n[db format {EXPLAIN QUERY PLAN SELECT * FROM t1}]"
42} {
43QUERY PLAN
44`--SCAN t1
45}
46
47finish_test