mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-14 00:22:38 +03:00
Allow INDEXED BY and NOT INDEXED clauses in SELECT statements. (CVS 5766)
FossilOrigin-Name: 98ca5580f5acd2e7b3ce512520ec0527f221505e
This commit is contained in:
17
src/select.c
17
src/select.c
@@ -12,7 +12,7 @@
|
||||
** This file contains C code routines that are called by the parser
|
||||
** to handle SELECT statements in SQLite.
|
||||
**
|
||||
** $Id: select.c,v 1.476 2008/09/23 09:36:10 drh Exp $
|
||||
** $Id: select.c,v 1.477 2008/10/06 05:32:19 danielk1977 Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
|
||||
@@ -2982,6 +2982,21 @@ static int selectExpander(Walker *pWalker, Select *p){
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Locate the index named by the INDEXED BY clause, if any. */
|
||||
if( pFrom->zIndex ){
|
||||
char *zIndex = pFrom->zIndex;
|
||||
Index *pIdx;
|
||||
for(pIdx=pTab->pIndex;
|
||||
pIdx && sqlite3StrICmp(pIdx->zName, zIndex);
|
||||
pIdx=pIdx->pNext
|
||||
);
|
||||
if( !pIdx ){
|
||||
sqlite3ErrorMsg(pParse, "no such index: %s", zIndex, 0);
|
||||
return WRC_Abort;
|
||||
}
|
||||
pFrom->pIndex = pIdx;
|
||||
}
|
||||
}
|
||||
|
||||
/* Process NATURAL keywords, and ON and USING clauses of joins.
|
||||
|
||||
Reference in New Issue
Block a user