1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Add test script selectC.test which demonstrates ticket #3381. (CVS 5708)

FossilOrigin-Name: 3847faff55d4bd7574785c3b18d5c95e687c7598
This commit is contained in:
drh
2008-09-16 15:09:53 +00:00
parent fab1127bd1
commit ec8d24279b
3 changed files with 81 additions and 7 deletions

73
test/selectC.test Normal file
View File

@ -0,0 +1,73 @@
# 2008 September 16
#
# 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.
#
# $Id: selectC.test,v 1.1 2008/09/16 15:09:54 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
do_test selectC-1.1 {
execsql {
CREATE TABLE t1(a, b, c);
INSERT INTO t1 VALUES(1,'aaa','bbb');
INSERT INTO t1 SELECT * FROM t1;
INSERT INTO t1 VALUES(2,'ccc','ddd');
SELECT DISTINCT a AS x, b||c AS y
FROM t1
WHERE y IN ('aaabbb','xxx');
}
} {1 aaabbb}
do_test selectC-1.2 {
execsql {
SELECT DISTINCT a AS x, b||c AS y
FROM t1
WHERE b||c IN ('aaabbb','xxx');
}
} {1 aaabbb}
do_test selectC-1.3 {
execsql {
SELECT DISTINCT a AS x, b||c AS y
FROM t1
WHERE y='aaabbb'
}
} {1 aaabbb}
do_test selectC-1.4 {
execsql {
SELECT DISTINCT a AS x, b||c AS y
FROM t1
WHERE b||c='aaabbb'
}
} {1 aaabbb}
do_test selectC-1.5 {
execsql {
SELECT DISTINCT a AS x, b||c AS y
FROM t1
WHERE x=2
}
} {2 cccddd}
do_test selectC-1.6 {
execsql {
SELECT DISTINCT a AS x, b||c AS y
FROM t1
WHERE a=2
}
} {2 cccddd}
do_test selectC-1.7 {
execsql {
SELECT DISTINCT a AS x, b||c AS y
FROM t1
WHERE +y='aaabbb'
}
} {1 aaabbb}
finish_test