1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-11 01:42:22 +03:00

Activate the ability to use expressions in indexes in a query. There are some

test failures, but mostly this seems to work.

FossilOrigin-Name: 42f93f582eccd8a778189aa6c113874f995ab751
This commit is contained in:
drh
2015-08-27 18:24:02 +00:00
parent b377020ca9
commit 6860e6fa6f
6 changed files with 27 additions and 12 deletions

View File

@@ -93,9 +93,12 @@ const char *sqlite3IndexAffinityStr(sqlite3 *db, Index *pIdx){
}else if( x==(-1) ){
pIdx->zColAff[n] = SQLITE_AFF_INTEGER;
}else{
char aff;
assert( x==(-2) );
assert( pIdx->aColExpr!=0 );
pIdx->zColAff[n] = sqlite3ExprAffinity(pIdx->aColExpr->a[n].pExpr);
aff = sqlite3ExprAffinity(pIdx->aColExpr->a[n].pExpr);
if( aff==0 ) aff = SQLITE_AFF_BLOB;
pIdx->zColAff[n] = aff;
}
}
pIdx->zColAff[n] = 0;