diff options
author | dan <dan@noemail.net> | 2019-08-05 20:53:19 +0000 |
---|---|---|
committer | dan <dan@noemail.net> | 2019-08-05 20:53:19 +0000 |
commit | 5978a7a525c58e1402b87ba957d287f650e0f9ab (patch) | |
tree | 50bb16d0813c95ba856b00c5cd0c80e31d97c65c /src/insert.c | |
parent | 1194904b814d6da63930dee75bc468094706226a (diff) | |
parent | 0a8d06a93f308e2ad450a62b961a09d43c15bba6 (diff) | |
download | sqlite-5978a7a525c58e1402b87ba957d287f650e0f9ab.tar.gz sqlite-5978a7a525c58e1402b87ba957d287f650e0f9ab.zip |
Ensure that columns of views and sub-queries that are expressions with no affinity are not assigned BLOB affinity. This matches the documentation. Fix for [61c853857f40da49].
FossilOrigin-Name: e15a0977ddfad3d0f4c7654c5665ff10830c25b20ecf6ef500b1ba23fb89e31f
Diffstat (limited to 'src/insert.c')
-rw-r--r-- | src/insert.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/insert.c b/src/insert.c index 2fe015fa0..2f1a19952 100644 --- a/src/insert.c +++ b/src/insert.c @@ -88,18 +88,18 @@ const char *sqlite3IndexAffinityStr(sqlite3 *db, Index *pIdx){ } for(n=0; n<pIdx->nColumn; n++){ i16 x = pIdx->aiColumn[n]; + char aff; if( x>=0 ){ - pIdx->zColAff[n] = pTab->aCol[x].affinity; + aff = pTab->aCol[x].affinity; }else if( x==XN_ROWID ){ - pIdx->zColAff[n] = SQLITE_AFF_INTEGER; + aff = SQLITE_AFF_INTEGER; }else{ - char aff; assert( x==XN_EXPR ); assert( pIdx->aColExpr!=0 ); aff = sqlite3ExprAffinity(pIdx->aColExpr->a[n].pExpr); - if( aff==0 ) aff = SQLITE_AFF_BLOB; - pIdx->zColAff[n] = aff; } + if( aff==0 ) aff = SQLITE_AFF_BLOB; + pIdx->zColAff[n] = aff; } pIdx->zColAff[n] = 0; } |