mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-30 19:03:16 +03:00
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:
@ -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
|
||||
|
Reference in New Issue
Block a user