Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Unified Diff: third_party/sqlite/src/test/orderby1.test

Issue 1610963002: Import SQLite 3.10.2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/sqlite/src/test/offset1.test ('k') | third_party/sqlite/src/test/orderby8.test » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/test/orderby1.test
diff --git a/third_party/sqlite/src/test/orderby1.test b/third_party/sqlite/src/test/orderby1.test
index 6674e322209eb184a15c9f1e6a9b4625a7b4b033..831936ae9680997a08a8803bd545355a44e8b144 100644
--- a/third_party/sqlite/src/test/orderby1.test
+++ b/third_party/sqlite/src/test/orderby1.test
@@ -463,6 +463,9 @@ do_execsql_test 5.1 {
do_execsql_test 5.2 {
SELECT 5 UNION ALL SELECT 3 ORDER BY 1
} {3 5}
+do_execsql_test 5.3 {
+ SELECT 986 AS x GROUP BY X ORDER BY X
+} {986}
# The following test (originally derived from a single test within fuzz.test)
# verifies that a PseudoTable cursor is not closed prematurely in a deeply
@@ -495,5 +498,51 @@ do_execsql_test 7.0 {
SELECT * FROM t7 WHERE a=?1 ORDER BY rowid;
} {~/ORDER BY/}
+#-------------------------------------------------------------------------
+# Test a partial sort large enough to cause the sorter to spill data
+# to disk.
+#
+reset_db
+do_execsql_test 8.0 {
+ PRAGMA cache_size = 5;
+ CREATE TABLE t1(a, b);
+ CREATE INDEX i1 ON t1(a);
+}
+
+do_eqp_test 8.1 {
+ SELECT * FROM t1 ORDER BY a, b;
+} {
+ 0 0 0 {SCAN TABLE t1 USING INDEX i1}
+ 0 0 0 {USE TEMP B-TREE FOR RIGHT PART OF ORDER BY}
+}
+
+do_execsql_test 8.2 {
+ WITH cnt(i) AS (
+ SELECT 1 UNION ALL SELECT i+1 FROM cnt WHERE i<10000
+ )
+ INSERT INTO t1 SELECT i%2, randomblob(500) FROM cnt;
+}
+
+do_test 8.3 {
+ db eval { SELECT * FROM t1 ORDER BY a, b } { incr res $a }
+ 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
« no previous file with comments | « third_party/sqlite/src/test/offset1.test ('k') | third_party/sqlite/src/test/orderby8.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698