diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/expr.c | 8 | ||||
-rw-r--r-- | src/select.c | 14 |
2 files changed, 15 insertions, 7 deletions
diff --git a/src/expr.c b/src/expr.c index 5608128ad..fe316550a 100644 --- a/src/expr.c +++ b/src/expr.c @@ -109,7 +109,8 @@ int sqlite3ExprDataType(const Expr *pExpr){ break; } case TK_NULL: { - return 0x00; + pExpr = 0; + break; } case TK_STRING: { return 0x02; @@ -145,6 +146,9 @@ int sqlite3ExprDataType(const Expr *pExpr){ for(ii=1; ii<pList->nExpr; ii+=2){ res |= sqlite3ExprDataType(pList->a[ii].pExpr); } + if( pList->nExpr % 2 ){ + res |= sqlite3ExprDataType(pList->a[pList->nExpr-1].pExpr); + } return res; } default: { @@ -152,7 +156,7 @@ int sqlite3ExprDataType(const Expr *pExpr){ } } /* End of switch(op) */ } /* End of while(pExpr) */ - return 0; + return 0x00; } /* diff --git a/src/select.c b/src/select.c index b4d57f489..336d1503a 100644 --- a/src/select.c +++ b/src/select.c @@ -2358,11 +2358,15 @@ void sqlite3SubqueryColumnTypes( pCol->affinity = SQLITE_AFF_BLOB; } } - zType = 0; - for(j=0; j<SQLITE_N_STDTYPE; j++){ - if( sqlite3StdTypeAffinity[j]==pCol->affinity ){ - zType = sqlite3StdType[j]; - break; + if( pCol->affinity==SQLITE_AFF_NUMERIC ){ + zType = "NUM"; + }else{ + zType = 0; + for(j=1; j<SQLITE_N_STDTYPE; j++){ + if( sqlite3StdTypeAffinity[j]==pCol->affinity ){ + zType = sqlite3StdType[j]; + break; + } } } if( zType ){ |