aboutsummaryrefslogtreecommitdiff
path: root/src/select.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2019-08-06 14:37:24 +0000
committerdrh <drh@noemail.net>2019-08-06 14:37:24 +0000
commit96fb16eecdf03c1042a19bb6aaf46eededb6c75f (patch)
tree7c5180007167a8a899e8e4e17c0e51d41ad47268 /src/select.c
parent5978a7a525c58e1402b87ba957d287f650e0f9ab (diff)
downloadsqlite-96fb16eecdf03c1042a19bb6aaf46eededb6c75f.tar.gz
sqlite-96fb16eecdf03c1042a19bb6aaf46eededb6c75f.zip
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
Diffstat (limited to 'src/select.c')
-rw-r--r--src/select.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/select.c b/src/select.c
index d3e4fd246..f59b50e93 100644
--- a/src/select.c
+++ b/src/select.c
@@ -2069,7 +2069,7 @@ void sqlite3SelectAddColumnTypeAndCollation(
pCol->colFlags |= COLFLAG_HASTYPE;
}
}
- if( pCol->affinity==0 ) pCol->affinity = aff;
+ if( pCol->affinity<=SQLITE_AFF_NONE ) pCol->affinity = aff;
pColl = sqlite3ExprCollSeq(pParse, p);
if( pColl && pCol->zColl==0 ){
pCol->zColl = sqlite3DbStrDup(db, pColl->zName);
@@ -5196,7 +5196,8 @@ static void selectAddSubqueryTypeInfo(Walker *pWalker, Select *p){
Select *pSel = pFrom->pSelect;
if( pSel ){
while( pSel->pPrior ) pSel = pSel->pPrior;
- sqlite3SelectAddColumnTypeAndCollation(pParse, pTab, pSel, 0);
+ sqlite3SelectAddColumnTypeAndCollation(pParse, pTab, pSel,
+ SQLITE_AFF_NONE);
}
}
}