Disable sorting by indices if there is a COLLATE subclause in the
ORDER BY clause. (CVS 713) FossilOrigin-Name: 2438da791afb53b4f1c7a9ff9705d393c86f3cbd
This commit is contained in:
parent
0c44e2edf3
commit
c330af1dca
16
manifest
16
manifest
@ -1,5 +1,5 @@
|
||||
C Fix\sfor\sticket\s#132:\smake\sthe\sworking\sdirectory\sthe\slast\schoice\sfor\swhere\r\nto\swrite\stemporary\sfiles,\snot\sthe\sfirst\schoice.\s(CVS\s712)
|
||||
D 2002-08-14T00:10:44
|
||||
C Disable\ssorting\sby\sindices\sif\sthere\sis\sa\sCOLLATE\ssubclause\sin\sthe\nORDER\sBY\sclause.\s(CVS\s713)
|
||||
D 2002-08-14T03:03:57
|
||||
F Makefile.in 6291a33b87d2a395aafd7646ee1ed562c6f2c28c
|
||||
F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906
|
||||
F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd
|
||||
@ -54,7 +54,7 @@ F src/update.c f07e6ed2c517c92871e54d3f5886d1cf56121b11
|
||||
F src/util.c bdbf0aedcec21ede2248126bbbe734bcc070b7c8
|
||||
F src/vdbe.c aad57e622827dc864529f1609a8e94240d4ed92a
|
||||
F src/vdbe.h a9292f2b5fcecef924fa255fb74609e9cbc776c2
|
||||
F src/where.c 9a6d2783cabead68a2b9e857521b0b841f2c1d55
|
||||
F src/where.c 68ac5d2066da7a9a1aac98ecaebe6187d85137ed
|
||||
F test/all.test 9a6eb262393f74cb7fb09b17156491a34b941fe3
|
||||
F test/bigrow.test 8ab252dba108f12ad64e337b0f2ff31a807ac578
|
||||
F test/btree.test bf326f546a666617367a7033fa2c07451bd4f8e1
|
||||
@ -110,7 +110,7 @@ F test/update.test 7ffb062d580a972e7870d0f51d5af3ab9bfeae08
|
||||
F test/vacuum.test 059871b312eb910bbe49dafde1d01490cc2c6bbe
|
||||
F test/version.test c7057526e14c7e3da5718b88e7f566f4182fd5c5
|
||||
F test/view.test 3afca084dab44c7a5772d3c6a326adf93ad52050
|
||||
F test/where.test 1f87bec674bf85d74ac1cc5b2cd3d89be1e87b1d
|
||||
F test/where.test c7aba40ad9178acf9c898e53aac9e447e2d2f2f7
|
||||
F tool/diffdb.c 7524b1b5df217c20cd0431f6789851a4e0cb191b
|
||||
F tool/lemon.c 459cb2bb3738a1ad5cb0ad8b805587a88a885d95
|
||||
F tool/lempar.c 73a991cc3017fb34804250fa901488b5147b3717
|
||||
@ -131,7 +131,7 @@ F www/c_interface.tcl fb87b825b9032b9aa941694c5c9c5aee9424467e
|
||||
F www/changes.tcl df6f06b1aa97ef285c744bf19ec3efddf707b05f
|
||||
F www/conflict.tcl 81dd21f9a679e60aae049e9dd8ab53d59570cda2
|
||||
F www/crosscompile.tcl 3622ebbe518927a3854a12de51344673eb2dd060
|
||||
F www/datatypes.tcl c18a57dd02ba12bbede52f24ae9325f7fc1bf463
|
||||
F www/datatypes.tcl ac58cd17bd96cbf1dc228dfb965f88e3e8d45c6b
|
||||
F www/download.tcl 29aa6679ca29621d10613f60ebbbda18f4b91c49
|
||||
F www/dynload.tcl 02eb8273aa78cfa9070dd4501dca937fb22b466c
|
||||
F www/faq.tcl e5a752ff431a8408ae24a91ab88ded2dfe699e16
|
||||
@ -145,7 +145,7 @@ F www/speed.tcl 7fc83f1b018e1ecc451838449542c3079ed12425
|
||||
F www/sqlite.tcl ae3dcfb077e53833b59d4fcc94d8a12c50a44098
|
||||
F www/tclsqlite.tcl 1db15abeb446aad0caf0b95b8b9579720e4ea331
|
||||
F www/vdbe.tcl 2013852c27a02a091d39a766bc87cff329f21218
|
||||
P 4ff0f578eca4a8672cf570923e6c015c3ba6b9f4
|
||||
R 3ea2591da8167f93c94c2776f3fbc0b8
|
||||
P 26a4e7e7a3eee62c170ce264cb964a92bc7f52c9
|
||||
R 215a8fd5d2921ac00a3d290d9e37f326
|
||||
U drh
|
||||
Z 20aea3fa8ac9897b397b10a04bcc9725
|
||||
Z 8f90666769659acaee3140c2279b94e8
|
||||
|
@ -1 +1 @@
|
||||
26a4e7e7a3eee62c170ce264cb964a92bc7f52c9
|
||||
2438da791afb53b4f1c7a9ff9705d393c86f3cbd
|
@ -13,7 +13,7 @@
|
||||
** the WHERE clause of SQL statements. Also found here are subroutines
|
||||
** to generate VDBE code to evaluate expressions.
|
||||
**
|
||||
** $Id: where.c,v 1.61 2002/08/13 23:02:58 drh Exp $
|
||||
** $Id: where.c,v 1.62 2002/08/14 03:03:57 drh Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
|
||||
@ -181,6 +181,10 @@ static Index *findSortingIndex(
|
||||
/* Indices can only be used for ascending sort order */
|
||||
return 0;
|
||||
}
|
||||
if( (pOrderBy->a[i].sortOrder & SQLITE_SO_TYPEMASK)!=SQLITE_SO_UNK ){
|
||||
/* Do not sort by index if there is a COLLATE clause */
|
||||
return 0;
|
||||
}
|
||||
p = pOrderBy->a[i].pExpr;
|
||||
if( p->op!=TK_COLUMN || p->iTable!=base ){
|
||||
/* Can not use an index sort on anything that is not a column in the
|
||||
|
@ -11,7 +11,7 @@
|
||||
# This file implements regression tests for SQLite library. The
|
||||
# focus of this file is testing the use of indices in WHERE clases.
|
||||
#
|
||||
# $Id: where.test,v 1.9 2002/06/19 14:27:06 drh Exp $
|
||||
# $Id: where.test,v 1.10 2002/08/14 03:03:58 drh Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@ -442,6 +442,22 @@ do_test where-6.16 {
|
||||
SELECT t3.a, t1.x FROM t3, t1 WHERE t3.a=t1.w ORDER BY t1.x, t3.a LIMIT 3
|
||||
}
|
||||
} {1 0 2 1 3 1 sort}
|
||||
do_test where-6.17 {
|
||||
cksort {
|
||||
SELECT y FROM t1 ORDER BY w COLLATE text LIMIT 3;
|
||||
}
|
||||
} {4 121 10201 sort}
|
||||
do_test where-6.18 {
|
||||
cksort {
|
||||
SELECT y FROM t1 ORDER BY w COLLATE numeric LIMIT 3;
|
||||
}
|
||||
} {4 9 16 sort}
|
||||
do_test where-6.19 {
|
||||
cksort {
|
||||
SELECT y FROM t1 ORDER BY w LIMIT 3;
|
||||
}
|
||||
} {4 9 16 nosort}
|
||||
|
||||
|
||||
|
||||
finish_test
|
||||
|
@ -1,7 +1,7 @@
|
||||
#
|
||||
# Run this script to generated a datatypes.html output file
|
||||
#
|
||||
set rcsid {$Id: datatypes.tcl,v 1.1 2002/08/14 00:08:13 drh Exp $}
|
||||
set rcsid {$Id: datatypes.tcl,v 1.2 2002/08/14 03:03:58 drh Exp $}
|
||||
|
||||
puts {<html>
|
||||
<head>
|
||||
@ -169,7 +169,7 @@ text
|
||||
</pre></blockquote>
|
||||
|
||||
<p>
|
||||
For table columns, the datatype is determined by the datatype declaration
|
||||
For table columns, the datatype is determined by the type declaration
|
||||
of the CREATE TABLE statement. The datatype is text if and only if
|
||||
the type declaration contains one or more of the following strings:
|
||||
</p>
|
||||
|
Loading…
x
Reference in New Issue
Block a user