Handle "rowid<=X ORDER BY rowid DESC" where X is an integer. Fix for ticket #1092. (CVS 2307)

FossilOrigin-Name: 506088796c846243e24c4cba6be4ce6511fdb345
This commit is contained in:
danielk1977
2005-02-02 01:10:44 +00:00
parent e90b1bd1f1
commit d0a6932f70
4 changed files with 34 additions and 12 deletions
+23 -1
View File
@@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The
# focus of this file is testing the CREATE TABLE statement.
#
# $Id: sort.test,v 1.18 2004/11/22 13:35:42 danielk1977 Exp $
# $Id: sort.test,v 1.19 2005/02/02 01:10:45 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -410,4 +410,26 @@ do_test sort-9.7 {
} {3}
} ;# endif bloblit
# Ticket #1092 - ORDER BY on rowid fields.
do_test sort-10.1 {
execsql {
CREATE TABLE t7(c INTEGER PRIMARY KEY);
INSERT INTO t7 VALUES(1);
INSERT INTO t7 VALUES(2);
INSERT INTO t7 VALUES(3);
INSERT INTO t7 VALUES(4);
}
} {}
do_test sort-10.2 {
execsql {
SELECT c FROM t7 WHERE c<=3 ORDER BY c DESC;
}
} {3 2 1}
do_test sort-10.3 {
execsql {
SELECT c FROM t7 WHERE c<3 ORDER BY c DESC;
}
} {2 1}
finish_test