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

Modified Files:
        builtins.c 
Log Message:
Implementation of the fn:error(string?, string) built-in function.


Index: builtins.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/builtins.c,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -d -r1.68 -r1.69
--- builtins.c  19 Dec 2007 22:39:04 -0000      1.68
+++ builtins.c  27 Dec 2007 13:07:13 -0000      1.69
@@ -629,6 +629,20 @@
 /* --------------------- */
 
 /**
+ * Build up operator tree for built-in function 'fn:error()'.
+ */
+struct PFla_pair_t
+PFbui_fn_error_empty (const PFla_op_t *loop, bool ordering,
+                      struct PFla_pair_t *args)
+{
+    (void) loop; (void) ordering; (void) args;
+
+    return (struct PFla_pair_t) {
+        .rel  = NULL,
+        .frag = PFla_empty_set ()};
+}
+
+/**
  * Build up operator tree for built-in function 'fn:error(string)'.
  */
 struct PFla_pair_t
@@ -648,10 +662,36 @@
 PFbui_fn_error_str (const PFla_op_t *loop, bool ordering,
                     struct PFla_pair_t *args)
 {
-    (void) loop; (void) ordering; (void) args;
+    (void) loop; (void) ordering;
 
     return (struct PFla_pair_t) {
-        .rel = NULL,
+        .rel = error( 
+                   project (
+                       fun_1to1 (
+                           eqjoin (
+                               disjunion (
+                                   args[0].rel,
+                                   attach (
+                                       attach (
+                                           difference (
+                                               loop,
+                                               project (
+                                                   args[0].rel,
+                                                   proj (att_iter, att_iter))),
+                                           att_pos, lit_nat (1)),
+                                       att_item, lit_str (""))),
+                                   project (args[1].rel,
+                                            proj (att_iter1, att_iter),
+                                            proj (att_item1, att_item)),
+                                   att_iter,
+                                   att_iter1),
+                           alg_fun_fn_concat,
+                           att_res,
+                           attlist(att_item, att_item1)),
+                       proj (att_iter, att_iter),
+                       proj (att_pos, att_pos),
+                       proj (att_item, att_res)),
+                   att_item),
         .frag = PFla_empty_set ()};
 }
 


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to