Update of /cvsroot/monetdb/pathfinder/compiler/algebra/opt
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv5089/compiler/algebra/opt
Modified Files:
Tag: M5XQ
opt_const.c
Log Message:
propagated changes of Wednesday May 20 2009
from the development trunk to the M5XQ branch
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2009/05/20 - sjoerd: compiler/algebra/opt/opt_const.c,1.47
propagated changes of Wednesday May 20 2009
from the May2009 branch to the development trunk
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2009/05/20 - tsheyar: compiler/algebra/opt/opt_const.c,1.46.2.1
-- Make the error message for missing documents more informative:
Include the document name in the error message.
-- Adjust new error messages in the testweb.
-- Adjust stable output (for tests with a modified inter-document order).
-- Fix/Extend a cross product rewrite (for unreferenced inputs).
-- Simplify the 'missing document' error message in the algebra
for constant document names (which is the default).
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
U opt_const.c
Index: opt_const.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/opt/opt_const.c,v
retrieving revision 1.45.2.1
retrieving revision 1.45.2.2
diff -u -d -r1.45.2.1 -r1.45.2.2
--- opt_const.c 7 May 2009 14:43:03 -0000 1.45.2.1
+++ opt_const.c 20 May 2009 16:28:29 -0000 1.45.2.2
@@ -723,6 +723,30 @@
PFalg_lit_bln (false));
break;
}
+ /* concatenate two constant strings */
+ if (p->sem.fun_1to1.kind == alg_fun_fn_concat &&
+ PFprop_const (p->prop, clat (p->sem.fun_1to1.refs, 0)) &&
+ PFprop_const (p->prop, clat (p->sem.fun_1to1.refs, 1))) {
+ char *str0 = PFprop_const_val (
+ p->prop,
+ clat (p->sem.fun_1to1.refs, 0)).val.str,
+ *str1 = PFprop_const_val (
+ p->prop,
+ clat (p->sem.fun_1to1.refs, 1)).val.str,
+ *s;
+ unsigned int count = strlen (str0) + strlen (str1) + 1;
+
+ /* try to avoid constructing two long strings */
+ if (count < 2048) {
+ s = (char *) PFmalloc (count);
+
+ strcat (strcpy (s, str0), str1);
+
+ *p = *PFla_attach (L(p), p->sem.fun_1to1.res,
+ PFalg_lit_str (s));
+ break;
+ }
+ }
break;
case la_num_eq:
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables
unlimited royalty-free distribution of the report engine
for externally facing server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins