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

Modified Files:
        lalg2sql.brg 
Log Message:
-- Implemented sql-code-generation for algebra trees of the form 
serialize_rel(empty_tbl).

Index: lalg2sql.brg
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/sql/lalg2sql.brg,v
retrieving revision 1.103
retrieving revision 1.104
diff -u -d -r1.103 -r1.104
--- lalg2sql.brg        14 Jan 2008 15:32:59 -0000      1.103
+++ lalg2sql.brg        14 Jan 2008 23:26:55 -0000      1.104
@@ -195,6 +195,7 @@
             roots_ (twig (Twig)))                    =   5 (10);
 Query:  serialize_seq (Frag, empty_tbl)              =   6 (10);
 Query:  serialize_rel (Rel)                          =   7 (10);
+Query:  serialize_rel (empty_tbl)                    =   8 (10);
 Rel:    lit_tbl                                      =   9 (10);
 Rel:    ref_tbl                                      =  10 (10);
 Rel:    attach (Rel)                                 =  11 (10);
@@ -2258,6 +2259,40 @@
         }
         break;
 
+        /* Query:  serialize_rel(empty_tbl) */
+        case 8:
+        {
+            /*
+            Let's generate a pseudo-query whose result is an empty table:
+            
+            SELECT -1 AS iter, -1 AS pos
+            FROM sysibm.sysdummy1 AS a0000
+            WHERE 1 = 0;
+            */
+
+
+            /* call a helper function that does the 'real' job */
+            PFsql_t* final_query = PFsql_select (
+                false,
+                select_list (
+                    column_assign (lit_int (-1), ITER_),
+                    column_assign (lit_int (-1), POS_)),
+                from_list(
+                    alias_bind (
+                        schema_table_name (
+                            "sysibm",
+                            table_name (PF_SQL_TABLE_SYSDUMMY1)),
+                        alias (new_alias ()))),
+                where_list (
+                    eq (lit_int (1), lit_int (0))),
+                NULL,
+                NULL);
+              
+
+            sql_stmts = root (nil (), final_query);
+        }
+        break;
+
         /* Rel:    lit_tbl */
         case 9:
             if (p->sem.lit_tbl.count == 1) {


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to