Update of /cvsroot/monetdb/pathfinder/compiler/debug
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv10597

Modified Files:
        prettysql.c 
Log Message:
-- print guide_step as SQL



Index: prettysql.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/debug/prettysql.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- prettysql.c 18 Jul 2007 09:27:02 -0000      1.12
+++ prettysql.c 25 Jul 2007 12:32:23 -0000      1.13
@@ -98,6 +98,8 @@
 static void print_statement(PFsql_t*);
 static void print_expr (PFsql_t*);
 static void print_fullselect(FILE*,PFsql_t*,int);
+static void print_lit_list (PFsql_t * n);
+
 
 static void 
 print_schema_relcol (FILE *f, PFsql_t *n)
@@ -308,17 +310,24 @@
             PFprettyprintf (")");
             break;
 
-       case sql_like:
-           PFprettyprintf ("(");
-           print_statement (L(n));
-           PFprettyprintf (" LIKE  '%%");
-           /* write the string without beginning and 
-              trailing ' */
-           assert (R(n)->kind == sql_lit_str);
-           PFprettyprintf ("%s", R(n)->sem.atom.val.s); 
-           PFprettyprintf ("%%')");
-            break;
-
+       case sql_like:
+               PFprettyprintf ("(");
+           print_statement (L(n));
+           PFprettyprintf (" LIKE  '%%");
+           /* write the string without beginning and 
+              trailing ' */
+           assert (R(n)->kind == sql_lit_str);
+           PFprettyprintf ("%s", R(n)->sem.atom.val.s); 
+           PFprettyprintf ("%%')");
+                break;
+    
+        case sql_in:
+            PFprettyprintf (" (");
+            print_statement (n->child[0]);
+            PFprettyprintf (" IN (");
+            print_lit_list(n->child[1]);
+            PFprettyprintf (")) ");
+            break; 
         default:
             PFoops( OOPS_FATAL, "expression screwed up (%u)",
                     n->kind );
@@ -878,6 +887,22 @@
     }
 }
 
+static void
+print_lit_list (PFsql_t * n)
+{
+    assert (n);
+
+    switch (n->kind) {
+        case sql_lit_list:
+            print_lit_list (n->child[0]);
+            PFprettyprintf (", ");
+            print_lit_list (n->child[1]);
+            break;
+        default:
+            print_statement (n);
+    }
+}
+
 /**
  * Dump SQL tree @a n in pretty-printed form
  * into file @a f.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to