aboutsummaryrefslogtreecommitdiff
path: root/src/expr.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2002-06-26 02:45:03 +0000
committerdrh <drh@noemail.net>2002-06-26 02:45:03 +0000
commitb13632063d5cfa89a076f3c4ed3dda62008e9f67 (patch)
treefdef69a1e0657bfddfe51396072849c0baba15fd /src/expr.c
parent411995dc0d1611c8aa2a00c48d0c9cf756a34d98 (diff)
downloadsqlite-b13632063d5cfa89a076f3c4ed3dda62008e9f67.tar.gz
sqlite-b13632063d5cfa89a076f3c4ed3dda62008e9f67.zip
The datatype of the i-th column in the result set is given by the
azColName(argc+1+i) parameter to the callback. (CVS 647) FossilOrigin-Name: bdb006b809feb0f29342eb5138c0884d34e95599
Diffstat (limited to 'src/expr.c')
-rw-r--r--src/expr.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/expr.c b/src/expr.c
index 92ae65792..4893d4a86 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -12,7 +12,7 @@
** This file contains routines used for analyzing expressions and
** for generating VDBE code that evaluates expressions in SQLite.
**
-** $Id: expr.c,v 1.73 2002/06/20 11:36:49 drh Exp $
+** $Id: expr.c,v 1.74 2002/06/26 02:45:04 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -889,6 +889,22 @@ int sqliteExprType(Expr *p){
p = p->pSelect->pEList->a[0].pExpr;
break;
+ case TK_CASE: {
+ if( p->pRight && sqliteExprType(p->pRight)==SQLITE_SO_NUM ){
+ return SQLITE_SO_NUM;
+ }
+ if( p->pList ){
+ int i;
+ ExprList *pList = p->pList;
+ for(i=1; i<pList->nExpr; i+=2){
+ if( sqliteExprType(pList->a[i].pExpr)==SQLITE_SO_NUM ){
+ return SQLITE_SO_NUM;
+ }
+ }
+ }
+ return SQLITE_SO_TEXT;
+ }
+
default:
assert( p->op==TK_ABORT ); /* Can't Happen */
break;