Changeset: 3a88c9dc6513 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3a88c9dc6513
Modified Files:
pathfinder/runtime/shredder.mx
Branch: default
Log Message:
Merge git master into default
diffs (truncated from 3377 to 300 lines):
diff -r 65818a7ebbb2 -r 3a88c9dc6513 pathfinder/compiler/algebra/algebra.c
--- a/pathfinder/compiler/algebra/algebra.c Wed Oct 06 09:33:49 2010 +0200
+++ b/pathfinder/compiler/algebra/algebra.c Wed Oct 06 10:04:46 2010 +0200
@@ -1189,7 +1189,7 @@
case alg_fun_pf_log: return "pf:log";
case alg_fun_fn_concat: return "fn:concat";
case alg_fun_fn_substring: return "fn:substring";
- case alg_fun_fn_substring_dbl: return "fn:substring3";
+ case alg_fun_fn_substring_len: return "fn:substring_len";
case alg_fun_fn_string_length: return "fn:string-length";
case alg_fun_fn_normalize_space: return "fn:normalize-space";
case alg_fun_fn_upper_case: return "fn:upper-case";
diff -r 65818a7ebbb2 -r 3a88c9dc6513 pathfinder/compiler/algebra/builtins.c
--- a/pathfinder/compiler/algebra/builtins.c Wed Oct 06 09:33:49 2010 +0200
+++ b/pathfinder/compiler/algebra/builtins.c Wed Oct 06 10:04:46 2010 +0200
@@ -1944,12 +1944,21 @@
proj (col_iter, col_iter))),
col_pos, lit_nat (1)),
col_item, lit_str (""))),
- project (cast (args[1].rel,
- col_cast,
- col_item,
- aat_dbl),
- proj (col_iter1, col_iter),
- proj (col_item1, col_cast)),
+ project (
+ cast (
+ fun_1to1 (
+ cast (args[1].rel,
+ col_cast,
+ col_item,
+ aat_dbl),
+ alg_fun_fn_round,
+ col_res,
+ collist (col_cast)),
+ col_item1,
+ col_res,
+ aat_int),
+ proj (col_iter1, col_iter),
+ proj (col_item1, col_item1)),
col_iter,
col_iter1),
alg_fun_fn_substring,
@@ -1967,7 +1976,7 @@
* <code>fn:substring(xs:string?, xs:double, xs:double)</code>
*/
struct PFla_pair_t
-PFbui_fn_substring_dbl (const PFla_op_t *loop,
+PFbui_fn_substring_len (const PFla_op_t *loop,
bool ordering,
PFla_op_t **side_effects,
struct PFla_pair_t *args)
@@ -1990,23 +1999,41 @@
proj (col_iter, col_iter))),
col_pos, lit_nat (1)),
col_item, lit_str (""))),
- project (cast (args[1].rel,
- col_cast,
- col_item,
- aat_dbl),
- proj (col_iter1, col_iter),
- proj (col_item1, col_cast)),
+ project (
+ cast (
+ fun_1to1 (
+ cast (args[1].rel,
+ col_cast,
+ col_item,
+ aat_dbl),
+ alg_fun_fn_round,
+ col_res,
+ collist (col_cast)),
+ col_item1,
+ col_res,
+ aat_int),
+ proj (col_iter1, col_iter),
+ proj (col_item1, col_item1)),
col_iter,
col_iter1),
- project (cast (args[2].rel,
- col_cast,
- col_item,
- aat_dbl),
- proj (col_iter2, col_iter),
- proj (col_item2, col_cast)),
+ project (
+ cast (
+ fun_1to1 (
+ cast (args[2].rel,
+ col_cast,
+ col_item,
+ aat_dbl),
+ alg_fun_fn_round,
+ col_res,
+ collist (col_cast)),
+ col_item1,
+ col_res,
+ aat_int),
+ proj (col_iter2, col_iter),
+ proj (col_item2, col_item1)),
col_iter,
col_iter2),
- alg_fun_fn_substring_dbl,
+ alg_fun_fn_substring_len,
col_res,
collist (col_item, col_item1, col_item2)),
proj (col_iter, col_iter),
diff -r 65818a7ebbb2 -r 3a88c9dc6513 pathfinder/compiler/algebra/logical.c
--- a/pathfinder/compiler/algebra/logical.c Wed Oct 06 09:33:49 2010 +0200
+++ b/pathfinder/compiler/algebra/logical.c Wed Oct 06 10:04:46 2010 +0200
@@ -1428,18 +1428,18 @@
assert (clsize (refs) == 2);
/* make sure both columns are of type str & dbl */
assert (n->schema.items[ix[0]].type == aat_str);
- assert (n->schema.items[ix[1]].type == aat_dbl);
+ assert (n->schema.items[ix[1]].type == aat_int);
res_type = aat_str;
break;
- case alg_fun_fn_substring_dbl:
+ case alg_fun_fn_substring_len:
assert (clsize (refs) == 3);
/* make sure columns are of type str & dbl */
assert (n->schema.items[ix[0]].type == aat_str);
- assert (n->schema.items[ix[1]].type == aat_dbl &&
- n->schema.items[ix[2]].type == aat_dbl );
+ assert (n->schema.items[ix[1]].type == aat_int &&
+ n->schema.items[ix[2]].type == aat_int );
res_type = aat_str;
break;
diff -r 65818a7ebbb2 -r 3a88c9dc6513 pathfinder/compiler/algebra/physical.c
--- a/pathfinder/compiler/algebra/physical.c Wed Oct 06 09:33:49 2010 +0200
+++ b/pathfinder/compiler/algebra/physical.c Wed Oct 06 10:04:46 2010 +0200
@@ -1635,17 +1635,17 @@
/* make sure both columns are of type str & dbl */
assert (n->schema.items[ix[0]].type == aat_str);
- assert (n->schema.items[ix[1]].type == aat_dbl);
+ assert (n->schema.items[ix[1]].type == aat_int);
res_type = aat_str;
break;
- case alg_fun_fn_substring_dbl:
+ case alg_fun_fn_substring_len:
assert (clsize (refs) == 3);
/* make sure columns are of type str & dbl */
assert (n->schema.items[ix[0]].type == aat_str);
- assert (n->schema.items[ix[1]].type == aat_dbl &&
- n->schema.items[ix[2]].type == aat_dbl);
+ assert (n->schema.items[ix[1]].type == aat_int &&
+ n->schema.items[ix[2]].type == aat_int);
res_type = aat_str;
break;
diff -r 65818a7ebbb2 -r 3a88c9dc6513
pathfinder/compiler/algebra/prop/prop_composite_key.c
--- a/pathfinder/compiler/algebra/prop/prop_composite_key.c Wed Oct 06
09:33:49 2010 +0200
+++ b/pathfinder/compiler/algebra/prop/prop_composite_key.c Wed Oct 06
10:04:46 2010 +0200
@@ -319,19 +319,31 @@
unsigned int i, j;
/* combine all keys of the left argument
with all keys of the right argument */
- for (i = 0; i < llsize (LCKEYS); i++)
+ for (i = 0; i < llsize (LCKEYS); i++) {
for (j = 0; j < llsize (RCKEYS); j++) {
union_ (CKEYS,
clconcat (llat (LCKEYS, i),
llat (RCKEYS, j)));
}
+ for (j = 0; j < clsize (R(n)->prop->keys); j++) {
+ union_ (CKEYS,
+ clconcat (llat (LCKEYS, i),
+ collist (clat (R(n)->prop->keys, j))));
+ }
+ }
- for (i = 0; i < clsize (L(n)->prop->keys); i++)
+ for (i = 0; i < clsize (L(n)->prop->keys); i++) {
+ for (j = 0; j < llsize (RCKEYS); j++) {
+ union_ (CKEYS,
+ clconcat (collist (clat (L(n)->prop->keys, i)),
+ llat (RCKEYS, j)));
+ }
for (j = 0; j < clsize (R(n)->prop->keys); j++) {
union_ (CKEYS,
collist (clat (L(n)->prop->keys, i),
clat (R(n)->prop->keys, j)));
}
+ }
} break;
case la_eqjoin:
diff -r 65818a7ebbb2 -r 3a88c9dc6513
pathfinder/compiler/algebra/prop/prop_ocol.c
--- a/pathfinder/compiler/algebra/prop/prop_ocol.c Wed Oct 06 09:33:49
2010 +0200
+++ b/pathfinder/compiler/algebra/prop/prop_ocol.c Wed Oct 06 10:04:46
2010 +0200
@@ -346,17 +346,17 @@
/* make sure both columns are of type str & dbl */
assert (ocol_at (L(n), ix[0]).type == aat_str);
- assert (ocol_at (L(n), ix[1]).type == aat_dbl);
+ assert (ocol_at (L(n), ix[1]).type == aat_int);
res_type = aat_str;
break;
- case alg_fun_fn_substring_dbl:
+ case alg_fun_fn_substring_len:
assert (clsize (n->sem.fun_1to1.refs) == 3);
/* make sure both columns are of type str & dbl */
assert (ocol_at (L(n), ix[0]).type == aat_str);
- assert (ocol_at (L(n), ix[1]).type == aat_dbl &&
- ocol_at (L(n), ix[2]).type == aat_dbl);
+ assert (ocol_at (L(n), ix[1]).type == aat_int &&
+ ocol_at (L(n), ix[2]).type == aat_int);
res_type = aat_str;
break;
diff -r 65818a7ebbb2 -r 3a88c9dc6513 pathfinder/compiler/include/algebra.h
--- a/pathfinder/compiler/include/algebra.h Wed Oct 06 09:33:49 2010 +0200
+++ b/pathfinder/compiler/include/algebra.h Wed Oct 06 10:04:46 2010 +0200
@@ -384,7 +384,7 @@
, alg_fun_pf_sqrt /**< pf:sqrt */
, alg_fun_fn_concat /**< fn:concat */
, alg_fun_fn_substring /**< fn:substring */
- , alg_fun_fn_substring_dbl /**< fn:substring with length specified*/
+ , alg_fun_fn_substring_len /**< fn:substring with length specified */
, alg_fun_fn_string_length /**< fn:string-length */
, alg_fun_fn_normalize_space /**< fn:normalize-space */
, alg_fun_fn_upper_case /**< fn:upper-case */
diff -r 65818a7ebbb2 -r 3a88c9dc6513 pathfinder/compiler/include/builtins.h
--- a/pathfinder/compiler/include/builtins.h Wed Oct 06 09:33:49 2010 +0200
+++ b/pathfinder/compiler/include/builtins.h Wed Oct 06 10:04:46 2010 +0200
@@ -406,7 +406,7 @@
bool ordering,
PFla_op_t **side_effects,
struct PFla_pair_t *args);
-struct PFla_pair_t PFbui_fn_substring_dbl (const PFla_op_t *loop,
+struct PFla_pair_t PFbui_fn_substring_len (const PFla_op_t *loop,
bool ordering,
PFla_op_t **side_effects,
struct PFla_pair_t *args);
diff -r 65818a7ebbb2 -r 3a88c9dc6513 pathfinder/compiler/include/sql.h
--- a/pathfinder/compiler/include/sql.h Wed Oct 06 09:33:49 2010 +0200
+++ b/pathfinder/compiler/include/sql.h Wed Oct 06 10:04:46 2010 +0200
@@ -103,7 +103,7 @@
*/
enum PFsql_kind_t {
sql_root /* The root of the SQL operator tree:
- it combines the schema information
+ it combines the schema information
with the query operators */
, sql_ser_info /* an item of a sequence of schema information
@@ -125,7 +125,7 @@
, sql_column_name /* SQL column name (a column reference) */
, sql_star /* a SQL wildcard '*' */
- , sql_with /* WITH operator
+ , sql_with /* WITH operator
(second child of the sql_root operator) */
, sql_cmmn_tbl_expr /* common table expression */
, sql_comment /* comment */
@@ -166,6 +166,8 @@
, sql_abs /* abs expression */
, sql_concat /* string concatenation */
+ , sql_substring /* substring search */
+ , sql_substring_length /* substring search with length */
, sql_is /* IS predicate */
, sql_is_not /* IS NOT predicate */
@@ -176,7 +178,7 @@
, sql_like /* like comparison */
, sql_similar_to /* similar to comparison */
, sql_in /* in comparison */
- , sql_stmt_list /* an item of a list of statments
+ , sql_stmt_list /* an item of a list of statments
(second argument of a sql_in operator) */
, sql_list_list /* list of lists */
, sql_not /* negation */
@@ -210,6 +212,10 @@
, sql_cast /* CAST expression */
, sql_type /* a SQL type */
+ , sql_year /* sql year function */
+ , sql_month /* sql month function */
+ , sql_day /* sql day function */
+
, sql_coalesce /* COALESCE () function */
, sql_case /* case operator */
@@ -241,11 +247,11 @@
struct {
char *str; /**< Comment. */
} comment;
-
+
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list