1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-01 06:27:03 +03:00

Fix a problem with the fix for [9cf6c9bb51] (commit [658b84d7]) that could cause a cursor to be left in an invalid state following a (rowid < text-value) search.

FossilOrigin-Name: bc7d2c1656396bb4f5f1f814e60dbf816cc91c5a521b54ad593cd3da0fe8dcb4
This commit is contained in:
dan
2019-05-14 20:25:22 +00:00
parent 9252966b3c
commit a40cb96a4c
4 changed files with 33 additions and 11 deletions

View File

@ -765,4 +765,26 @@ do_execsql_test rowid-14.4 {
SELECT * FROM t14 WHERE x < 'a' ORDER BY rowid DESC;
} {}
reset_db
do_execsql_test rowid-15.0 {
PRAGMA reverse_unordered_selects=true;
CREATE TABLE t1 (c0, c1);
CREATE TABLE t2 (c0 INT UNIQUE);
INSERT INTO t1(c0, c1) VALUES (0, 0), (0, NULL);
INSERT INTO t2(c0) VALUES (1);
}
do_execsql_test rowid-15.1 {
SELECT t2.c0, t1.c1 FROM t1, t2
WHERE (t2.rowid <= 'a') OR (t1.c0 <= t2.c0) LIMIT 100
} {1 {} 1 0}
do_execsql_test rowid-15.2 {
SELECT 1, NULL INTERSECT SELECT * FROM (
SELECT t2.c0, t1.c1 FROM t1, t2
WHERE ((t2.rowid <= 'a')) OR (t1.c0 <= t2.c0) ORDER BY 'a' DESC LIMIT 100
);
} {1 {}}
finish_test