CoolFace
Modelpublic

AryaWu/sqlite

sourceHugging Faceupdated 9mo agoView on Hugging Face
0likes
seekscan1.test69 linesDownload Raw Back to test
1# 2022 October 72#3# The author disclaims copyright to this source code.  In place of4# 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# This file implements regression tests for SQLite library.12#13 14set testdir [file dirname $argv0]15source $testdir/tester.tcl16set testprefix seekscan117 18do_execsql_test 1.0 {19  CREATE TABLE t1(a TEXT, b INT, c INT NOT NULL, PRIMARY KEY(a,b,c));20  WITH RECURSIVE c(x) AS (VALUES(0) UNION ALL SELECT x+1 FROM c WHERE x<1997)21    INSERT INTO t1(a,b,c) SELECT printf('xyz%d',x/10),x/6,x FROM c;22  INSERT INTO t1 VALUES('abc',234,6);23  INSERT INTO t1 VALUES('abc',345,7);24  ANALYZE;25}26 27 28do_execsql_test 1.1 {29  SELECT a,b,c FROM t1 30  WHERE b IN (234, 345) AND c BETWEEN 6 AND 6.5 AND a='abc' 31  ORDER BY a, b;32} {33  abc 234 634}35 36do_execsql_test 1.2 {37  SELECT a,b,c FROM t1 38  WHERE b IN (234, 345) AND c BETWEEN 6 AND 7 AND a='abc' 39  ORDER BY a, b;40} {41  abc 234 642  abc 345 743}44 45do_execsql_test 1.3 {46  SELECT a,b,c FROM t1 47  WHERE b IN (234, 345) AND c >=6 AND a='abc' 48  ORDER BY a, b;49} {50  abc 234 651  abc 345 752}53 54do_execsql_test 1.4 {55  SELECT a,b,c FROM t1 56  WHERE b IN (234, 345) AND c<=7 AND a='abc' 57  ORDER BY a, b;58} {59  abc 234 660  abc 345 761}62 63do_execsql_test 1.5 {64  SELECT a,b,c FROM t1 WHERE b IN (235, 345) AND c<=3 AND a='abc' ORDER BY a, b;65}66 67 68finish_test69