Update of /cvsroot/monetdb/pathfinder/compiler/algebra
In directory sc8-pr-cvs16:/tmp/cvs-serv31589/algebra
Modified Files:
builtins.c
Log Message:
-- Fix fn:string: Call specialized variants as long as the most general one
doesn't work.
Index: builtins.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/builtins.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- builtins.c 16 Mar 2007 17:29:33 -0000 1.49
+++ builtins.c 8 May 2007 12:44:40 -0000 1.50
@@ -335,15 +335,18 @@
* The fn:string function casts all values to string
* It uses fn:data() for atomizing nodes.
*/
-struct PFla_pair_t
-PFbui_fn_string (const PFla_op_t *loop, bool ordering,
- struct PFla_pair_t *args)
+static struct PFla_pair_t
+fn_string (struct PFla_pair_t (*data)
+ (const PFla_op_t *, bool, struct PFla_pair_t *),
+ const PFla_op_t *loop,
+ bool ordering,
+ struct PFla_pair_t *args)
{
/* as long as fn:data uses #pf:string-value()
we can use it safely to convert the nodes */
PFla_op_t *strings = project (
cast (
- PFbui_fn_data (
+ data (
loop,
ordering,
args).rel,
@@ -370,6 +373,83 @@
return (struct PFla_pair_t) { .rel = res, .frag = PFla_empty_set () };
}
+/**
+ * Build up operator tree for built-in function 'fn:string'.
+ */
+struct PFla_pair_t
+PFbui_fn_string_attr (const PFla_op_t *loop,
+ bool ordering,
+ struct PFla_pair_t *args)
+{
+ return fn_string (PFbui_fn_data_attr, loop, ordering, args);
+}
+
+/**
+ * Build up operator tree for built-in function 'fn:string'.
+ */
+struct PFla_pair_t
+PFbui_fn_string_text (const PFla_op_t *loop,
+ bool ordering,
+ struct PFla_pair_t *args)
+{
+ return fn_string (PFbui_fn_data_text, loop, ordering, args);
+}
+
+/**
+ * Build up operator tree for built-in function 'fn:string'.
+ */
+struct PFla_pair_t
+PFbui_fn_string_pi (const PFla_op_t *loop,
+ bool ordering,
+ struct PFla_pair_t *args)
+{
+ return fn_string (PFbui_fn_data_pi, loop, ordering, args);
+}
+
+/**
+ * Build up operator tree for built-in function 'fn:string'.
+ */
+struct PFla_pair_t
+PFbui_fn_string_comm (const PFla_op_t *loop,
+ bool ordering,
+ struct PFla_pair_t *args)
+{
+ return fn_string (PFbui_fn_data_comm, loop, ordering, args);
+}
+
+/**
+ * Build up operator tree for built-in function 'fn:string'.
+ */
+struct PFla_pair_t
+PFbui_fn_string_elem (const PFla_op_t *loop,
+ bool ordering,
+ struct PFla_pair_t *args)
+{
+ return fn_string (PFbui_fn_data_elem, loop, ordering, args);
+}
+
+/**
+ * Build up operator tree for built-in function 'fn:string'.
+ */
+struct PFla_pair_t
+PFbui_fn_string_elem_attr (const PFla_op_t *loop,
+ bool ordering,
+ struct PFla_pair_t *args)
+{
+ return fn_string (PFbui_fn_data_elem_attr, loop, ordering, args);
+}
+
+/**
+ * Build up operator tree for built-in function 'fn:string'.
+ */
+struct PFla_pair_t
+PFbui_fn_string (const PFla_op_t *loop,
+ bool ordering,
+ struct PFla_pair_t *args)
+{
+ return fn_string (PFbui_fn_data, loop, ordering, args);
+}
+
/* ------------ */
/* 2.4. fn:data */
/* ------------ */
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins