More lenient handling of ORDER BY optimization in joins with mixed ASC/DESC.

This is a better and less restrictive fix for the problem addressed by
the previous check-in.

FossilOrigin-Name: abcf6a5d054559ee5a093ba39180c47b4958d9cd
This commit is contained in:
drh
2012-10-02 15:19:19 +00:00
parent 178eb61c6b
commit afcd522af8
4 changed files with 13 additions and 15 deletions
+2 -2
View File
@@ -194,7 +194,7 @@ do_test 2.1b {
EXPLAIN QUERY PLAN
SELECT name FROM album JOIN track USING (aid) ORDER BY title, tn
}
} {/ORDER BY/} ;# ORDER BY required because of missing aid term in ORDER BY
} {~/ORDER BY/} ;# ORDER BY optimized out
do_test 2.1c {
db eval {
@@ -296,7 +296,7 @@ do_test 2.6c {
EXPLAIN QUERY PLAN
SELECT name FROM album JOIN track USING (aid) ORDER BY title DESC, tn DESC
}
} {/ORDER BY/} ;# ORDER BY required
} {~/ORDER BY/} ;# ORDER BY optimized out
# Generate another test dataset, but this time using mixed ASC/DESC indices.