Update of /cvsroot/monetdb/pathfinder/compiler/sql
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv24609/compiler/sql

Modified Files:
        sqlprint.c 
Log Message:
cast added to expression list

Index: sqlprint.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/sql/sqlprint.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- sqlprint.c  4 Feb 2007 12:15:08 -0000       1.13
+++ sqlprint.c  9 Feb 2007 08:01:24 -0000       1.14
@@ -504,6 +504,13 @@
         {
             sqlprintf("'%s'", n->sem.atom.val.s);
         } break;
+        case sql_cst:
+            sqlprintf("CAST(");
+            print_statement(n->child[0]);
+            sqlprintf(" AS ");
+            print_statement(n->child[1]);
+            sqlprintf(")");
+        break;
         default:
         {
             PFoops( OOPS_FATAL, "expression screwed up (%u)",
@@ -877,22 +884,28 @@
     }
 }
 
-#if 0
-        gcc: defined but never used
-
 static void
 print_expression(PFsql_t *n)
 {
     assert( n );
     switch( n->kind ) {
-        /* expression : Variable */
-        case sql_crrltn_name:
+        case sql_expr_list:
         {
-            print_loc_variable( n );
+            print_expression(n->child[0]);
+            sqlprintf(", ");
+            print_expression(n->child[1]);
         } break;
         case sql_tbl_name:
         {
-            print_variable( n );
+            print_variable (n);
+        } break;
+        case sql_sum:
+        {
+            sqlprintf("(");
+            print_statement(n->child[0]);
+            sqlprintf(" %s ", ID[n->kind]);
+            print_statement(n->child[1]);
+            sqlprintf(")");
         } break;
         default:
         {
@@ -906,7 +919,6 @@
         } break;
     }
 }
-#endif
 
 static void
 print_variable( PFsql_t *n )


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to