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

Use 0x40 (ASCII '@') instead of 0x00 to mean "no affinity" so that columns

with no affinity can appear in a zero-terminated string.  Use the new
SQLITE_AFF_NONE macro for this new magic number.

FossilOrigin-Name: e8234f6939ccff4c10f741cf66d1c537cfebcbd0d1d79a618a64c755a7f087b5
This commit is contained in:
drh
2019-08-06 14:37:24 +00:00
parent 5978a7a525
commit 96fb16eecd
11 changed files with 50 additions and 44 deletions

View File

@@ -98,7 +98,7 @@ const char *sqlite3IndexAffinityStr(sqlite3 *db, Index *pIdx){
assert( pIdx->aColExpr!=0 );
aff = sqlite3ExprAffinity(pIdx->aColExpr->a[n].pExpr);
}
if( aff==0 ) aff = SQLITE_AFF_BLOB;
if( aff<SQLITE_AFF_BLOB ) aff = SQLITE_AFF_BLOB;
pIdx->zColAff[n] = aff;
}
pIdx->zColAff[n] = 0;
@@ -139,11 +139,12 @@ void sqlite3TableAffinity(Vdbe *v, Table *pTab, int iReg){
}
for(i=0; i<pTab->nCol; i++){
assert( pTab->aCol[i].affinity!=0 );
zColAff[i] = pTab->aCol[i].affinity;
}
do{
zColAff[i--] = 0;
}while( i>=0 && zColAff[i]==SQLITE_AFF_BLOB );
}while( i>=0 && zColAff[i]<=SQLITE_AFF_BLOB );
pTab->zColAff = zColAff;
}
assert( zColAff!=0 );