1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-12-10 22:22:40 +03:00
Files
sqlite/test/indexexpr2.test
dan b8d29c2f75 Fix a segfault that could occur if an indexed expression was used in a
comparison operation within the result-set of a SELECT statement.

FossilOrigin-Name: d6bb7c42ff6309ce168ccdcf03b4cdabfccfc9e2a911d254ac7dc4fea4aa2bc1
2017-04-11 11:52:25 +00:00

37 lines
915 B
Plaintext

# 2017 April 11
#
# 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 implements regression tests for SQLite library.
#
set testdir [file dirname $argv0]
source $testdir/tester.tcl
set testprefix indexexpr2
do_execsql_test 1 {
CREATE TABLE t1(a, b);
INSERT INTO t1 VALUES(1, 'one');
INSERT INTO t1 VALUES(2, 'two');
INSERT INTO t1 VALUES(3, 'three');
CREATE INDEX i1 ON t1(b || 'x');
}
do_execsql_test 1.1 {
SELECT 'TWOX' == (b || 'x') FROM t1 WHERE (b || 'x')>'onex'
} {0 0}
do_execsql_test 1.2 {
SELECT 'TWOX' == (b || 'x') COLLATE nocase FROM t1 WHERE (b || 'x')>'onex'
} {0 1}
finish_test