-C Fix\sa\spost-OOM\scrash\sin\supdateRangeAffinityStr().\s\sAdd\sseveral\sALWAYS()\nmacros\son\sunreachable\sbranches.
-D 2016-08-26T18:17:08.713
+C Enhance\ssqlite3FindInIndex()\sso\sthat\sit\sis\sable\sto\smake\suse\sof\sthe\nprimary\skeys\sat\sthe\send\sof\san\sindex.
+D 2016-08-26T19:31:29.011
F Makefile.in cfd8fb987cd7a6af046daa87daa146d5aad0e088
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
F Makefile.msc 5017381e4853b1472e01d5bb926be1268eba429c
F src/date.c 95c9a8d00767e7221a8e9a31f4e913fc8029bf6b
F src/dbstat.c 19ee7a4e89979d4df8e44cfac7a8f905ec89b77d
F src/delete.c 76c084f0265f4a3cd1ecf17eee112a94f1ccbc05
-F src/expr.c 1f2ddbec8bf6de323cc0da3ff73e80b0ad21769d
+F src/expr.c 192dac6da7ff380fde35861d3f9d40bab39fab2c
F src/fault.c 160a0c015b6c2629d3899ed2daf63d75754a32bb
F src/fkey.c e2be0968c1adc679c87e467aa5b4f167588f38a8
F src/func.c 29cc9acb170ec1387b9f63eb52cd85f8de96c771
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P b34413ac7e34369b4420e57b0132249dca68a7b0
-R e94f28a1c30d92b873747a9f1cb33b94
+P 87d40195ae5cc2abd9bae45073a615db81263285
+R c0ed51d5af8253a23448fcfb693a50e8
U drh
-Z a3a8a387b6b2455df60af55b1e2df964
+Z 3b9104524847b85ed5a08921e98408a8
-87d40195ae5cc2abd9bae45073a615db81263285
\ No newline at end of file
+4b589fbfcc4265902de0f552961d2df497a184da
\ No newline at end of file
*/
#ifndef SQLITE_OMIT_SUBQUERY
int sqlite3FindInIndex(
- Parse *pParse,
- Expr *pX,
- u32 inFlags,
- int *prRhsHasNull,
- int *aiMap
+ Parse *pParse, /* Parsing context */
+ Expr *pX, /* The right-hand side (RHS) of the IN operator */
+ u32 inFlags, /* IN_INDEX_LOOP, _MEMBERSHIP, and/or _NOOP_OK */
+ int *prRhsHasNull, /* Register holding NULL status. See notes */
+ int *aiMap /* Mapping from Index fields to RHS fields */
){
Select *p; /* SELECT to the right of IN operator */
int eType = 0; /* Type of RHS table. IN_INDEX_* */
** to this collation sequence. */
for(pIdx=pTab->pIndex; pIdx && eType==0 && affinity_ok; pIdx=pIdx->pNext){
- if( pIdx->nKeyCol<nExpr ) continue;
- if( mustBeUnique && (pIdx->nKeyCol!=nExpr || !IsUniqueIndex(pIdx)) ){
- continue;
+ if( pIdx->nColumn<nExpr ) continue;
+ if( mustBeUnique ){
+ if( pIdx->nKeyCol>nExpr
+ ||(pIdx->nColumn>nExpr && !IsUniqueIndex(pIdx))
+ ){
+ continue;
+ }
}
for(i=0; i<nExpr; i++){
CollSeq *pReq = sqlite3BinaryCompareCollSeq(pParse, pLhs, pRhs);
int j;
- if( pReq==0 ) break;
-
+ assert( pReq!=0 || pRhs->iColumn==XN_ROWID || pParse->nErr );
for(j=0; j<nExpr; j++){
if( pIdx->aiColumn[j]!=pRhs->iColumn ) continue;
assert( pIdx->azColl[j] );
+ if( pReq==0 ) continue;
if( sqlite3StrICmp(pReq->zName, pIdx->azColl[j])!=0 ) continue;
break;
}