1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-12 23:22:53 +03:00

Enhance IN processing to allow efficient use of indices with numeric affinities.

Add test cases for IN processing that would have spotted the error in the
[2be661a48023f4] check-in.

FossilOrigin-Name: 5ded9b68388f4024425c11f09b03529ac89454ce
This commit is contained in:
drh
2012-09-18 19:29:06 +00:00
parent d4305ca61c
commit dbaee5e342
4 changed files with 147 additions and 9 deletions

View File

@@ -1542,8 +1542,7 @@ int sqlite3FindInIndex(Parse *pParse, Expr *pX, int *prNotFound){
** comparison is the same as the affinity of the column. If
** it is not, it is not possible to use any index.
*/
char aff = comparisonAffinity(pX);
int affinity_ok = (pTab->aCol[iCol].affinity==aff||aff==SQLITE_AFF_NONE);
int affinity_ok = sqlite3IndexAffinityOk(pX, pTab->aCol[iCol].affinity);
for(pIdx=pTab->pIndex; pIdx && eType==0 && affinity_ok; pIdx=pIdx->pNext){
if( (pIdx->aiColumn[0]==iCol)