CoolFace
Modelpublic

AryaWu/sqlite

sourceHugging Faceupdated 9mo agoView on Hugging Face
0likes
tkt-18458b1a.test53 linesDownload Raw Back to test
1# 2019 September 102#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. In particular,12# that problems related to ticket [18458b1a] have been fixed.13#14 15set testdir [file dirname $argv0]16source $testdir/tester.tcl17set testprefix tkt-18458b1a18 19foreach tn {1 2} {20  reset_db21  if {$tn==1} {22    # Disable the flattener and push-down optimizations23    optimization_control db query-flattener 024    optimization_control db push-down 025  } else {26    # Enable them27    optimization_control db query-flattener 128    optimization_control db push-down 129  }30 31  db cache size 032 33  do_execsql_test $tn.1.1 {34    CREATE TABLE t0(c0 COLLATE NOCASE);35    INSERT INTO t0(c0) VALUES ('B');36    CREATE VIEW v0(c0, c1) AS SELECT DISTINCT t0.c0, 'a' FROM t0;37  } 38 39  do_execsql_test $tn.1.2 {40    SELECT count(*) FROM v0 WHERE c1 >= c0;41  } 142 43  do_execsql_test $tn.1.3 {44    SELECT count(*) FROM v0 WHERE NOT NOT (c1 >= c0);45  } 146 47  do_execsql_test $tn.1.4 {48    SELECT count(*) FROM v0 WHERE ((c1 >= c0) OR 0+0);49  } 150}51 52finish_test53