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
diff --git a/src/expr.c b/src/expr.c
index 92ae657..4893d4a 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 @@
       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;