1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00
is used in a scalar subquery, be sure to exit the loop as soon as the first
valid output row is received.  Fix for ticket [cb3aa0641d9a4].

FossilOrigin-Name: cdbb0947f9ce18d6d7e29ffab5ea6a2ee5365fbb
This commit is contained in:
drh
2016-01-13 17:50:10 +00:00
parent 8656b24144
commit a04a8be2c2
4 changed files with 39 additions and 19 deletions

View File

@ -528,4 +528,21 @@ do_test 8.3 {
set res
} 5000
#---------------------------------------------------------------------------
# https://www.sqlite.org/src/tktview/cb3aa0641d9a413841c004293a4fc06cdc122029
#
# Adverse interaction between scalar subqueries and the partial-sorting
# logic.
#
do_execsql_test 9.0 {
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(x INTEGER PRIMARY KEY);
INSERT INTO t1 VALUES(1),(2);
DROP TABLE IF EXISTS t2;
CREATE TABLE t2(y);
INSERT INTO t2 VALUES(9),(8),(3),(4);
SELECT (SELECT x||y FROM t2, t1 ORDER BY x, y);
} {13}
finish_test