dan | b8d29c2 | 2017-04-11 11:52:25 +0000 | [diff] [blame] | 1 | # 2017 April 11 |
| 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 | # This file implements regression tests for SQLite library. |
| 12 | # |
| 13 | |
| 14 | set testdir [file dirname $argv0] |
| 15 | source $testdir/tester.tcl |
| 16 | set testprefix indexexpr2 |
| 17 | |
| 18 | do_execsql_test 1 { |
| 19 | CREATE TABLE t1(a, b); |
| 20 | INSERT INTO t1 VALUES(1, 'one'); |
| 21 | INSERT INTO t1 VALUES(2, 'two'); |
| 22 | INSERT INTO t1 VALUES(3, 'three'); |
| 23 | |
| 24 | CREATE INDEX i1 ON t1(b || 'x'); |
| 25 | } |
| 26 | |
| 27 | do_execsql_test 1.1 { |
| 28 | SELECT 'TWOX' == (b || 'x') FROM t1 WHERE (b || 'x')>'onex' |
| 29 | } {0 0} |
| 30 | |
| 31 | do_execsql_test 1.2 { |
| 32 | SELECT 'TWOX' == (b || 'x') COLLATE nocase FROM t1 WHERE (b || 'x')>'onex' |
| 33 | } {0 1} |
| 34 | |
dan | 39c9d3a | 2017-04-21 17:03:32 +0000 | [diff] [blame] | 35 | do_execsql_test 2.0 { |
| 36 | CREATE INDEX i2 ON t1(a+1); |
| 37 | } |
| 38 | |
| 39 | do_execsql_test 2.1 { |
| 40 | SELECT a+1, quote(a+1) FROM t1 ORDER BY 1; |
| 41 | } {2 2 3 3 4 4} |
| 42 | |
dan | b8d29c2 | 2017-04-11 11:52:25 +0000 | [diff] [blame] | 43 | finish_test |