Hello!

With the attached patch I am able to obtain declared column types from CAST() expressions.

The diff was made from v3.7.0 amalgamation code; original source file is select.c, near beginning of function columnType().

Best wishes,
alex.
--- sqlite3.c.orig      2010-07-31 12:17:29.906250000 +0300
+++ sqlite3.c   2010-07-31 14:35:45.281250000 +0300
@@ -86625,7 +86625,9 @@
   char const *zOriginTab = 0;
   char const *zOriginCol = 0;
   int j;
-  if( NEVER(pExpr==0) || pNC->pSrcList==0 ) return 0;
+  if( NEVER(pExpr==0) ) return 0;
+  if( pExpr->op==TK_CAST ) return pExpr->u.zToken;
+  if( pNC->pSrcList==0 ) return 0;
 
   switch( pExpr->op ){
     case TK_AGG_COLUMN:
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to