diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 17:28:19 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 17:28:19 +0000 |
commit | 18657a960e125336f704ea058e25c27bd3900dcb (patch) | |
tree | 17b438b680ed45a996d7b59951e6aa34023783f2 /ext/fts5/test/fts5plan.test | |
parent | Initial commit. (diff) | |
download | sqlite3-upstream.tar.xz sqlite3-upstream.zip |
Adding upstream version 3.40.1.upstream/3.40.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | ext/fts5/test/fts5plan.test | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/ext/fts5/test/fts5plan.test b/ext/fts5/test/fts5plan.test new file mode 100644 index 0000000..6862acf --- /dev/null +++ b/ext/fts5/test/fts5plan.test @@ -0,0 +1,65 @@ +# 2014 Dec 20 +# +# The author disclaims copyright to this source code. In place of +# a legal notice, here is a blessing: +# +# May you do good and not evil. +# May you find forgiveness for yourself and forgive others. +# May you share freely, never taking more than you give. +# +#*********************************************************************** +# +# This file focuses on testing the planner (xBestIndex function). +# + +source [file join [file dirname [info script]] fts5_common.tcl] +set testprefix fts5plan + +# If SQLITE_ENABLE_FTS5 is defined, omit this file. +ifcapable !fts5 { + finish_test + return +} + +do_execsql_test 1.0 { + CREATE TABLE t1(x, y); + CREATE VIRTUAL TABLE f1 USING fts5(ff); +} + +do_eqp_test 1.1 { + SELECT * FROM t1, f1 WHERE f1 MATCH t1.x +} { + QUERY PLAN + |--SCAN t1 + `--SCAN f1 VIRTUAL TABLE INDEX 0:M1 +} + +do_eqp_test 1.2 { + SELECT * FROM t1, f1 WHERE f1 > t1.x +} { + QUERY PLAN + |--SCAN f1 VIRTUAL TABLE INDEX 0: + `--SCAN t1 +} + +do_eqp_test 1.3 { + SELECT * FROM f1 WHERE f1 MATCH ? ORDER BY ff +} { + QUERY PLAN + |--SCAN f1 VIRTUAL TABLE INDEX 0:M1 + `--USE TEMP B-TREE FOR ORDER BY +} + +do_eqp_test 1.4 { + SELECT * FROM f1 ORDER BY rank +} { + QUERY PLAN + |--SCAN f1 VIRTUAL TABLE INDEX 0: + `--USE TEMP B-TREE FOR ORDER BY +} + +do_eqp_test 1.5 { + SELECT * FROM f1 WHERE rank MATCH ? +} {SCAN f1 VIRTUAL TABLE INDEX 0:r} + +finish_test |