MonetDB: graph0 - New line at EOF
Changeset: 1fb7a995d519 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1fb7a995d519 Modified Files: monetdb5/modules/atoms/nested_table.mal sql/scripts/35_nested_table.sql Branch: graph0 Log Message: New line at EOF diffs (20 lines): diff --git a/monetdb5/modules/atoms/nested_table.mal b/monetdb5/modules/atoms/nested_table.mal --- a/monetdb5/modules/atoms/nested_table.mal +++ b/monetdb5/modules/atoms/nested_table.mal @@ -22,4 +22,4 @@ address NESTEDTABLEunnest101_oid comment "Extract the candidate list from a nested table" # Initialize -nestedtable.prelude(); \ No newline at end of file +nestedtable.prelude(); diff --git a/sql/scripts/35_nested_table.sql b/sql/scripts/35_nested_table.sql --- a/sql/scripts/35_nested_table.sql +++ b/sql/scripts/35_nested_table.sql @@ -5,4 +5,4 @@ -- Copyright 1997 - July 2008 CWI, August 2008 - 2017 MonetDB B.V. CREATE AGGREGATE nest (*) RETURNS nested_table EXTERNAL NAME "nestedtable"."nest1"; -GRANT EXECUTE ON AGGREGATE nest() TO public; \ No newline at end of file +GRANT EXECUTE ON AGGREGATE nest() TO public; ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: graph0 - Dummy commit #2
Changeset: e974578ee622 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e974578ee622 Branch: graph0 Log Message: Dummy commit #2 ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: graph0 - Dummy commit
Changeset: cdb4c28a281c for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=cdb4c28a281c Branch: graph0 Log Message: Dummy commit ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: graph0 - Merge branch 'branches/graph0' of hg::ssh://hg...
Changeset: 210f0bbcaa8c for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=210f0bbcaa8c Modified Files: monetdb5/mal/mal_interpreter.c Branch: graph0 Log Message: Merge branch 'branches/graph0' of hg::ssh://h...@dev.monetdb.org/MonetDB into graph/master diffs (16 lines): diff --git a/monetdb5/mal/mal_interpreter.c b/monetdb5/mal/mal_interpreter.c --- a/monetdb5/mal/mal_interpreter.c +++ b/monetdb5/mal/mal_interpreter.c @@ -486,6 +486,12 @@ str runMALsequence(Client cntxt, MalBlkP if (stk == NULL) throw(MAL, "mal.interpreter", MAL_STACK_FAIL); + do { // DEBUG ONLY + char * value = getenv("MALPLAN"); + if(value != NULL && strcmp(value, "1") == 0) + printf("[DEBUG] [Interpreter] MAL Plan: %s\n", mal2str(mb, 0, mb->stop)); + } while(0); + /* prepare extended backup and garbage structures */ if (startpc+1 == stoppc) { pci = getInstrPtr(mb, startpc); ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: graph0 - QRW: join ordering: selects might not operate ...
Changeset: ce8edff671af for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ce8edff671af Modified Files: sql/server/rel_optimizer.c Branch: graph0 Log Message: QRW: join ordering: selects might not operate on an input relation *.* diffs (17 lines): diff --git a/sql/server/rel_optimizer.c b/sql/server/rel_optimizer.c --- a/sql/server/rel_optimizer.c +++ b/sql/server/rel_optimizer.c @@ -1418,11 +1418,11 @@ rel_join_order(mvc *sql, sql_rel *rel) if(!rel_is_ref(rel)){ do { parent = parent->l; - } while ((parent->op == op_select || parent->op == op_graph_select) && !rel_is_ref(parent)); + } while (parent && (parent->op == op_select || parent->op == op_graph_select) && !rel_is_ref(parent)); } // do not consider the outer joins here - if((parent->op == op_join || parent->op == op_graph_join) && !rel_is_ref(parent)) { + if(parent && (parent->op == op_join || parent->op == op_graph_join) && !rel_is_ref(parent)) { do_join_reordering = true; } else { rel->l = rel_join_order(sql, rel->l); ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: graph0 - Backport hg://63221:235ab012ead8
Changeset: 4ac696b61828 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4ac696b61828 Modified Files: sql/server/rel_select.c Branch: graph0 Log Message: Backport hg://63221:235ab012ead8 fixed bug 6246, ie handle alias in with subquery diffs (20 lines): diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c --- a/sql/server/rel_select.c +++ b/sql/server/rel_select.c @@ -310,7 +310,15 @@ query_exp_optname(mvc *sql, sql_rel *r, { switch (q->token) { case SQL_WITH: - return rel_with_query(sql, q); + { + sql_rel *tq = rel_with_query(sql, q); + + if (!tq) + return NULL; + if (q->data.lval->t->type == type_symbol) + return rel_table_optname(sql, tq, q->data.lval->t->data.sym); + return tq; + } case SQL_UNION: case SQL_EXCEPT: case SQL_INTERSECT: ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: graph0 - Fix the compiler errors when building with --d...
Changeset: adab7a31d802 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=adab7a31d802 Modified Files: sql/backends/monet5/sql_statement.c sql/server/rel_optimizer.c Branch: graph0 Log Message: Fix the compiler errors when building with --disable-assert diffs (29 lines): diff --git a/sql/backends/monet5/sql_statement.c b/sql/backends/monet5/sql_statement.c --- a/sql/backends/monet5/sql_statement.c +++ b/sql/backends/monet5/sql_statement.c @@ -3671,13 +3671,10 @@ stmt* stmt_gr8_intersect_join_lists(backend *be, stmt* query){ InstrPtr q = NULL; list* l = NULL; - int num_operands = -1; // expected 4 - // generate the MAL instruction assert(query->type == st_list && "Invalid input type"); - num_operands = list_length(query->op4.lval); - assert(num_operands == 4); // candidate list left and right + projection list left and right + assert(list_length(query->op4.lval) == 4); // candidate list left and right + projection list left and right q = newStmt(be->mb, "graph", "intersect_join_lists"); if(!q) return NULL; diff --git a/sql/server/rel_optimizer.c b/sql/server/rel_optimizer.c --- a/sql/server/rel_optimizer.c +++ b/sql/server/rel_optimizer.c @@ -6410,6 +6410,7 @@ rel_mark_used(mvc *sql, sql_rel *rel, in if(me->used){ int mark = exp_mark_used(graph_ptr->edges, me); assert(mark > 0 && "All arguments should be marked in the subrel"); + (void) mark; // silent the warning when NDEBUG is defined shortest_path_used = true; } } ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: graph0 - SEMA: accept atoms as vertices
Changeset: 7d1515b0afe0 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7d1515b0afe0 Modified Files: sql/backends/monet5/rel_bin.c sql/server/rel_distribute.c sql/server/rel_dump.c sql/server/rel_graph.c sql/server/rel_optimizer.c Branch: graph0 Log Message: SEMA: accept atoms as vertices diffs (185 lines): diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c --- a/sql/backends/monet5/rel_bin.c +++ b/sql/backends/monet5/rel_bin.c @@ -4820,9 +4820,12 @@ rel2bin_graph(backend *be, sql_rel* rel, // printf("[rel2bin_graph] input: %s\n", dump_rel(sql, rel)); // DEBUG ONLY // first construct the depending relations - left = subrel_bin(be, rel->l, refs); - if(!left) return NULL; // error + if(rel->l != NULL) { + left = subrel_bin(be, rel->l, refs); + if(!left) return NULL; // error + } if(rel->op == op_graph_join) { + assert(rel->l != NULL && rel->r != NULL && "Missing the table expressions to join"); right = subrel_bin(be, rel->r, refs); if(!right) return NULL; // error } @@ -4876,12 +4879,14 @@ rel2bin_graph(backend *be, sql_rel* rel, // right might be null, that's ok stmt* s = exp_bin(be, n->data, left, right, NULL, NULL, NULL, NULL); if(!s) return NULL; // error + s = column(be, s); // scalar -> column [ scalar ] list_append(lhs, s); } // repeat for the rhs for(node *n = ((list*)graph_exp->r)->h; n; n = n->next){ stmt* s = exp_bin(be, n->data, left, right, NULL, NULL, NULL, NULL); if(!s) return NULL; // error + s = column(be, s); // scalar -> column [ scalar ] list_append(rhs, s); } @@ -4954,14 +4959,16 @@ rel2bin_graph(backend *be, sql_rel* rel, int op_out_index = 2; // start with the lhs - jl = stmt_result(be, spfw, 0); - for(node* n = left->op4.lval->h; n; n = n->next ) { - stmt *c = n->data; - const char *rnme = table_name(sql->sa, c); - const char *nme = column_name(sql->sa, c); - stmt *s = stmt_project(be, jl, column(be, c)); - s = stmt_alias(be, s, rnme, nme); - list_append(lst1, s); + if(left != NULL) { + jl = stmt_result(be, spfw, 0); + for(node* n = left->op4.lval->h; n; n = n->next ) { + stmt *c = n->data; + const char *rnme = table_name(sql->sa, c); + const char *nme = column_name(sql->sa, c); + stmt *s = stmt_project(be, jl, column(be, c)); + s = stmt_alias(be, s, rnme, nme); + list_append(lst1, s); + } } // repeat with the rhs diff --git a/sql/server/rel_distribute.c b/sql/server/rel_distribute.c --- a/sql/server/rel_distribute.c +++ b/sql/server/rel_distribute.c @@ -297,7 +297,7 @@ distribute(mvc *sql, sql_rel *rel) r = rel->r = distribute(sql, rel->r); g = graph_ptr->edges = distribute(sql, graph_ptr->edges); - pl = find_prop(l->p, PROP_REMOTE); + pl = rel->l != NULL ? find_prop(l->p, PROP_REMOTE) : NULL; if(rel->op == op_graph_join) pr = find_prop(r->p, PROP_REMOTE); else diff --git a/sql/server/rel_dump.c b/sql/server/rel_dump.c --- a/sql/server/rel_dump.c +++ b/sql/server/rel_dump.c @@ -543,12 +543,14 @@ rel_print_(mvc *sql, stream *fout, sql_ sql_graph *graph_ptr = (sql_graph*) rel; print_indent(sql, fout, depth, decorate); mnstr_printf(fout, "%s (", op2string(rel->op)); - if (rel_is_ref(rel->l)) { - int nr = find_ref(refs, rel->l); - print_indent(sql, fout, depth+1, decorate); - mnstr_printf(fout, "& REF %d ", nr); - } else - rel_print_(sql, fout, rel->l, depth+1, refs, decorate); + if(rel->l){ // address the case SELECT 1 WHERE x REACHES y ... + if (rel_is_ref(rel->l)) { + int nr = find_ref(refs, rel->l); + print_indent(sql, fout, depth+1, decorate); + mnstr_printf(fout, "& REF %d ", nr); + } else + rel_print_(sql, fout, rel->l, depth+1, refs, decorate); +
MonetDB: graph0 - CODEGEN: generate the instructions to retrieve...
Changeset: 20183131a788 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=20183131a788 Modified Files: sql/backends/monet5/rel_bin.c sql/backends/monet5/sql_statement.c sql/backends/monet5/sql_statement.h sql/server/rel_graph.c sql/server/rel_optimizer.c Branch: graph0 Log Message: CODEGEN: generate the instructions to retrieve a shortest path diffs (truncated from 411 to 300 lines): diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c --- a/sql/backends/monet5/rel_bin.c +++ b/sql/backends/monet5/rel_bin.c @@ -4809,7 +4809,7 @@ rel2bin_graph(backend *be, sql_rel* rel, list *lst1 = NULL; // temporary list int spfw_flags = 0; // spfw flags stmt *query = NULL; // query parameters - stmt *weights = NULL; // input columns to generate the weights + stmt *shortest_paths = NULL; // input columns to generate the weights & the list of attributes for the paths stmt *spfw = NULL; // shortest path operator // avoid to deal with the virtual OIDs (VOID) type, they are just an @@ -4817,8 +4817,7 @@ rel2bin_graph(backend *be, sql_rel* rel, // for more extreme cases #define void2oid(statement) stmt_gr8_void2oid(be, statement) - // debugging - printf("[rel2bin_graph] input: %s\n", dump_rel(sql, rel)); +// printf("[rel2bin_graph] input: %s\n", dump_rel(sql, rel)); // DEBUG ONLY // first construct the depending relations left = subrel_bin(be, rel->l, refs); @@ -4908,30 +4907,51 @@ rel2bin_graph(backend *be, sql_rel* rel, } } while(0); - // weights + // weights & paths lst1 = sa_list(sql->sa); - for(node *n = graph_ptr->spfw->h; n; n = n->next){ + for(node* n = graph_ptr->spfw->h; n; n = n->next){ sql_exp* e = n->data; - stmt *s = NULL; - - if(!exp_is_atom(e)){ // no need to generate a weight for a bfs - s = exp_bin(be, e, edges, NULL, NULL, NULL, NULL, NULL); - assert(s != NULL && "Weight expression is NULL"); - if(!s) return NULL; + stmt* s = NULL; + if(e->flag & GRAPH_EXPR_COST){ + if(!exp_is_atom(e)){ // no need to generate a weight for a bfs + s = exp_bin(be, e, edges, NULL, NULL, NULL, NULL, NULL); + assert(s != NULL && "Weight expression is NULL"); + if(!s) return NULL; + } else { + s = stmt_none(be); + } + s->flag |= GRAPH_EXPR_COST; + } else if (e->flag & GRAPH_EXPR_SHORTEST_PATH){ + list* arguments = e->l; + list* attributes = sa_list(sql->sa); + + assert(e->type == e_aggr && "Expecting SYS.NEST"); + for(node* m = arguments->h; m; m = m->next){ + sql_exp* me = m->data; + stmt* ms = exp_bin(be, me, edges, NULL, NULL, NULL, NULL, NULL); + if(!ms) return NULL; // error + list_append(attributes, ms); + } + assert(list_length(attributes) > 0); + s = stmt_list(be, attributes); + s->flag |= GRAPH_EXPR_SHORTEST_PATH; + } else { + assert(0 && "Invalid expression type"); + return NULL; } - + assert(s != NULL); list_append(lst1, s); } - weights = stmt_list(be, lst1); lst1 = NULL; + shortest_paths = stmt_list(be, lst1); lst1 = NULL; // invoke the spfw operator - spfw = stmt_gr8_spfw(be, query, edge_src, edge_dst, weights, spfw_flags); + spfw = stmt_gr8_spfw(be, query, edge_src, edge_dst, shortest_paths, spfw_flags); // finally project back the result lst1 = sa_list(sql->sa); do { // restrict the scope stmt *jl = NULL, *jr = NULL; - int cost_index = 2; + int op_out_index = 2; // start with the lhs jl = stmt_result(be, spfw, 0); @@ -4958,13 +4978,21 @@ rel2bin_graph(backend *be, sql_rel* rel, } } - // append the computed costs - for(node* n = graph_ptr->spfw->h; n; n = n->next){ + // append the computed costs & paths + assert(list_length(graph_ptr->spfw) == list_length(shortest_paths->op4.lval)); + for(node *n = graph_ptr->spfw->h, *m = shortest_paths->op4.lval->h; n; n = n->next, m = m->next){ sql_exp* e = n->data; - stmt* s =
MonetDB: graph0 - QRW: DCE pass for both SYS.NEST and paths
Changeset: 69a130fd3718 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=69a130fd3718 Modified Files: sql/server/rel_exp.c sql/server/rel_graph.c sql/server/rel_graph.h sql/server/rel_optimizer.c sql/server/rel_rel.c Branch: graph0 Log Message: QRW: DCE pass for both SYS.NEST and paths Unify the same logic to mark & remove the unused attributes in the DCE pass for both the SYS.NEST aggregate and the graph shortest path operator. There might still be a latent and occasional bug where the list of attributes for a scalar function is not NULL even when the type is not a nested table. Currently I am not able to reproduce it anymore though :/ diffs (truncated from 338 to 300 lines): diff --git a/sql/server/rel_exp.c b/sql/server/rel_exp.c --- a/sql/server/rel_exp.c +++ b/sql/server/rel_exp.c @@ -214,6 +214,7 @@ exp_op( sql_allocator *sa, list *l, sql_ e->card = CARD_MULTI; e->l = l; e->f = f; + assert(exp_subtype(e) == NULL || exp_subtype(e)->attributes == NULL); return e; } diff --git a/sql/server/rel_graph.c b/sql/server/rel_graph.c --- a/sql/server/rel_graph.c +++ b/sql/server/rel_graph.c @@ -180,6 +180,49 @@ static list* bind_shortest_path_return(m } } +// create the column needed to compute the spfw expr~ +static sql_exp* create_compute_path_expr(mvc *sql, sql_rel* rel_edges){ + sql_schema* schema_sys = NULL; + sql_subtype* type_nested_table = NULL; + sql_subaggr* aggregate = NULL; + list* arguments = NULL; // the parameters of SYS.NEST (i.e. all columns produced by rel_edges) + sql_exp* result = NULL; // the generated expression + list* nt_attributes = NULL; // the attributes associated to the nested table type + + assert(rel_edges != NULL); + + schema_sys = mvc_bind_schema(sql, "sys"); + assert(schema_sys != NULL && "Unable to find the schema 'sys'"); + type_nested_table = sql_bind_subtype(sql->sa, "nested_table", 0, 0); + assert(type_nested_table != NULL && "Unable to find type 'nested_table'"); + + aggregate = sql_bind_aggr(sql->sa, schema_sys, "nest", type_nested_table); + assert(aggregate != NULL && "Unable to bind the sys.nest aggregate"); + + arguments = rel_projections(sql, rel_edges, /*tname=*/ NULL, true, /* intern = */ false); + + // we use an aggregate expression to express the path to compute just to have + // a similar DCE pass for nested tables. However codegen only looks for the flag + // GRAPH_EXPR_SHORTEST_PATH. + // Not sure how the flags nil & no_nil can affect the generated expression + result = exp_aggr(sql->sa, arguments, aggregate, /* distinct = */ FALSE, TRUE, CARD_MULTI, have_nil(arguments)); + result->flag |= GRAPH_EXPR_SHORTEST_PATH; + + // record the attributes for the nested table + type_nested_table = aggregate->res->h->data; + nt_attributes = sa_list(sql->sa); + for(node* n = arguments->h; n; n = n->next){ + sql_exp* e = n->data; + list_append(nt_attributes, exp_column(sql->sa, exp_relname(e), exp_name(e), exp_subtype(e), exp_card(e), has_nil(e), is_intern(e))); + } + type_nested_table->attributes = nt_attributes; + + // finally provide a unique label + result = exp_label(sql->sa, result, ++sql->label); + + return result; +} + static list* bind_shortest_path_graph(mvc *sql, sql_graph *graph, dlist *parse_tree, bool compute_path){ const char* table_ref = NULL; // the table referred (optional) symbol* expr_weight = NULL; // the expression inside CHEAPEST SUM ( ... ); @@ -274,21 +317,8 @@ static list* bind_shortest_path_graph(mv // otherwise we need to create an hoc column & register in the list graph->spfw // to represent the path to compute - if(!column_path) { - const char* label = make_label(sql->sa, ++sql->label); - sql_subtype* type = sql_bind_subtype(sql->sa, "nested_table", 0, 0); - - assert(type != NULL && "Cannot find the 'nested_table' type"); - // record the columns composing the nested_table type, from the edge table - type->attributes = exps_copy(sql->sa, rel_projections(sql, edges, NULL, /* settname = */ true, /* intern = */ false)); - // set the relation name to label - for(node* n = type->attributes->h; n; n = n->next){ - sql_exp* ne = n->data; - ne->rname = label; - } - - column_path = exp_column(sql->sa, label, label, type, CARD_MULTI, /* has_nil = */ FALSE, /* is_intern = */ FALSE); -
MonetDB: graph0 - QRW: Expand the DCE pass for SYS.NEST up to th...
Changeset: bc6dd90e712e for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bc6dd90e712e Modified Files: sql/server/rel_dump.c sql/server/rel_optimizer.c sql/server/rel_rel.c sql/server/rel_select.c Branch: graph0 Log Message: QRW: Expand the DCE pass for SYS.NEST up to the computing summary diffs (198 lines): diff --git a/sql/server/rel_dump.c b/sql/server/rel_dump.c --- a/sql/server/rel_dump.c +++ b/sql/server/rel_dump.c @@ -163,6 +163,10 @@ exp_print(mvc *sql, stream *fout, sql_ex alias = 0; if (!e->rname && e->name && strcmp(e->name, e->r)==0) alias = 0; + + if(e->tpe.attributes != NULL){ + exps_print(sql, fout, e->tpe.attributes, depth, alias, 1); + } break; case e_cmp: if (e->flag == cmp_in || e->flag == cmp_notin) { diff --git a/sql/server/rel_optimizer.c b/sql/server/rel_optimizer.c --- a/sql/server/rel_optimizer.c +++ b/sql/server/rel_optimizer.c @@ -6006,11 +6006,15 @@ exp_nested_table_mark_used(sql_exp* exp_ } if(exp_down->type == e_aggr /*&& exp_nest->f ~ "sys.nest"*/){ - sql_subaggr* subaggr = exp_down->f; - sql_subtype* type = subaggr->res->h->data; + sql_subaggr* subaggr = NULL; + sql_subtype* type = NULL; + + exp_nest = exp_down; + subaggr = exp_nest->f; + assert(list_length(subaggr->res) == 1); + type = subaggr->res->h->data; assert(type->attributes != NULL); - exp_nest = exp_down; target_attributes = type->attributes; } else { assert(exp_down->type == e_column); @@ -6034,18 +6038,28 @@ exp_nested_table_mark_used(sql_exp* exp_ assert(attribute->type == e_column); if(!attribute->used) continue; - if(exp_nest){ - target = exps_bind_column2(target_attributes, attribute->l, attribute->r); - } else { - target = exps_bind_column2(target_attributes, attribute->rname, attribute->name); - } - + target = exps_bind_column2(target_attributes, attribute->l, attribute->r); assert(target != NULL && target->type == e_column); target->used = 1; // list_append(new_attributes, target); } + // mark the attributes in the argument list of sys.nest(...) + if(exp_nest){ + list* args = exp_nest->l; + + for(node *n = target_attributes->h; n; n = n->next){ + sql_exp* ne = n->data; + sql_exp* arg = NULL; + + assert(ne->type == e_column); + if(!ne->used) continue; + arg = exps_bind_column2(args, ne->l, ne->r); + arg->used =1; + } + } + // exp_down->tpe.attributes = new_attributes; // if(exp_unnest){ // exp_up->tpe.attributes = new_attributes; @@ -6053,6 +6067,8 @@ exp_nested_table_mark_used(sql_exp* exp_ if(exp_unnest){ exp_up->tpe.attributes = exp_unnest->tpe.attributes; } + + } static int @@ -6410,6 +6426,19 @@ rel_mark_used(mvc *sql, sql_rel *rel, in static sql_rel * rel_dce_sub(mvc *sql, sql_rel *rel, list *refs); +static list* +exps_remove_unused(mvc* sql, list* exps){ + list* new_exps = sa_list(sql->sa); + for(node *n = exps->h; n; n = n->next){ + sql_exp* ne = n->data; + if(ne->used){ + list_append(new_exps, ne); + } + } + return new_exps; +} + + static sql_rel * rel_remove_unused(mvc *sql, sql_rel *rel) { @@ -6505,30 +6534,40 @@ rel_remove_unused(mvc *sql, sql_rel *rel for(n=rel->exps->h; n; n = n->next) { sql_exp *e = n->data; + // DCE for nested tables if (e->used) { - list* nt_attributes = NULL; - - if(is_project(rel->op)){ - nt_attributes = e->tpe.attributes; - } else if (is_groupby(rel->op) && e->f){ - nt_attributes = e->l; + list** nt_attributes_ptr = NULL; + list** nt_arguments_ptr = NULL; // in case of sys.nest + + if(rel->op == op_project){ // do not use is_project(rel->op) as it also includes the group by (subtle bug) + nt_attributes_ptr = &(e->tpe.attributes); +
MonetDB: graph0 - QRW: fix DCE for nested tables
Changeset: c942d8b7c404 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c942d8b7c404 Modified Files: sql/common/sql_types.c sql/server/rel_dump.c sql/server/rel_exp.c sql/server/rel_graph.c sql/server/rel_graph.h sql/server/rel_optimizer.c Branch: graph0 Log Message: QRW: fix DCE for nested tables Propagate the attributes removed by the DCE pass up to the generator expression. Still need to be fixed for SYS.NEST(...) diffs (truncated from 401 to 300 lines): diff --git a/sql/common/sql_types.c b/sql/common/sql_types.c --- a/sql/common/sql_types.c +++ b/sql/common/sql_types.c @@ -906,11 +906,8 @@ sql_bind_func_(sql_allocator *sa, sql_sc if (f->type != type && f->type != filt) continue; if (strcmp(f->base.name, sqlfname) == 0) { - printf("match %s\n", f->base.name); - if (list_cmp(f->ops, ops, (fcmp) _subtype_cmp) == 0) { - printf("found\n"); + if (list_cmp(f->ops, ops, (fcmp) _subtype_cmp) == 0) return sql_dup_subfunc(sa, f, ops, NULL); - } } } if (s) { diff --git a/sql/server/rel_dump.c b/sql/server/rel_dump.c --- a/sql/server/rel_dump.c +++ b/sql/server/rel_dump.c @@ -538,7 +538,7 @@ rel_print_(mvc *sql, stream *fout, sql_ case op_graph_select: { sql_graph *graph_ptr = (sql_graph*) rel; print_indent(sql, fout, depth, decorate); - mnstr_printf(fout, "%s", op2string(rel->op)); + mnstr_printf(fout, "%s (", op2string(rel->op)); if (rel_is_ref(rel->l)) { int nr = find_ref(refs, rel->l); print_indent(sql, fout, depth+1, decorate); @@ -562,14 +562,15 @@ rel_print_(mvc *sql, stream *fout, sql_ rel_print_(sql, fout, graph_ptr->edges, depth+1, refs, decorate); } print_indent(sql, fout, depth, decorate); + mnstr_printf(fout, ")"); exps_print(sql, fout, rel->exps, depth, 1, 0); mnstr_printf(fout, ", src:"); exps_print(sql, fout, graph_ptr->efrom, depth, 1, 0); mnstr_printf(fout, ", dst:"); exps_print(sql, fout, graph_ptr->eto, depth, 1, 0); print_indent(sql, fout, depth, decorate); - mnstr_printf(fout, "shortest paths: "); - exps_print(sql, fout, graph_ptr->spfw, depth, 1, 1); + mnstr_printf(fout, "Ï :"); + exps_print(sql, fout, graph_ptr->spfw, depth, 1, 0); } break; default: assert(0); diff --git a/sql/server/rel_exp.c b/sql/server/rel_exp.c --- a/sql/server/rel_exp.c +++ b/sql/server/rel_exp.c @@ -9,6 +9,7 @@ #include #include "sql_relation.h" #include "rel_exp.h" +#include "rel_graph.h" #include "rel_prop.h" /* for prop_copy() */ #include "rel_optimizer.h" #include "rel_distribute.h" @@ -1274,6 +1275,7 @@ rel_find_exp_( sql_rel *rel, sql_exp *e) // check whether this is some kind of shortest path else if (is_graph(rel->op) && e->l){ sql_graph* graph_ptr = (sql_graph*) rel; +// ne = graph_bind_spfw(rel, e->l, e->r); ne = exps_bind_column2(graph_ptr->spfw, e->l, e->r); } return ne; diff --git a/sql/server/rel_graph.c b/sql/server/rel_graph.c --- a/sql/server/rel_graph.c +++ b/sql/server/rel_graph.c @@ -281,6 +281,11 @@ static list* bind_shortest_path_graph(mv assert(type != NULL && "Cannot find the 'nested_table' type"); // record the columns composing the nested_table type, from the edge table type->attributes = exps_copy(sql->sa, rel_projections(sql, edges, NULL, /* settname = */ true, /* intern = */ false)); + // set the relation name to label + for(node* n = type->attributes->h; n; n = n->next){ + sql_exp* ne = n->data; + ne->rname = label; + } column_path = exp_column(sql->sa, label, label, type, CARD_MULTI, /* has_nil = */ FALSE, /* is_intern = */ FALSE); column_path->flag |= GRAPH_EXPR_SHORTEST_PATH; @@ -369,3 +374,48 @@ list* rel_graph_shortest_path(mvc *sql, return result; // this can be an exp~ or NULL + an error set } } + + +/* + * * + * Bind an expression produced by a graph
MonetDB: graph0 - Bugfix: codegen, move to the new API to return...
Changeset: 45f1606ce31d for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=45f1606ce31d Modified Files: sql/backends/monet5/rel_bin.c sql/backends/monet5/sql_statement.c Branch: graph0 Log Message: Bugfix: codegen, move to the new API to return multiple outputs The codegen API mil/mal to return multiple variables when invoking a statement was changed in the master branch. With the recent merge the new API was propagated and introduced a mismatch with what done for the graph related statements. This fix aligns the API for these statements with the one used for the rest of the code. diffs (57 lines): diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c --- a/sql/backends/monet5/rel_bin.c +++ b/sql/backends/monet5/rel_bin.c @@ -4899,7 +4899,7 @@ rel2bin_graph(backend *be, sql_rel* rel, query = stmt_list(be, lst1); lst1 = NULL; // in case of a SELECT intersect the two lists, so that we have only the columns part of the domain - // there is no more need to ensure the candidates are sorted, graph.intersect_join_lists can deal + // it is no more needed to ensure the candidates are sorted, graph.intersect_join_lists can deal // with it if(rel->op == op_graph_select){ query = stmt_gr8_intersect_join_lists(be, query); diff --git a/sql/backends/monet5/sql_statement.c b/sql/backends/monet5/sql_statement.c --- a/sql/backends/monet5/sql_statement.c +++ b/sql/backends/monet5/sql_statement.c @@ -3687,6 +3687,7 @@ stmt_gr8_intersect_join_lists(backend *b stmt *s = NULL; // temporary stmt s = stmt_create(be->mvc->sa, st_result); + s->q = q; s->nr = getDestVar(q); copy_params(n->data, s); list_append(l, s); @@ -3695,14 +3696,15 @@ stmt_gr8_intersect_join_lists(backend *b // second parameter is easy list_append(l, stmt_none(be)); - // third & four parameters s = stmt_create(be->mvc->sa, st_result); + s->q = q; s->nr = getArg(q, 1); copy_params(n->data, s); list_append(l, s); n = n->next; s = stmt_create(be->mvc->sa, st_result); + s->q = q; s->nr = getArg(q, 2); copy_params(n->data, s); list_append(l, s); @@ -3716,7 +3718,6 @@ stmt * stmt_gr8_spfw(backend *be, stmt *query, stmt *edge_from, stmt *edge_to, stmt *weights, int global_flags) { InstrPtr q = NULL; stmt *s = NULL; - int dest = -1; int num_output_cols = 2; // number of output columns from the operator stream *stream = buffer_wastream(buffer_create(1024), "spfw_codegen_query"); @@ -3825,7 +3826,7 @@ stmt_gr8_spfw(backend *be, stmt *query, // MIL statement s = stmt_create(be->mvc->sa, st_gr8_spfw); - s->nr = dest; + s->nr = getDestVar(q); s->q = q; s->flag = global_flags; s->op1 = query; ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: graph0 - Build fix: resolve the errors from the merge w...
Changeset: 90dc1204adc3 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=90dc1204adc3 Modified Files: sql/server/rel_dump.c sql/server/rel_optimizer.c Branch: graph0 Log Message: Build fix: resolve the errors from the merge with nested_table that broke the build diffs (30 lines): diff --git a/sql/server/rel_dump.c b/sql/server/rel_dump.c --- a/sql/server/rel_dump.c +++ b/sql/server/rel_dump.c @@ -64,8 +64,6 @@ cmp_print(mvc *sql, stream *fout, int cm mnstr_printf(fout, " %s ", r); } -static void exps_print(mvc *sql, stream *fout, list *exps, int depth, int alias, int brackets); - static void exp_print(mvc *sql, stream *fout, sql_exp *e, int depth, int comma, int alias) { diff --git a/sql/server/rel_optimizer.c b/sql/server/rel_optimizer.c --- a/sql/server/rel_optimizer.c +++ b/sql/server/rel_optimizer.c @@ -7165,14 +7165,6 @@ rel_simplify_predicates(int *changes, mv static void split_exps(mvc *sql, list *exps, sql_rel *rel); static int -exp_match_exp_cmp( sql_exp *e1, sql_exp *e2) -{ - if (exp_match_exp(e1,e2)) - return 0; - return -1; -} - -static int exp_refers_cmp( sql_exp *e1, sql_exp *e2) { if (exp_refers(e1,e2)) ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: graph0 - Merge branch 'graph/nested_tables' into graph/...
Changeset: a87c9d47fdf6 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a87c9d47fdf6 Added Files: monetdb5/modules/atoms/nested_table.c monetdb5/modules/atoms/nested_table.h monetdb5/modules/atoms/nested_table.mal sql/scripts/35_nested_table.sql Modified Files: monetdb5/modules/atoms/Makefile.ag monetdb5/modules/atoms/blob.c monetdb5/modules/mal/mal_init.mal sql/backends/monet5/rel_bin.c sql/backends/monet5/sql_statement.c sql/backends/monet5/sql_statement.h sql/common/sql_types.c sql/common/sql_types.h sql/include/sql_catalog.h sql/include/sql_relation.h sql/scripts/Makefile.ag sql/server/rel_distribute.c sql/server/rel_dump.c sql/server/rel_exp.c sql/server/rel_exp.h sql/server/rel_optimizer.c sql/server/rel_partition.c sql/server/rel_rel.c sql/server/rel_rel.h sql/server/rel_schema.c sql/server/rel_select.c sql/server/rel_xml.c sql/server/sql_parser.h sql/server/sql_parser.y sql/server/sql_scan.c sql/server/sql_symbol.c sql/server/sql_symbol.h sql/storage/bat/bat_utils.c sql/storage/sql_catalog.c sql/storage/store.c Branch: graph0 Log Message: Merge branch 'graph/nested_tables' into graph/master diffs (truncated from 1959 to 300 lines): diff --git a/monetdb5/modules/atoms/Makefile.ag b/monetdb5/modules/atoms/Makefile.ag --- a/monetdb5/modules/atoms/Makefile.ag +++ b/monetdb5/modules/atoms/Makefile.ag @@ -23,6 +23,7 @@ lib_atoms = { json.c json.h \ mcurl.c \ mtime.c mtime.h \ + nested_table.c nested_table.h \ str.c str.h \ streams.c streams.h \ url.c url.h \ @@ -42,6 +43,7 @@ headers_mal = { json.mal \ mcurl.mal \ mtime.mal \ + nested_table.mal \ streams.mal \ str.mal \ url.mal \ diff --git a/monetdb5/modules/atoms/blob.c b/monetdb5/modules/atoms/blob.c --- a/monetdb5/modules/atoms/blob.c +++ b/monetdb5/modules/atoms/blob.c @@ -52,7 +52,6 @@ mal_export str BLOBtoblob(blob **retval, mal_export str BLOBfromblob(str *retval, blob **b); mal_export str BLOBfromidx(str *retval, blob **binp, int *index); mal_export str BLOBnitems(int *ret, blob *b); -mal_export int BLOBget(Heap *h, int *bun, int *l, blob **val); mal_export blob * BLOBread(blob *a, stream *s, size_t cnt); mal_export gdk_return BLOBwrite(blob *a, stream *s, size_t cnt); diff --git a/monetdb5/modules/atoms/nested_table.c b/monetdb5/modules/atoms/nested_table.c new file mode 100644 --- /dev/null +++ b/monetdb5/modules/atoms/nested_table.c @@ -0,0 +1,220 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * Copyright 1997 - July 2008 CWI, August 2008 - 2017 MonetDB B.V. + */ + +#include "monetdb_config.h" + +#include "mal.h" +#include "mal_exception.h" +#include "gdk_bbp.h" + +#include "nested_table.h" + +// errors +#if !defined(NDEBUG) /* debug only */ +#define _CHECK_ERRLINE_EXPAND(LINE) #LINE +#define _CHECK_ERRLINE(LINE) _CHECK_ERRLINE_EXPAND(LINE) +#define _CHECK_ERRMSG(EXPR, ERROR) "[" __FILE__ ":" _CHECK_ERRLINE(__LINE__) "] " ERROR ": `" #EXPR "'" +#else /* release mode */ +#define _CHECK_ERRMSG(EXPR, ERROR) ERROR +#endif +#define CHECK( EXPR, ERROR ) if ( !(EXPR) ) \ + { rc = createException(MAL, function_name /*__FUNCTION__?*/, _CHECK_ERRMSG( EXPR, ERROR ) ); goto error; } + +// prototypes +mal_export str NESTEDTABLEnest1_oid(bat*, const bat*, const bat*); +mal_export str NESTEDTABLEunnest101_oid(bat*, bat*, const bat*); +mal_export void NESTEDTABLEheap(Heap*, size_t); +mal_export void* NESTEDTABLEnull(void); +mal_export var_t NESTEDTABLEput(Heap *h, var_t *bun, nested_table *val); +mal_export str NESTEDTABLEprelude(void*); + +// index in the BATatoms table +int TYPE_nested_table; + +void NESTEDTABLEheap(Heap* heap, size_t capacity){ + (void) capacity; // capacity refers to the #number of elements in the non virtual heap + HEAP_initialize(heap, 0, 0, sizeof(oid)); +} + +// make GDK happy +static oid nil_instance = -1; +void* NESTEDTABLEnull(void){ + return _instance; +} + +// initializer +str NESTEDTABLEprelude(void* ret) { + (void) ret; + TYPE_nested_table = ATOMindex("nestedtable"); + + BATatoms[TYPE_nested_table].linear = FALSE; + return MAL_SUCCEED; +} + +var_t NESTEDTABLEput(Heap *h, var_t *bun, nested_table *value) { + const size_t size = (value->count+1) * sizeof(oid); + const var_t offset = HEAP_malloc(h, size) << GDK_VARSHIFT; // longjmp in case of error O.o + memcpy(h->base +
MonetDB: graph0 - Build fixes: updates due to the merge with master
Changeset: 8be557660a0e for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8be557660a0e Modified Files: sql/backends/monet5/sql_statement.c Branch: graph0 Log Message: Build fixes: updates due to the merge with master diffs (59 lines): diff --git a/sql/backends/monet5/sql_statement.c b/sql/backends/monet5/sql_statement.c --- a/sql/backends/monet5/sql_statement.c +++ b/sql/backends/monet5/sql_statement.c @@ -3509,11 +3509,6 @@ stmt_gr8_slices(backend *be, stmt *op, i } q = pushArgument(be->mb, q, ref_stmt); - // abi convention - for(int i = 1; i < num_slices; i++) { - snprintf(be->mb->var[getArg(q, i)]->id, IDLENGTH, "r%d_%d", i, getDestVar(q)); - } - // finally create the MIL wrapper s = stmt_create(be->mvc->sa, st_gr8_slices); s->op1 = op; @@ -3590,11 +3585,6 @@ stmt_gr8_intersect_join_lists(backend *b q = pushArgument(be->mb, q, s->nr); } - // ABI convention - for(int i = 1; i < num_operands -1; i++) { - snprintf(be->mb->var[getArg(q, i)]->id, IDLENGTH, "r%d_%d", i, getDestVar(q)); - } - // generate the MIL statement l = sa_list(be->mvc->sa); do { // again, restrict the scope @@ -3632,7 +3622,6 @@ stmt_gr8_spfw(backend *be, stmt *query, InstrPtr q = NULL; stmt *s = NULL; int dest = -1; - int i = -1; int num_output_cols = 2; // number of output columns from the operator stream *stream = buffer_wastream(buffer_create(1024), "spfw_codegen_query"); @@ -3684,7 +3673,7 @@ stmt_gr8_spfw(backend *be, stmt *query, // describe the input columns mnstr_printf(stream, "\t\n"); mnstr_printf(stream, "\t\t\n", q->retc +1); - if(be->mb->var[q->argv[q->retc+2]]->value.val.bval != bat_nil) { + if(be->mb->var[q->argv[q->retc+2]].value.val.bval != bat_nil) { mnstr_printf(stream, "\t\t\n", q->retc +2); } mnstr_printf(stream, "\t\t\n", q->retc +3); @@ -3739,14 +3728,6 @@ stmt_gr8_spfw(backend *be, stmt *query, mnstr_destroy(stream); stream = NULL; } while(0); - // API convention - dest = getDestVar(q); // jl - renameVariable(be->mb, getArg(q, 1), "r1_%d", dest); // jr - i = 2; - for(node *n = weights->op4.lval->h; n; n = n->next, i++){ // shortest paths - snprintf(be->mb->var[getArg(q, i)]->id, IDLENGTH, "r%d_%d", i, dest); - } - // MIL statement s = stmt_create(be->mvc->sa, st_gr8_spfw); s->nr = dest; ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: graph0 - Merge branch 'master' into graph/master
Changeset: 83f31d7ce3c6 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=83f31d7ce3c6 Added Files: monetdb5/mal/Tests/malids.malC monetdb5/mal/Tests/malids.stable.err monetdb5/mal/Tests/malids.stable.out monetdb5/modules/atoms/Tests/strappend.malC monetdb5/modules/atoms/Tests/strappend.stable.err monetdb5/modules/atoms/Tests/strappend.stable.out monetdb5/modules/kernel/Tests/select.malC monetdb5/modules/kernel/Tests/select.stable.err monetdb5/modules/kernel/Tests/select.stable.out monetdb5/optimizer/Tests/tst4006.malC monetdb5/optimizer/Tests/tst4006.stable.err monetdb5/optimizer/Tests/tst4006.stable.out sql/backends/monet5/Tests/pyloader06.stable.out.Windows sql/backends/monet5/Tests/pyloader07.stable.out.Windows sql/test/BugTracker-2016/Tests/groupby_on_column_expression.Bug-3832.sql sql/test/BugTracker-2016/Tests/groupby_on_column_expression.Bug-3832.stable.err sql/test/BugTracker-2016/Tests/groupby_on_column_expression.Bug-3832.stable.out sql/test/BugTracker-2017/Tests/cast_boolean_to_string.Bug-6110.sql sql/test/BugTracker-2017/Tests/cast_boolean_to_string.Bug-6110.stable.err sql/test/BugTracker-2017/Tests/cast_boolean_to_string.Bug-6110.stable.out sql/test/BugTracker-2017/Tests/create_view_order_by.Bug-3465.sql sql/test/BugTracker-2017/Tests/create_view_order_by.Bug-3465.stable.err sql/test/BugTracker-2017/Tests/create_view_order_by.Bug-3465.stable.out sql/test/BugTracker-2017/Tests/modulo.Bug-6225.sql sql/test/BugTracker-2017/Tests/modulo.Bug-6225.stable.err sql/test/BugTracker-2017/Tests/modulo.Bug-6225.stable.out sql/test/BugTracker-2017/Tests/null-quantile.Bug-6218.sql sql/test/BugTracker-2017/Tests/null-quantile.Bug-6218.stable.err sql/test/BugTracker-2017/Tests/null-quantile.Bug-6218.stable.out sql/test/BugTracker-2017/Tests/real-power.Bug-6228.sql sql/test/BugTracker-2017/Tests/real-power.Bug-6228.stable.err sql/test/BugTracker-2017/Tests/real-power.Bug-6228.stable.out sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6216.sql sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6216.stable.err sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6216.stable.out sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6217.sql sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6217.stable.err sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6217.stable.out sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6219.sql sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6219.stable.err sql/test/BugTracker-2017/Tests/sqlsmith.Bug-6219.stable.out Removed Files: monetdb5/extras/sphinx/30_sphinx.mal monetdb5/extras/sphinx/Makefile.ag monetdb5/extras/sphinx/sphinx.c monetdb5/extras/sphinx/sphinx.h monetdb5/extras/sphinx/sphinx.mal monetdb5/mal/Tests/tst273.stable.err monetdb5/mal/Tests/tst273.stable.out monetdb5/optimizer/Tests/flowgraph.malC monetdb5/optimizer/Tests/flowgraph.stable.err monetdb5/optimizer/Tests/flowgraph.stable.out Modified Files: .hgtags MonetDB.spec NT/monetdb_config.h.in NT/rules.msc clients/Tests/All clients/Tests/MAL-signatures.stable.out clients/Tests/MAL-signatures.stable.out.int128 clients/Tests/exports.stable.out configure.ag debian/changelog debian/rules gdk/ChangeLog gdk/ChangeLog.Dec2016 gdk/gdk.h gdk/gdk_aggr.c gdk/gdk_atoms.c gdk/gdk_batop.c gdk/gdk_bbp.c gdk/gdk_imprints.c gdk/gdk_interprocess.c gdk/gdk_join.c gdk/gdk_logger.c gdk/gdk_orderidx.c gdk/gdk_private.h gdk/gdk_project.c gdk/gdk_select.c gdk/gdk_utils.c geom/monetdb5/geom.c geom/monetdb5/geomBulk.c geom/monetdb5/geom_upgrade.c geom/sql/functions/Tests/ST_NumInteriorRings.stable.out monetdb5/ChangeLog monetdb5/extras/Makefile.ag monetdb5/mal/Tests/All monetdb5/mal/Tests/performanceTests/performanceLog monetdb5/mal/Tests/run monetdb5/mal/mal.h monetdb5/mal/mal_authorize.c monetdb5/mal/mal_builder.c monetdb5/mal/mal_builder.h monetdb5/mal/mal_client.c monetdb5/mal/mal_dataflow.c monetdb5/mal/mal_debugger.c monetdb5/mal/mal_function.c monetdb5/mal/mal_function.h monetdb5/mal/mal_import.c monetdb5/mal/mal_instruction.c monetdb5/mal/mal_instruction.h monetdb5/mal/mal_parser.c monetdb5/mal/mal_profiler.c monetdb5/mal/mal_runtime.c monetdb5/mal/mal_session.c monetdb5/modules/atoms/Tests/All monetdb5/modules/kernel/Tests/All
MonetDB: graph0 - Merge branch 'master' into graph/master
Changeset: b4a4e3890121 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b4a4e3890121 Added Files: monetdb5/extras/rapi/Tests/rapi02.stable.out.int128 sql/backends/monet5/Tests/int_notation_1e5.stable.out.int128 sql/backends/monet5/UDF/pyapi/Tests/pyapi_types_huge.stable.out.int128 sql/jdbc/tests/Tests/Test_Int128.stable.out.int128 sql/test/BugTracker-2015/Tests/hugeint-wrong-value.Bug-3849.stable.out.int128 sql/test/BugTracker-2016/Tests/convert-function-test-hge.Bug-3460.stable.out.int128 sql/test/BugTracker-2016/Tests/storagemodel.stable.out.Windows sql/test/BugTracker-2017/Tests/cast-with-many-decimals.Bug-6195.stable.out.int128 sql/test/BugTracker-2017/Tests/complicated_logic.Bug-105.sql sql/test/BugTracker-2017/Tests/complicated_logic.Bug-105.stable.err sql/test/BugTracker-2017/Tests/complicated_logic.Bug-105.stable.out sql/test/BugTracker-2017/Tests/crash_in_null_cast.Bug-6186.sql sql/test/BugTracker-2017/Tests/crash_in_null_cast.Bug-6186.stable.err sql/test/BugTracker-2017/Tests/crash_in_null_cast.Bug-6186.stable.out sql/test/BugTracker-2017/Tests/crash_on_NULL_ptr.Bug-6130.sql sql/test/BugTracker-2017/Tests/crash_on_NULL_ptr.Bug-6130.stable.err sql/test/BugTracker-2017/Tests/crash_on_NULL_ptr.Bug-6130.stable.out sql/test/BugTracker-2017/Tests/crash_on_count_div_count.Bug-6201.sql sql/test/BugTracker-2017/Tests/crash_on_count_div_count.Bug-6201.stable.err sql/test/BugTracker-2017/Tests/crash_on_count_div_count.Bug-6201.stable.out sql/test/BugTracker-2017/Tests/dce_bug-6177.sql sql/test/BugTracker-2017/Tests/dce_bug-6177.stable.err sql/test/BugTracker-2017/Tests/dce_bug-6177.stable.out sql/test/BugTracker-2017/Tests/drop_not_null_on_pkey.Bug-6189.sql sql/test/BugTracker-2017/Tests/drop_not_null_on_pkey.Bug-6189.stable.err sql/test/BugTracker-2017/Tests/drop_not_null_on_pkey.Bug-6189.stable.out sql/test/BugTracker-2017/Tests/group-by-on-constant.Bug-6082.sql sql/test/BugTracker-2017/Tests/group-by-on-constant.Bug-6082.stable.err sql/test/BugTracker-2017/Tests/group-by-on-constant.Bug-6082.stable.out sql/test/BugTracker-2017/Tests/group-by-on-constant.Bug-6082.stable.out.int128 sql/test/BugTracker-2017/Tests/incorrect_error.Bug-6141.sql sql/test/BugTracker-2017/Tests/incorrect_error.Bug-6141.stable.err sql/test/BugTracker-2017/Tests/incorrect_error.Bug-6141.stable.out sql/test/BugTracker-2017/Tests/integer_addition_overflow.Bug-6205.sql sql/test/BugTracker-2017/Tests/integer_addition_overflow.Bug-6205.stable.err sql/test/BugTracker-2017/Tests/integer_addition_overflow.Bug-6205.stable.out sql/test/BugTracker-2017/Tests/nested_with.Bug-6187.sql sql/test/BugTracker-2017/Tests/nested_with.Bug-6187.stable.err sql/test/BugTracker-2017/Tests/nested_with.Bug-6187.stable.out sql/test/BugTracker-2017/Tests/oidx-on-strings.Bug-6202.sql sql/test/BugTracker-2017/Tests/oidx-on-strings.Bug-6202.stable.err sql/test/BugTracker-2017/Tests/oidx-on-strings.Bug-6202.stable.out sql/test/BugTracker-2017/Tests/prepare.Bug-6133.sql sql/test/BugTracker-2017/Tests/prepare.Bug-6133.stable.err sql/test/BugTracker-2017/Tests/prepare.Bug-6133.stable.out sql/test/BugTracker-2017/Tests/rel2bin_project-assert.Bug-6080.sql sql/test/BugTracker-2017/Tests/rel2bin_project-assert.Bug-6080.stable.err sql/test/BugTracker-2017/Tests/rel2bin_project-assert.Bug-6080.stable.out sql/test/BugTracker-2017/Tests/splitpart.Bug-6194.sql sql/test/BugTracker-2017/Tests/splitpart.Bug-6194.stable.err sql/test/BugTracker-2017/Tests/splitpart.Bug-6194.stable.out sql/test/BugTracker-2017/Tests/sqlsmith01.sql sql/test/BugTracker-2017/Tests/sqlsmith01.stable.err sql/test/BugTracker-2017/Tests/sqlsmith01.stable.out sql/test/BugTracker-2017/Tests/sqlsmith02.sql sql/test/BugTracker-2017/Tests/sqlsmith02.stable.err sql/test/BugTracker-2017/Tests/sqlsmith02.stable.out sql/test/BugTracker-2017/Tests/sqlsmith03.sql sql/test/BugTracker-2017/Tests/sqlsmith03.stable.err sql/test/BugTracker-2017/Tests/sqlsmith03.stable.out sql/test/BugTracker-2017/Tests/sqlsmith04.sql sql/test/BugTracker-2017/Tests/sqlsmith04.stable.err sql/test/BugTracker-2017/Tests/sqlsmith04.stable.out sql/test/BugTracker-2017/Tests/str2decimal.Bug-6206.sql sql/test/BugTracker-2017/Tests/str2decimal.Bug-6206.stable.err sql/test/BugTracker-2017/Tests/str2decimal.Bug-6206.stable.out sql/test/BugTracker-2017/Tests/union_func_crash.Bug-6196.sql sql/test/BugTracker-2017/Tests/union_func_crash.Bug-6196.stable.err
MonetDB: graph0 - SEMA/CODEGEN: compute a BFS in case a constant...
Changeset: d5518bbd5245 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d5518bbd5245 Modified Files: sql/backends/monet5/rel_bin.c sql/backends/monet5/sql_statement.c sql/common/sql_types.c sql/server/rel_graph.c Branch: graph0 Log Message: SEMA/CODEGEN: compute a BFS in case a constant weight has been specified diffs (130 lines): diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c --- a/sql/backends/monet5/rel_bin.c +++ b/sql/backends/monet5/rel_bin.c @@ -4817,9 +4817,13 @@ rel2bin_graph(backend *be, sql_rel* rel, lst1 = sa_list(sql->sa); for(node *n = graph_ptr->spfw->h; n; n = n->next){ sql_exp* e = n->data; - stmt* s = exp_bin(be, e, edges, NULL, NULL, NULL, NULL, NULL); - assert(s != NULL && "Weight expression is NULL"); - if(!s) return NULL; + stmt *s = NULL; + + if(!exp_is_atom(e)){ // no need to generate a weight for a bfs + s = exp_bin(be, e, edges, NULL, NULL, NULL, NULL, NULL); + assert(s != NULL && "Weight expression is NULL"); + if(!s) return NULL; + } list_append(lst1, s); } diff --git a/sql/backends/monet5/sql_statement.c b/sql/backends/monet5/sql_statement.c --- a/sql/backends/monet5/sql_statement.c +++ b/sql/backends/monet5/sql_statement.c @@ -3690,7 +3690,7 @@ stmt_gr8_spfw(backend *be, stmt *query, } // I can use macros too.. -#define EVIL_PUSH(S) if (((stmt*) (S))->type == st_none ) { q = pushNil(be->mb, q, TYPE_bat); } \ +#define EVIL_PUSH(S) if ( (S) == NULL || ((stmt*) (S))->type == st_none ) { q = pushNil(be->mb, q, TYPE_bat); } \ else if(((stmt*)S)->nr < 0) { return NULL; } else { q = pushArgument(be->mb, q, ((stmt*) S)->nr); } // generate the MAL instruction @@ -3735,7 +3735,6 @@ stmt_gr8_spfw(backend *be, stmt *query, mnstr_printf(stream, "\t\t\n", q->retc +6); mnstr_printf(stream, "\t\n"); - // spfw do { int ret_spfw = 2; // 0 = jl, 1 = jr @@ -3746,7 +3745,9 @@ stmt_gr8_spfw(backend *be, stmt *query, for(node *n = weights->op4.lval->h; n; n = n->next){ mnstr_printf(stream, "\t\t\n"); mnstr_printf(stream, "\t\t\t\n", ret_spfw++); - mnstr_printf(stream, "\t\t\t\n", arg_spfw++); + if(n->data) // weighted shortest path? + mnstr_printf(stream, "\t\t\t\n", arg_spfw); + arg_spfw++; // increment anyway as we are pushing a dummy argument as nil if this is BFS mnstr_printf(stream, "\t\t\n"); } diff --git a/sql/common/sql_types.c b/sql/common/sql_types.c --- a/sql/common/sql_types.c +++ b/sql/common/sql_types.c @@ -905,8 +905,11 @@ sql_bind_func_(sql_allocator *sa, sql_sc if (f->type != type && f->type != filt) continue; if (strcmp(f->base.name, sqlfname) == 0) { - if (list_cmp(f->ops, ops, (fcmp) _subtype_cmp) == 0) + printf("match %s\n", f->base.name); + if (list_cmp(f->ops, ops, (fcmp) _subtype_cmp) == 0) { + printf("found\n"); return sql_dup_subfunc(sa, f, ops, NULL); + } } } if (s) { diff --git a/sql/server/rel_graph.c b/sql/server/rel_graph.c --- a/sql/server/rel_graph.c +++ b/sql/server/rel_graph.c @@ -184,7 +184,7 @@ static sql_exp* bind_cheapest_sum_graph( const char* table_ref = NULL; // the table referred (optional) symbol* expr_weight = NULL; // the expression inside CHEAPEST SUM ( ... ); sql_rel* edges = NULL; // the table expression representing the edges - sql_exp* e = NULL; // the final result + sql_exp* e = NULL; // the expression being bound exp_kind exp_kind_value = {type_value, card_column, TRUE}; // rel_value_exp parameters // init @@ -205,6 +205,14 @@ static sql_exp* bind_cheapest_sum_graph( if(e){ // success node* duplicate = NULL; + sql_exp* bound_exp = e; // the resulting expression + bool is_bfs = false; // is this a BFS? + + // if this is an atom, then perform a simple BFS and multiply the final result by the original atom + if(exp_is_atom(e)){ + e = exp_atom_lng(sql->sa, 1); // whatever value or type, the important part for the codegen is that this is an atom + is_bfs = true; + } // before creating a new spfw, search for duplicates in the list of expressions // already registered @@ -219,7 +227,34 @@ static
MonetDB: graph0 - QRW: avoid to remove the `weights' columns in ...
Changeset: 69d6f049b9da for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=69d6f049b9da Modified Files: sql/backends/monet5/rel_bin.c sql/backends/monet5/sql_statement.c sql/server/rel_optimizer.c Branch: graph0 Log Message: QRW: avoid to remove the `weights' columns in the DCE pass diffs (95 lines): diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c --- a/sql/backends/monet5/rel_bin.c +++ b/sql/backends/monet5/rel_bin.c @@ -16,6 +16,7 @@ #include "rel_select.h" #include "rel_updates.h" #include "rel_optimizer.h" +#include "rel_dump.h" // debug only #include "sql_env.h" #define OUTER_ZERO 64 @@ -4721,6 +4722,9 @@ rel2bin_graph(backend *be, sql_rel* rel, // for more extreme cases #define void2oid(statement) stmt_gr8_void2oid(be, statement) + // debugging + printf("[rel2bin_graph] input: %s\n", dump_rel(sql, rel)); + // first construct the depending relations left = subrel_bin(be, rel->l, refs); if(!left) return NULL; // error @@ -4814,7 +4818,7 @@ rel2bin_graph(backend *be, sql_rel* rel, for(node *n = graph_ptr->spfw->h; n; n = n->next){ sql_exp* e = n->data; stmt* s = exp_bin(be, e, edges, NULL, NULL, NULL, NULL, NULL); - assert(s != NULL); + assert(s != NULL && "Weight expression is NULL"); if(!s) return NULL; list_append(lst1, s); diff --git a/sql/backends/monet5/sql_statement.c b/sql/backends/monet5/sql_statement.c --- a/sql/backends/monet5/sql_statement.c +++ b/sql/backends/monet5/sql_statement.c @@ -3671,6 +3671,7 @@ stmt_gr8_spfw(backend *be, stmt *query, stmt *s = NULL; int dest = -1; int i = -1; + int num_output_cols = 2; // number of output columns from the operator stream *stream = buffer_wastream(buffer_create(1024), "spfw_codegen_query"); // Validate the input parameters @@ -3700,7 +3701,8 @@ stmt_gr8_spfw(backend *be, stmt *query, q = pushReturn(be->mb, q, newTmpVariable(be->mb, TYPE_bat)); // right candidate list // add the shortest paths for(node *n = weights->op4.lval->h; n; n = n->next){ - q = pushReturn(be->mb, q, newTmpVariable(be->mb, TYPE_any)); + q = pushReturn(be->mb, q, newTmpVariable(be->mb, TYPE_bat)); + num_output_cols++; } // the first argument should be the query description @@ -3778,7 +3780,7 @@ stmt_gr8_spfw(backend *be, stmt *query, dest = getDestVar(q); // jl renameVariable(be->mb, getArg(q, 1), "r1_%d", dest); // jr i = 2; - for(node *n = weights->op4.lval->h; n; n = n->next){ // shortest paths + for(node *n = weights->op4.lval->h; n; n = n->next, i++){ // shortest paths snprintf(be->mb->var[getArg(q, i)]->id, IDLENGTH, "r%d_%d", i, dest); } @@ -3790,6 +3792,9 @@ stmt_gr8_spfw(backend *be, stmt *query, s->op1 = query; s->op2 = stmt_list(be, append(append(sa_list(be->mvc->sa), edge_from), edge_to)); s->op3 = weights; + // just required >= 1 to avoid projecting a column out of a constant when looking + // for the shortest paths + s->nrcols = num_output_cols; /* = i*/ return s; } diff --git a/sql/server/rel_optimizer.c b/sql/server/rel_optimizer.c --- a/sql/server/rel_optimizer.c +++ b/sql/server/rel_optimizer.c @@ -6295,6 +6295,8 @@ rel_mark_used(mvc *sql, sql_rel *rel, in // edges exps_mark_used_(sql->sa, rel, graph_ptr->edges, graph_ptr->efrom); exps_mark_used_(sql->sa, rel, graph_ptr->edges, graph_ptr->eto); + exps_mark_used_(sql->sa, rel, graph_ptr->edges, graph_ptr->spfw); + rel_mark_used(sql, graph_ptr->edges, 0); } break; } @@ -9529,8 +9531,11 @@ static sql_rel * rel = rewrite_topdown(sql, rel, _push_project_down_union, ); /* Remove unused expressions */ - if (level <= 0) + if (level <= 0) { + printf("[Optimizer] dce before: %s\n", dump_rel(sql, rel)); rel = rel_dce(sql, rel); + printf("[Optimizer] dce after: %s\n", dump_rel(sql, rel)); + } if (gp.cnt[op_join] || gp.cnt[op_left] || gp.cnt[op_right] || gp.cnt[op_full] || gp.cnt[op_semi] || gp.cnt[op_anti] || gp.cnt[op_select] || graph_operators) { ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: graph0 - CODEGEN: do not sort the candidates in case of...
Changeset: 81dead2a0533 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=81dead2a0533 Modified Files: sql/backends/monet5/rel_bin.c sql/backends/monet5/sql_statement.c sql/backends/monet5/sql_statement.h Branch: graph0 Log Message: CODEGEN: do not sort the candidates in case of a select The function "graph.intersect_join_lists" can be now invoked with unsorted inputs. The sorting occurs inside the function itself. diffs (110 lines): diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c --- a/sql/backends/monet5/rel_bin.c +++ b/sql/backends/monet5/rel_bin.c @@ -4791,50 +4791,22 @@ rel2bin_graph(backend *be, sql_rel* rel, join_left = releqjoin(be, lhs, domain_list, /*used_hash = */ false, cmp_equal, /* need_left = */ false); join_right = releqjoin(be, rhs, domain_list, /*used_hash = */ false, cmp_equal, /* need_left = */ false); - - // intersect the two lists, so that we have only the columns part of the domain + // generate the query parameters + lst1 = sa_list(sql->sa); + list_append(lst1, void2oid(stmt_result(be, join_left, 0))); + list_append(lst1, void2oid(stmt_result(be, join_right, 0))); + list_append(lst1, void2oid(stmt_result(be, join_left, 1))); + list_append(lst1, void2oid(stmt_result(be, join_right, 1))); + query = stmt_list(be, lst1); lst1 = NULL; + + // in case of a SELECT intersect the two lists, so that we have only the columns part of the domain + // there is no more need to ensure the candidates are sorted, graph.intersect_join_lists can deal + // with it if(rel->op == op_graph_select){ - stmt *jll = stmt_result(be, join_left, 0); - stmt *jlr = stmt_result(be, join_left, 1); - stmt *jrl = stmt_result(be, join_right, 0); - stmt *jrr = stmt_result(be, join_right, 1); - - // sort left & right - jll = stmt_order(be, jll, /* direction (0 = DESC, 1 = ASC) = */ 1); - jlr = stmt_project(be, stmt_result(be, jll, 1), jlr); - jrl = stmt_order(be, jrl, /* direction (0 = DESC, 1 = ASC) = */ 1); - jrr = stmt_project(be, stmt_result(be, jrl, 1), jrr); - - // remove those damn VOIDs - jll = void2oid(jll); - jlr = void2oid(jlr); - jrl = void2oid(jrl); - jrr = void2oid(jrr); - - // intersect the elements - lst1 = sa_list(sql->sa); - list_append(lst1, jll); - list_append(lst1, jrl); - list_append(lst1, jlr); - list_append(lst1, jrr); - query = stmt_gr8_intersect_join_lists(be, stmt_list(be, lst1)); - lst1 = NULL; - - } else { // this is join - assert(rel->op == op_graph_join); - - // generate the query parameters - lst1 = sa_list(sql->sa); - list_append(lst1, void2oid(stmt_result(be, join_left, 0))); - list_append(lst1, void2oid(stmt_result(be, join_right, 0))); - list_append(lst1, void2oid(stmt_result(be, join_left, 1))); - list_append(lst1, void2oid(stmt_result(be, join_right, 1))); - query = stmt_list(be, lst1); - lst1 = NULL; + query = stmt_gr8_intersect_join_lists(be, query); + } else { // op_graph_join + spfw_flags |= SPFW_JOIN; } - - if(rel->op == op_graph_join) - spfw_flags |= SPFW_JOIN; } while(0); // weights diff --git a/sql/backends/monet5/sql_statement.c b/sql/backends/monet5/sql_statement.c --- a/sql/backends/monet5/sql_statement.c +++ b/sql/backends/monet5/sql_statement.c @@ -3666,7 +3666,7 @@ stmt_gr8_intersect_join_lists(backend *b stmt * -stmt_gr8_spfw(backend *be, stmt *query, stmt *edge_from, stmt *edge_to, stmt *weights, int flags) { +stmt_gr8_spfw(backend *be, stmt *query, stmt *edge_from, stmt *edge_to, stmt *weights, int global_flags) { InstrPtr q = NULL; stmt *s = NULL; int dest = -1; @@ -3700,7 +3700,7 @@ stmt_gr8_spfw(backend *be, stmt *query, for(node *n = weights->op4.lval->h; n; n = n->next){ // weights EVIL_PUSH(n->data); } - q = pushInt(be->mb, q, flags); + q = pushInt(be->mb, q, global_flags); #undef EVIL_PUSH @@ -3716,7 +3716,7 @@ stmt_gr8_spfw(backend *be, stmt *query, s =
MonetDB: graph0 - CODEGEN: select semantics for the graph operator
Changeset: 2f3028fff1ef for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2f3028fff1ef Modified Files: monetdb5/mal/mal_listing.c sql/backends/monet5/rel_bin.c sql/backends/monet5/sql_statement.c sql/backends/monet5/sql_statement.h Branch: graph0 Log Message: CODEGEN: select semantics for the graph operator diffs (294 lines): diff --git a/monetdb5/mal/mal_listing.c b/monetdb5/mal/mal_listing.c --- a/monetdb5/mal/mal_listing.c +++ b/monetdb5/mal/mal_listing.c @@ -290,13 +290,14 @@ instruction2str(MalBlkPtr mb, MalStkPtr case PATcall: case CMDcall: case ASSIGNsymbol : - // is any variable explicit or used - for (i = 0; i < p->retc; i++) - if ( !isTmpVar(mb,getArg(p,i)) || isVarUsed(mb, getArg(p, i)) || isVarUDFtype(mb,getArg(p,i))) - break; - - if (i == p->retc) - break; + // Dean: for debugging purposes, always show all the assignments +// // is any variable explicit or used +// for (i = 0; i < p->retc; i++) +// if ( !isTmpVar(mb,getArg(p,i)) || isVarUsed(mb, getArg(p, i)) || isVarUDFtype(mb,getArg(p,i))) +// break; +// +// if (i == p->retc) +// break; /* display multi-assignment list */ if (p->retc > 1) diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c --- a/sql/backends/monet5/rel_bin.c +++ b/sql/backends/monet5/rel_bin.c @@ -1585,23 +1585,26 @@ join_hash_key( backend *be, list *l ) return h; } - -// do not project the result back static stmt * -releqjoin_( backend *be, list *l1, list *l2, int used_hash, comp_type cmp_op, int need_left ){ +releqjoin( backend *be, list *l1, list *l2, int used_hash, comp_type cmp_op, int need_left ) +{ + mvc *sql = be->mvc; + node *n1 = l1->h, *n2 = l2->h; stmt *l, *r, *res; if (list_length(l1) <= 1) { l = l1->h->data; r = l2->h->data; - r = stmt_join(be, l, r, 0, cmp_op); + r = stmt_join(be, l, r, 0, need_left? cmp_left : cmp_op); if (need_left) r->flag = cmp_left; return r; } if (used_hash) { - l = l1->h->data; - r = l2->h->data; + l = n1->data; + r = n2->data; + n1 = n1->next; + n2 = n2->next; res = stmt_join(be, l, r, 0, cmp_op); } else { /* need hash */ l = join_hash_key(be, l1); @@ -1610,22 +1613,6 @@ releqjoin_( backend *be, list *l1, list } if (need_left) res->flag = cmp_left; - - return res; -} - -static stmt * -releqjoin( backend *be, list *l1, list *l2, int used_hash, comp_type cmp_op, int need_left ) -{ - mvc *sql = be->mvc; - node *n1 = l1->h, *n2 = l2->h; - stmt *l, *r, *res; - - if (used_hash) { - n1 = n1->next; - n2 = n2->next; - } - res = releqjoin_(be, l1, l2, used_hash, cmp_op, need_left); l = stmt_result(be, res, 0); r = stmt_result(be, res, 1); for (; n1 && n2; n1 = n1->next, n2 = n2->next) { @@ -4801,20 +4788,49 @@ rel2bin_graph(backend *be, sql_rel* rel, } // join the attributes - join_left = releqjoin_(be, lhs, domain_list, /*used_hash = */ false, cmp_equal, /* need_left = */ rel->op == op_graph_select); - join_right = releqjoin_(be, rhs, domain_list, /*used_hash = */ false, cmp_equal, /* need_left = */ rel->op == op_graph_select); - - // generate the query parameters - lst1 = sa_list(sql->sa); - list_append(lst1, void2oid(stmt_result(be, join_left, 0))); - list_append(lst1, void2oid(stmt_result(be, join_right, 0))); - list_append(lst1, void2oid(stmt_result(be, join_left, 1))); - list_append(lst1, void2oid(stmt_result(be, join_right, 1))); - query = stmt_list(be, lst1); lst1 = NULL; - - // remove the items that are not part of the domain + join_left = releqjoin(be, lhs, domain_list, /*used_hash = */ false, cmp_equal, /* need_left = */ false); + join_right = releqjoin(be, rhs, domain_list, /*used_hash = */ false, cmp_equal, /* need_left = */ false); + + + // intersect the two lists, so that we have only the columns part of the domain if(rel->op == op_graph_select){ - query = stmt_gr8_remove_nils(be, query); + stmt *jll = stmt_result(be, join_left, 0); + stmt *jlr = stmt_result(be, join_left, 1); + stmt *jrl = stmt_result(be, join_right, 0);
MonetDB: graph0 - CODEGEN: adapted (more or less) the previous i...
Changeset: 7d96bcc88e90 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7d96bcc88e90 Modified Files: sql/backends/monet5/rel_bin.c sql/backends/monet5/sql_statement.c sql/backends/monet5/sql_statement.h Branch: graph0 Log Message: CODEGEN: adapted (more or less) the previous implementation for the graph predicates diffs (truncated from 544 to 300 lines): diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c --- a/sql/backends/monet5/rel_bin.c +++ b/sql/backends/monet5/rel_bin.c @@ -24,6 +24,7 @@ static stmt * exp_bin(backend *be, sql_e static stmt * rel_bin(backend *be, sql_rel *rel); static stmt * subrel_bin(backend *be, sql_rel *rel, list *refs); + static stmt * refs_find_rel(list *refs, sql_rel *rel) { @@ -1584,11 +1585,10 @@ join_hash_key( backend *be, list *l ) return h; } + +// do not project the result back static stmt * -releqjoin( backend *be, list *l1, list *l2, int used_hash, comp_type cmp_op, int need_left ) -{ - mvc *sql = be->mvc; - node *n1 = l1->h, *n2 = l2->h; +releqjoin_( backend *be, list *l1, list *l2, int used_hash, comp_type cmp_op, int need_left ){ stmt *l, *r, *res; if (list_length(l1) <= 1) { @@ -1600,18 +1600,32 @@ releqjoin( backend *be, list *l1, list * return r; } if (used_hash) { - l = n1->data; - r = n2->data; - n1 = n1->next; - n2 = n2->next; + l = l1->h->data; + r = l2->h->data; res = stmt_join(be, l, r, 0, cmp_op); } else { /* need hash */ l = join_hash_key(be, l1); r = join_hash_key(be, l2); res = stmt_join(be, l, r, 0, cmp_op); } - if (need_left) + if (need_left) res->flag = cmp_left; + + return res; +} + +static stmt * +releqjoin( backend *be, list *l1, list *l2, int used_hash, comp_type cmp_op, int need_left ) +{ + mvc *sql = be->mvc; + node *n1 = l1->h, *n2 = l2->h; + stmt *l, *r, *res; + + if (used_hash) { + n1 = n1->next; + n2 = n2->next; + } + res = releqjoin_(be, l1, l2, used_hash, cmp_op, need_left); l = stmt_result(be, res, 0); r = stmt_result(be, res, 1); for (; n1 && n2; n1 = n1->next, n2 = n2->next) { @@ -4701,8 +4715,24 @@ rel2bin_ddl(backend *be, sql_rel *rel, l static stmt * rel2bin_graph(backend *be, sql_rel* rel, list *refs) { + mvc* sql = be->mvc; // query control block sql_graph* graph_ptr = (sql_graph*) rel; stmt *left = NULL, *right = NULL, *edges = NULL; // depending relations + stmt *codomain = NULL; // oids for the graph (vertices ids) + stmt *candidate_ids = NULL; + list *domain_list = sa_list(sql->sa); // the list of attributes that define the domain (A, B, ...) + stmt *edge_src = NULL, *edge_dst = NULL; // column of oids representing the src/dst of the edges + stmt *tmp1 = NULL; // temporary value + list *lst1 = NULL; // temporary list + int spfw_flags = 0; // spfw flags + stmt *query = NULL; // query parameters + stmt *weights = NULL; // input columns to generate the weights + stmt *spfw = NULL; // shortest path operator + + // avoid to deal with the virtual OIDs (VOID) type, they are just an + // optimisation, unlikely to be useful for the the edge tables but + // for more extreme cases +#define void2oid(statement) stmt_gr8_void2oid(be, statement) // first construct the depending relations left = subrel_bin(be, rel->l, refs); @@ -4714,9 +4744,143 @@ rel2bin_graph(backend *be, sql_rel* rel, edges = subrel_bin(be, graph_ptr->edges, refs); if(!edges) return NULL; // error - - - return NULL; + // find the co-domain (set) + // use the union of both of efrom & eto as list values for the co-domain + // alternatively iff there was a FK both efrom/eto to a PK somewhere else, we could have used that PK + assert(list_length(graph_ptr->efrom) > 0 && list_length(graph_ptr->efrom) == list_length(graph_ptr->eto)); + for(node *n = graph_ptr->efrom->h, *m = graph_ptr->eto->h; n && m; n = n->next, m = m->next){ + stmt *s0 = NULL, *s1 = NULL; // efrom, eto + stmt *values = NULL; // efrom U eto + stmt *groupby = NULL; + + s0 = exp_bin(be, n->data, edges, NULL, NULL, NULL, NULL, NULL); + if(!s0) return NULL; + s1 = exp_bin(be, m->data, edges, NULL, NULL, NULL, NULL, NULL); + if(!s1) return NULL; + values = stmt_gr8_concat(be, list_append(list_append(sa_list(sql->sa), s0), s1)); + list_append(domain_list, values); + + groupby = stmt_group(be, values, codomain, candidate_ids, NULL, !n->next); +
MonetDB: graph0 - CODEGEN: added the entry point for rel2bin
Changeset: 9659e25437cf for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9659e25437cf Modified Files: sql/backends/monet5/rel_bin.c Branch: graph0 Log Message: CODEGEN: added the entry point for rel2bin diffs (83 lines): diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c --- a/sql/backends/monet5/rel_bin.c +++ b/sql/backends/monet5/rel_bin.c @@ -4699,6 +4699,27 @@ rel2bin_ddl(backend *be, sql_rel *rel, l } static stmt * +rel2bin_graph(backend *be, sql_rel* rel, list *refs) +{ + sql_graph* graph_ptr = (sql_graph*) rel; + stmt *left = NULL, *right = NULL, *edges = NULL; // depending relations + + // first construct the depending relations + left = subrel_bin(be, rel->l, refs); + if(!left) return NULL; // error + if(rel->op == op_graph_join) { + right = subrel_bin(be, rel->r, refs); + if(!right) return NULL; // error + } + edges = subrel_bin(be, graph_ptr->edges, refs); + if(!edges) return NULL; // error + + + + return NULL; +} + +static stmt * subrel_bin(backend *be, sql_rel *rel, list *refs) { mvc *sql = be->mvc; @@ -4790,7 +4811,8 @@ subrel_bin(backend *be, sql_rel *rel, li break; case op_graph_join: case op_graph_select: - assert(0 && "Not implemented yet"); // TODO: not handled + s = rel2bin_graph(be, rel, refs); + break; } if (s && rel_is_ref(rel)) { list_append(refs, rel); @@ -4923,7 +4945,8 @@ exp_deps(sql_allocator *sa, sql_exp *e, } } break; case e_graph: - assert(0 && "Not implemented yet"); + return exps_deps(sa, e->l, refs, l) || exps_deps(sa, e->r, refs, l); + break; } return 0; } @@ -5034,8 +5057,21 @@ rel_deps(sql_allocator *sa, sql_rel *r, } break; case op_graph_join: - case op_graph_select: - assert(0 && "Not implemented yet"); // TODO: not handled + case op_graph_select: { + sql_graph* graph_ptr = (sql_graph*) r; + int rc = 0; + + // recurse on the sub tables + rc = rel_deps(sa, r->l, refs, l); + if(!rc) rc = rel_deps(sa, r->r, refs, l); + if(!rc) rc = rel_deps(sa, graph_ptr->edges, refs, l); + if(rc) return rc; // error + + // visit the depending expressions + exps_deps(sa, graph_ptr->efrom, refs, l); + exps_deps(sa, graph_ptr->eto, refs, l); + // no need to visit graph_ptr->spfw + } break; } if (r->exps) exps_deps(sa, r->exps, refs, l); @@ -5043,7 +5079,6 @@ rel_deps(sql_allocator *sa, sql_rel *r, exps_deps(sa, r->r, refs, l); if (rel_is_ref(r)) { list_append(refs, r); - list_append(refs, l); } return 0; } ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: graph0 - Handle replica / merge tables for the graph op...
Changeset: b40b2a3d947e for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b40b2a3d947e Modified Files: sql/server/rel_distribute.c sql/server/rel_partition.c sql/server/rel_rel.c Branch: graph0 Log Message: Handle replica / merge tables for the graph operators diffs (204 lines): diff --git a/sql/server/rel_distribute.c b/sql/server/rel_distribute.c --- a/sql/server/rel_distribute.c +++ b/sql/server/rel_distribute.c @@ -66,8 +66,11 @@ has_remote_or_replica( sql_rel *rel ) return 1; break; case op_graph_join: - case op_graph_select: - assert(0 && "Not implemented yet"); // TODO: not handled + case op_graph_select: { + sql_graph* graph_ptr = (sql_graph*) rel; + if (has_remote_or_replica(rel->l) || has_remote_or_replica(rel->r) || has_remote_or_replica(graph_ptr->edges)) + return 1; + } break; } return 0; } @@ -179,8 +182,12 @@ replica(mvc *sql, sql_rel *rel, char *ur rel->r = replica(sql, rel->r, uri); break; case op_graph_join: - case op_graph_select: - assert(0 && "Not implemented yet"); // TODO: not handled + case op_graph_select: { + sql_graph* graph_ptr = (sql_graph*) rel; + rel->l = replica(sql, rel->l, uri); + rel->r = replica(sql, rel->r, uri); + graph_ptr->edges = replica(sql, graph_ptr->edges, uri); + } break; } return rel; } @@ -277,8 +284,63 @@ distribute(mvc *sql, sql_rel *rel) rel->r = distribute(sql, rel->r); break; case op_graph_join: - case op_graph_select: - assert(0 && "Not implemented yet"); // TODO: not handled + case op_graph_select: { + sql_graph* graph_ptr = (sql_graph*) rel; + sql_rel* g = NULL; + prop* pg = NULL; + + // recursion + l = rel->l = distribute(sql, rel->l); + r = rel->r = distribute(sql, rel->r); + g = graph_ptr->edges = distribute(sql, graph_ptr->edges); + + pl = find_prop(l->p, PROP_REMOTE); + if(rel->op == op_graph_join) + pr = find_prop(r->p, PROP_REMOTE); + else + pr = NULL; + pg = find_prop(g->p, PROP_REMOTE); + + // replicas + if(pl) { + if(rel->op == op_graph_join && !pr) { + r = rel->r = distribute(sql, replica(sql, rel->r, pl->value)); + pr = find_prop(r->p, PROP_REMOTE); + } + if(!pg) { + g = graph_ptr->edges = distribute(sql, replica(sql, graph_ptr->edges, pl->value)); + pg = find_prop(g->p, PROP_REMOTE); + } + } else if(pr) { +// if(!pl) { + l = rel->l = distribute(sql, replica(sql, rel->l, pr->value)); + pl = find_prop(l->p, PROP_REMOTE); +// } + if(!pg) { + g = graph_ptr->edges = distribute(sql, replica(sql, graph_ptr->edges, pr->value)); + pg = find_prop(g->p, PROP_REMOTE); + } + } else if (pg) { + l = rel->l = distribute(sql, replica(sql, rel->l, pg->value)); + pl = find_prop(l->p, PROP_REMOTE); + if(rel->op == op_graph_join) { + r = rel->r = distribute(sql, replica(sql, rel->r, pg->value)); + pr = find_prop(r->p, PROP_REMOTE); + } + } + + // remove the property if all of them have the same uri + if (pl && pg && strcmp(pl->value, pg->value) == 0 && + (rel->op != op_graph_join || (pr && strcmp(pl->value, pr->value) == 0))){ + l->p = prop_remove(l->p, pl); + if(pr){ r->p = prop_remove(r->p, pr); } + g->p = prop_remove(g->p, pg); + + pl->p = rel->p; + rel->p = pl; + } + + } break; } return rel; } @@ -326,8 +388,12 @@ rel_remote_func(mvc *sql, sql_rel *rel) rel->r = rel_remote_func(sql, rel->r); break; case op_graph_join: - case op_graph_select: - assert(0 && "Not implemented yet"); // TODO: not handled + case op_graph_select: { + sql_graph* graph_ptr = (sql_graph*) rel; + rel->l = rel_remote_func(sql, rel->l); + rel->r =
MonetDB: graph0 - QRW: adapt the `rel_push_func_down' rule for t...
Changeset: de4f281c8d0a for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=de4f281c8d0a Modified Files: sql/include/sql_relation.h sql/server/rel_optimizer.c Branch: graph0 Log Message: QRW: adapt the `rel_push_func_down' rule for the graph op~ diffs (217 lines): diff --git a/sql/include/sql_relation.h b/sql/include/sql_relation.h --- a/sql/include/sql_relation.h +++ b/sql/include/sql_relation.h @@ -235,6 +235,8 @@ typedef enum operator_type { (is_select(op) || op == op_graph_select) #define is_extended_join(op) \ (is_join(op) || op == op_graph_join) +#define is_extended_joinop(op) \ + (is_joinop(op) || op == op_graph_join) /* NO NIL semantics of aggr operations */ #define need_no_nil(e) \ diff --git a/sql/server/rel_optimizer.c b/sql/server/rel_optimizer.c --- a/sql/server/rel_optimizer.c +++ b/sql/server/rel_optimizer.c @@ -1764,8 +1764,28 @@ can_push_func(sql_exp *e, sql_rel *rel, (*must) |= lmust; return res; } + case e_graph: { + list* ll = e->l; + list* lr = e->r; + int mustg = 0; + int result = 0; + + // lhs + for(node* n = ll->h; n; n = n->next){ + result |= can_push_func(n->data, rel, ); + *must |= mustg; + } + + // rhs + for(node* n = lr->h; n; n = n->next){ + result |= can_push_func(n->data, rel, ); + *must |= mustg; + } + + return result; + } break; case e_column: - if (rel && !rel_find_exp(rel, e)) + if (rel && !rel_find_exp(rel, e)) return 0; (*must) = 1; case e_atom: @@ -1783,15 +1803,18 @@ exps_can_push_func(list *exps, sql_rel * sql_exp *e = n->data; int must = 0, mustl = 0, mustr = 0; - if (is_joinop(rel->op) && ((can_push_func(e, rel->l, ) && mustl) || (can_push_func(e, rel->r, ) && mustr))) + if (is_extended_joinop(rel->op) && ((can_push_func(e, rel->l, ) && mustl) || (can_push_func(e, rel->r, ) && mustr))) return 1; - else if (is_select(rel->op) && can_push_func(e, NULL, ) && must) + else if (is_extended_select(rel->op) && can_push_func(e, NULL, ) && must) return 1; } return 0; } static int +exps_need_push_down( list *exps ); + +static int exp_needs_push_down(sql_exp *e) { if (!e) @@ -1806,6 +1829,8 @@ exp_needs_push_down(sql_exp *e) case e_aggr: case e_func: return 1; + case e_graph: + return exps_need_push_down(e->l) || exps_need_push_down(e->r); case e_column: case e_atom: default: @@ -1823,13 +1848,39 @@ exps_need_push_down( list *exps ) return 0; } +static sql_exp* +rel_push_func_down_graph_exp(int *changes, mvc *sql, sql_rel* subrel, sql_exp* e){ + sql_exp* ne = e; + int must = 0; + + assert(e->type != e_graph); + assert(subrel && is_project(subrel->op)); + + if (exp_needs_push_down(e) && can_push_func(e, subrel, ) && must){ + exp_label(sql->sa, e, ++sql->label); + list_append(subrel->exps, e); + ne = exp_column(sql->sa, exp_relname(e), exp_name(e), exp_subtype(e), e->card, has_nil(e), is_intern(e)); + (*changes)++; + } + + return ne; +} + +static void +rel_push_func_down_graph_list(int *changes, mvc *sql, sql_rel* subrel, list* l){ + if(subrel == NULL || l == NULL) return; + for(node *n = l->h; n; n = n->next){ + n->data = rel_push_func_down_graph_exp(changes, sql, subrel, n->data); + } +} + static sql_rel * rel_push_func_down(int *changes, mvc *sql, sql_rel *rel) { - if ((is_select(rel->op) || is_joinop(rel->op)) && rel->l && rel->exps && !(rel_is_ref(rel))) { + if ((is_select(rel->op) || is_joinop(rel->op) || is_graph(rel->op)) && rel->l && rel->exps && !(rel_is_ref(rel))) { list *exps = rel->exps; - if (is_select(rel->op) && list_length(rel->exps) <= 1) /* only push down when thats useful */ + if (is_select(rel->op) && list_length(rel->exps) <= 1) /* only push down when thats useful */ return rel; if (exps_can_push_func(exps, rel) && exps_need_push_down(exps)) { sql_rel *nrel; @@ -1845,7 +1896,7 @@ rel_push_func_down(int *changes, mvc *sq rel->l = l = rel_project(sql->sa, l, rel_projections(sql, l, NULL, 1, 1)); } - if (is_joinop(rel->op) && r->op != op_project) { + if
MonetDB: graph0 - QRW: DCE for the shortest path expressions
Changeset: b494a8d2cbc2 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b494a8d2cbc2 Modified Files: sql/server/rel_optimizer.c Branch: graph0 Log Message: QRW: DCE for the shortest path expressions diffs (234 lines): diff --git a/sql/server/rel_optimizer.c b/sql/server/rel_optimizer.c --- a/sql/server/rel_optimizer.c +++ b/sql/server/rel_optimizer.c @@ -349,7 +349,7 @@ get_relations(mvc *sql, sql_rel *rel, li get_relations(sql, r, rels); rel->l = NULL; rel->r = NULL; - rel_destroy(rel); + if(!is_graph(rel->op)) rel_destroy(rel); } else { rel = rel_join_order(sql, rel); append(rels, rel); @@ -5974,8 +5974,16 @@ exp_mark_used(sql_rel *subrel, sql_exp * case e_psm: e->used = 1; break; - case e_graph: - assert(0 && "Not implemented yet"); + case e_graph: { + // lhs + for(node* n = ((list*) e->l)->h; n; n = n->next){ + nr += exp_mark_used(subrel, n->data); + } + // rhs + for(node* n = ((list*) e->r)->h; n; n = n->next){ + nr += exp_mark_used(subrel, n->data); + } + } break; } if (ne) { ne->used = 1; @@ -6003,16 +6011,16 @@ positional_exps_mark_used( sql_rel *rel, } } -static void -exps_mark_used(sql_allocator *sa, sql_rel *rel, sql_rel *subrel) -{ +static int +exps_mark_used_(sql_allocator *sa, sql_rel *rel, sql_rel *subrel, list* exps_){ int nr = 0; - if (rel->exps) { + + if(exps_){ node *n; - int len = list_length(rel->exps), i; + int len = list_length(exps_), i; sql_exp **exps = SA_NEW_ARRAY(sa, sql_exp*, len); - for (n=rel->exps->h, i = 0; n; n = n->next, i++) + for (n=exps_->h, i = 0; n; n = n->next, i++) exps[i] = n->data; for (i = len-1; i >= 0; i--) { @@ -6025,6 +6033,15 @@ exps_mark_used(sql_allocator *sa, sql_re } } } + + return nr; +} + +static void +exps_mark_used(sql_allocator *sa, sql_rel *rel, sql_rel *subrel) +{ + int nr = exps_mark_used_(sa, rel, subrel, rel->exps); + /* for count/rank we need atleast one column */ if (!nr && (is_project(subrel->op) || is_base(subrel->op)) && subrel->exps->h) { sql_exp *e = subrel->exps->h->data; @@ -6082,6 +6099,11 @@ rel_used(sql_rel *rel) rel = rel->l; } else if (rel->op == op_table && rel->r) { exp_used(rel->r); + } else if(is_graph(rel->op)) { + sql_graph* graph_ptr = (sql_graph*) rel; + rel_used(rel->l); + rel_used(rel->r); + rel_used(graph_ptr->edges); } if (rel && rel->exps) { exps_used(rel->exps); @@ -6193,8 +6215,23 @@ rel_mark_used(mvc *sql, sql_rel *rel, in case op_apply: break; case op_graph_join: - case op_graph_select: - assert(0 && "Not implemented yet"); // TODO: not handled + case op_graph_select: { + sql_graph* graph_ptr = (sql_graph*) rel; + + // lhs and rhs as usual + exps_mark_used(sql->sa, rel, rel->l); + rel_mark_used(sql, rel->l, 0); + if(rel->r) { + assert(rel->op == op_graph_join); + exps_mark_used(sql->sa, rel, rel->r); + rel_mark_used(sql, rel->r, 0); + } + + // edges + exps_mark_used_(sql->sa, rel, graph_ptr->edges, graph_ptr->efrom); + exps_mark_used_(sql->sa, rel, graph_ptr->edges, graph_ptr->eto); + rel_mark_used(sql, graph_ptr->edges, 0); + } break; } } @@ -6302,21 +6339,52 @@ rel_remove_unused(mvc *sql, sql_rel *rel case op_ddl: return rel; case op_graph_join: - case op_graph_select: - assert(0 && "Not implemented yet"); // TODO: not handled + case op_graph_select: { + sql_graph* graph_ptr = (sql_graph*) rel; + bool needed = false; + + printf("remove unused\n"); + + // do we need to remove any of the attributes? + for(node* n = graph_ptr->spfw->h; n && !needed; n = n->next){ + sql_exp* e = n->data; + needed = !(e->used); + } + + if(needed) { // remove the unused attributes + list* exps = sa_list(sql->sa); + for(node* n = graph_ptr->spfw->h; n; n = n->next){ + sql_exp* e = n->data; +
MonetDB: graph0 - QRW: fix few bugs with the new join reordering...
Changeset: 0c5e51eea91d for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0c5e51eea91d Modified Files: sql/server/rel_exp.c sql/server/rel_exp.h sql/server/rel_graph.c sql/server/rel_optimizer.c Branch: graph0 Log Message: QRW: fix few bugs with the new join reordering algorithm for graphs diffs (269 lines): diff --git a/sql/server/rel_exp.c b/sql/server/rel_exp.c --- a/sql/server/rel_exp.c +++ b/sql/server/rel_exp.c @@ -1129,6 +1129,40 @@ rel_has_exps(sql_rel *rel, list *exps) return -1; } + +static bool +rel_has_exps2(sql_rel *rel, list* l){ + bool result = true; + + if(list_length(l) == 0) + return false; + + for(node* n = l->h; n && result; n = n->next){ + result &= rel_has_exp2(rel, n->data); + } + + return result; +} + +bool +rel_has_exp2(sql_rel *rel, sql_exp *e){ + if(!rel) return false; + if(!e) return true; + + switch(e->type){ + case e_cmp: + if (get_cmp(e) == cmp_filter) { + return rel_has_exps2(rel, e->l) && rel_has_exps2(rel, e->r); + } else { + return rel_has_exp2(rel, e->l) && rel_has_exp2(rel, e->r); + } + case e_graph: + return rel_has_exps2(rel, e->l) && rel_has_exps2(rel, e->r); + default: + return rel_find_exp(rel, e) != NULL; + } +} + sql_rel * find_rel(list *rels, sql_exp *e) { @@ -1211,8 +1245,9 @@ rel_find_exp_( sql_rel *rel, sql_exp *e) { sql_exp *ne = NULL; - if (!rel) + if (!rel) // stop the recursion return NULL; + switch(e->type) { case e_column: if (rel->exps && (is_project(rel->op) || is_base(rel->op))) { @@ -1222,6 +1257,11 @@ rel_find_exp_( sql_rel *rel, sql_exp *e) ne = exps_bind_column(rel->exps, e->r, NULL); } } + // check whether this is some kind of shortest path + else if (is_graph(rel->op) && e->l){ + sql_graph* graph_ptr = (sql_graph*) rel; + ne = exps_bind_column2(graph_ptr->spfw, e->l, e->r); + } return ne; case e_convert: return rel_find_exp_(rel, e->l); @@ -1288,13 +1328,6 @@ rel_find_exp( sql_rel *rel, sql_exp *e) break; case op_graph_join: case op_graph_select: { - assert(ne == NULL && "Expression already assigned?"); - // check whether this is some kind of shortest path - if(e->type == e_column){ - sql_graph* graph_ptr = (sql_graph*) rel; - ne = exps_bind_column2(graph_ptr->spfw, e->l, e->r); - } - // try with the lhs if(!ne) { ne = rel_find_exp(rel->l, e); } // and then with the rhs (ok for selects as well) diff --git a/sql/server/rel_exp.h b/sql/server/rel_exp.h --- a/sql/server/rel_exp.h +++ b/sql/server/rel_exp.h @@ -132,6 +132,9 @@ extern int rel_has_exp(sql_rel *rel, sql /* return 0 when the relation contain atleast one of the passed expressions else < 0 */ extern int rel_has_exps(sql_rel *rel, list *e); +// true if the dependency is satisfied, false otherwise +extern bool rel_has_exp2(sql_rel *rel, sql_exp *e); + extern sql_rel *find_rel(list *rels, sql_exp *e); extern sql_rel *find_one_rel(list *rels, sql_exp *e); diff --git a/sql/server/rel_graph.c b/sql/server/rel_graph.c --- a/sql/server/rel_graph.c +++ b/sql/server/rel_graph.c @@ -41,7 +41,7 @@ sql_graph* rel_graph_move(mvc* sql, sql_ graph_old = (sql_graph*) rel; graph_new = rel_graph_create(sql->sa); if(!graph_new) return NULL; - memcpy(graph_new + sizeof(sql_ref), graph_old + sizeof(sql_ref), sizeof(sql_graph) - sizeof(sql_ref)); + memcpy((char*) graph_new + sizeof(sql_ref), (char*) graph_old + sizeof(sql_ref), sizeof(sql_graph) - sizeof(sql_ref)); graph_rel = &(graph_new->relation); graph_rel->l = l; graph_rel->r = r; diff --git a/sql/server/rel_optimizer.c b/sql/server/rel_optimizer.c --- a/sql/server/rel_optimizer.c +++ b/sql/server/rel_optimizer.c @@ -425,21 +425,29 @@ exp_count(int *cnt, sql_exp *e) return 0; *cnt -= 5*list_length(e->l); return 5*list_length(e->l); - case e_graph: - if(exp_card(e->l) == CARD_ATOM && exp_card(e->r) == CARD_ATOM){ + case e_graph: { + // I do still wonder, why the heck I am using lists for the lhs and rhs of the e_graph expression + sql_exp* el = ((list*) (e->l))->h->data; + sql_exp* er = ((list*) (e->r))->h->data; + + if(exp_card(el)
MonetDB: graph0 - QRW: join reordering (WIP)
Changeset: 2b0a6451e0d6 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2b0a6451e0d6 Modified Files: sql/common/sql_hash.c sql/include/sql_hash.h sql/server/rel_exp.c sql/server/rel_graph.c sql/server/rel_graph.h sql/server/rel_optimizer.c sql/server/rel_rel.c sql/server/rel_rel.h Branch: graph0 Log Message: QRW: join reordering (WIP) Still need to ensure that join predicates are not moved upward when they depend on a graph operator diffs (truncated from 507 to 300 lines): diff --git a/sql/common/sql_hash.c b/sql/common/sql_hash.c --- a/sql/common/sql_hash.c +++ b/sql/common/sql_hash.c @@ -5,6 +5,8 @@ * * Copyright 1997 - July 2008 CWI, August 2008 - 2017 MonetDB B.V. */ +#include // uint64_t +#include // rand #include "monetdb_config.h" #include "sql_mem.h" @@ -81,3 +83,18 @@ hash_key(const char *k) h += (h << 15); return h; } + +//unsigned int +//hash_key_ptr(void* ptr) +//{ +// static uint64_t a = 0; +// static uint64_t b = 0; +// const uint64_t p = 2386660291; // prime number +// if(a == 0 && b == 0){ +// srand(time(NULL)); +// a = rand() +1; +// b = rand() +1; +// } +// +// return (unsigned int) (( a * ((uint64_t) ptr) + b ) % p); +//} diff --git a/sql/include/sql_hash.h b/sql/include/sql_hash.h --- a/sql/include/sql_hash.h +++ b/sql/include/sql_hash.h @@ -37,5 +37,6 @@ extern sql_hash_e *hash_add(sql_hash *ht extern void hash_del(sql_hash *ht, int key, void *value); extern unsigned int hash_key(const char *n); +//extern unsigned int hash_key_ptr(void* pointer); #endif /* SQL_STACK_H */ diff --git a/sql/server/rel_exp.c b/sql/server/rel_exp.c --- a/sql/server/rel_exp.c +++ b/sql/server/rel_exp.c @@ -1262,7 +1262,6 @@ rel_find_exp( sql_rel *rel, sql_exp *e) case op_full: case op_join: case op_apply: - case op_graph_join: ne = rel_find_exp(rel->l, e); if (!ne) ne = rel_find_exp(rel->r, e); @@ -1287,6 +1286,20 @@ rel_find_exp( sql_rel *rel, sql_exp *e) if (rel->exps && e->type == e_column && e->l) ne = exps_bind_column2(rel->exps, e->l, e->r); break; + case op_graph_join: + case op_graph_select: { + assert(ne == NULL && "Expression already assigned?"); + // check whether this is some kind of shortest path + if(e->type == e_column){ + sql_graph* graph_ptr = (sql_graph*) rel; + ne = exps_bind_column2(graph_ptr->spfw, e->l, e->r); + } + + // try with the lhs + if(!ne) { ne = rel_find_exp(rel->l, e); } + // and then with the rhs (ok for selects as well) + if(!ne) { ne = rel_find_exp(rel->r, e); } + } break; default: if (!is_project(rel->op) && rel->l) ne = rel_find_exp(rel->l, e); diff --git a/sql/server/rel_graph.c b/sql/server/rel_graph.c --- a/sql/server/rel_graph.c +++ b/sql/server/rel_graph.c @@ -15,8 +15,51 @@ #include "rel_exp.h" #include "rel_rel.h" #include "rel_select.h" +#include "sql_mem.h" // sql_ref_init #include "sql_relation.h" // rel_graph +/* + * * + * Create the graph operator * + * * + */ + +sql_graph* rel_graph_create(sql_allocator *sa) { + sql_graph *r = SA_NEW(sa, sql_graph); + if(!r) return NULL; + memset(r, 0, sizeof(sql_graph)); + sql_ref_init(&(r->relation.ref)); + return r; +} + +sql_graph* rel_graph_move(mvc* sql, sql_rel* rel, sql_rel* l, sql_rel* r, sql_exp* e){ + sql_graph* graph_old = NULL; + sql_graph* graph_new = NULL; + sql_rel* graph_rel = NULL; + + assert(rel && is_graph(rel->op)); + graph_old = (sql_graph*) rel; + graph_new = rel_graph_create(sql->sa); + if(!graph_new) return NULL; + memcpy(graph_new + sizeof(sql_ref), graph_old + sizeof(sql_ref), sizeof(sql_graph) - sizeof(sql_ref)); + graph_rel = &(graph_new->relation); + graph_rel->l = l; + graph_rel->r = r; + graph_rel->exps = new_exp_list(sql->sa); + list_append(graph_rel->exps, e); + + return graph_new; +} + +sql_rel* rel_graph_move2rel(mvc* sql, sql_rel* rel, sql_rel* l, sql_rel* r, sql_exp* e){ +
MonetDB: graph0 - QRW: join reordering WIP
Changeset: 06cabc5d5434 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=06cabc5d5434 Modified Files: sql/server/rel_exp.c sql/server/rel_optimizer.c Branch: graph0 Log Message: QRW: join reordering WIP diffs (103 lines): diff --git a/sql/server/rel_exp.c b/sql/server/rel_exp.c --- a/sql/server/rel_exp.c +++ b/sql/server/rel_exp.c @@ -1187,6 +1187,9 @@ exp_is_join(sql_exp *e, list *rels) /* range expression */ if (e->type == e_cmp && !is_complex_exp(e->flag) && e->l && e->r && e->f && e->card >= CARD_AGGR && !complex_select(e)) return exp_is_rangejoin(e, rels); + /* graph join */ + if (e->type == e_graph) + return 0; return -1; } diff --git a/sql/server/rel_optimizer.c b/sql/server/rel_optimizer.c --- a/sql/server/rel_optimizer.c +++ b/sql/server/rel_optimizer.c @@ -406,8 +406,23 @@ exp_count(int *cnt, sql_exp *e) return 0; *cnt -= 5*list_length(e->l); return 5*list_length(e->l); + case e_graph: + if(exp_card(e->l) == CARD_ATOM && exp_card(e->r) == CARD_ATOM){ + *cnt += 1000; // this is going to result to a constant predicate TRUE or FALSE + } else { + exp_count(cnt, e->l); + exp_count(cnt, e->r); + if(exp_card(e->l) == CARD_ATOM || exp_card(e->r) == CARD_ATOM){ + // single shortest path + *cnt += 500; + } else { + // this is going to be expensive, many-to-many shortest paths + // do not change cnt + } + } + return 0; // the return value is ignored anyway case e_convert: - /* functions are more expensive, depending on the number of columns involved. */ + /* functions are more expensive, depending on the number of columns involved. */ if (e->card == CARD_ATOM) return 0; /* fall through */ @@ -595,9 +610,9 @@ order_join_expressions(mvc *sql, list *d sql_rel *l = find_rel(rels, e->l); sql_rel *r = find_rel(rels, e->r); - if (l && is_select(l->op) && l->exps) + if (l && (is_select(l->op) || l->op == op_graph_select) && l->exps) keys[i] += list_length(l->exps)*10 + exps_count(l->exps)*debug; - if (r && is_select(r->op) && r->exps) + if (r && (is_select(r->op) || r->op == op_graph_select) && r->exps) keys[i] += list_length(r->exps)*10 + exps_count(r->exps)*debug; } pos[i] = i; @@ -629,7 +644,7 @@ find_join_rels(list **L, list **R, list sql_exp *e = n->data; sql_rel *l = NULL, *r = NULL; - if (!is_complex_exp(e->flag)){ + if (e->type != e_cmp || !is_complex_exp(e->flag)){ l = find_rel(rels, e->l); r = find_rel(rels, e->r); } @@ -689,7 +704,7 @@ find_fk( mvc *sql, list *rels, list *exp sql_idx *idx = NULL; sql_exp *je = djn->data, *le = je->l, *re = je->r; - if (is_complex_exp(je->flag)) + if (je->type != e_cmp || is_complex_exp(je->flag)) break; if (!find_prop(je->p, PROP_JOINIDX)) { int swapped = 0; @@ -8660,9 +8675,6 @@ rel_graph_pda(int *changes, mvc *sql, sq if(rel_is_ref(target) || rel_is_ref(parent)) return rel; - // ref cnt - printf("[rel_graph_pda] cnt: %d\n", graph_rel->ref.refcnt); - // case 1 - try to push down through a join or another graph operator if(is_join(target->op) || is_graph(target->op)){ sql_rel* l = target->l; @@ -8752,7 +8764,7 @@ rel_graph_create_join(int *changes, mvc // if we did bind the lhs above, then we are guaranteed that the // rhs will bind as well. Otherwise we are in the case where - // the rule `rel_graph_pda' would have move this operator above + // the rule `rel_graph_pda' would have moved this operator above // this cross product. if(el){ sql_exp* ne = NULL; // construct the new e_graph expression (jic) @@ -9012,12 +9024,9 @@ static sql_rel * if (graph_operators){ rel = rewrite_topdown(sql, rel, rel_graph_pda, ); - printf("[Optimizer] rel_graph_pda: %s\n", dump_rel(sql, rel)); rel = rewrite_topdown(sql, rel, rel_graph_create_join, ); - printf("[Optimizer]
MonetDB: graph0 - QRW: transform graph_select(A x B) into graph_...
Changeset: 6a6069579c30 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6a6069579c30 Modified Files: sql/server/rel_graph.c sql/server/rel_optimizer.c sql/server/rel_rel.c sql/server/rel_rel.h Branch: graph0 Log Message: QRW: transform graph_select(A x B) into graph_join(A, B) diffs (truncated from 403 to 300 lines): diff --git a/sql/server/rel_graph.c b/sql/server/rel_graph.c --- a/sql/server/rel_graph.c +++ b/sql/server/rel_graph.c @@ -91,21 +91,14 @@ sql_rel* rel_graph_reaches(mvc *sql, sql if(!qto) return NULL; // cannot convert qto into the same type of eto // build the new operator graph join operator -graph_ptr = (sql_graph*) sa_alloc(sql->sa, sizeof(sql_graph)); +graph_ptr = rel_graph_create(sql->sa); if(!graph_ptr) { return sql_error(sql, 03, "Cannot allocate rel_graph"); } -memset(graph_ptr, 0, sizeof(sql_graph)); result = (sql_rel*) graph_ptr; -sql_ref_init(>ref); result->op = op_graph_select; result->l = rel; -exp_ptr = (sql_exp*) sa_alloc(sql->sa, sizeof(sql_exp)); +exp_ptr = exp_graph(sql, sa_list(sql->sa), sa_list(sql->sa)); if(!exp_ptr) { return sql_error(sql, 03, "Cannot allocate sql_exp [e_graph] "); } -memset(exp_ptr, 0, sizeof(sql_exp)); -exp_ptr->type = e_graph; -exp_ptr->card = CARD_MULTI; -exp_ptr->l = sa_list(sql->sa); list_append(exp_ptr->l, qfrom); -exp_ptr->r = sa_list(sql->sa); list_append(exp_ptr->r, qto); result->exps = sa_list(sql->sa); // by convention exps has to be a list, even it contains only one item list_append(result->exps, exp_ptr); diff --git a/sql/server/rel_optimizer.c b/sql/server/rel_optimizer.c --- a/sql/server/rel_optimizer.c +++ b/sql/server/rel_optimizer.c @@ -1364,8 +1364,14 @@ static sql_exp * case e_atom: case e_psm: return e; - case e_graph: - assert(0 && "Not implemented yet"); + case e_graph: { + list *lst1 = NULL, *lst2 = NULL; + lst1 = exps_push_down(sql, e->l, f, t); + if(list_empty(lst1)) return NULL; + lst2 = exps_push_down(sql, e->r, f, t); + if(list_empty(lst2)) return NULL; + return exp_graph(sql, lst1, lst2); + } break; } return NULL; } @@ -8435,7 +8441,6 @@ rel_apply_rewrite(int *changes, mvc *sql } if (rel->flag == APPLY_LOJ && r->op == op_select) { sql_rel *nr, *ns; - nr = rel_project(sql->sa, rel_dup(r), rel_projections(sql, r, NULL, 1, 1)); ns = rel_apply(sql, rel_dup(rel->l), nr, rel->exps, rel->flag); @@ -8629,6 +8634,168 @@ rel_apply_rewrite(int *changes, mvc *sql } static sql_rel * +rel_graph_pda(int *changes, mvc *sql, sql_rel *rel) +{ + sql_rel* graph_rel = rel; + sql_rel* parent = NULL; + sql_rel* target = NULL; + sql_exp* graph_pda = NULL; + + // only applies to op_graph_select + if(graph_rel->op != op_graph_select) { + return rel; + } + graph_pda = graph_rel->exps->h->data; + assert(graph_pda != NULL && "Interesting, here we have a graph select without a predicate..."); + assert(graph_pda->type == e_graph); + + target = parent = rel->l; + + // pass through selects + if(target->op == op_select){ + target = target->l; + } + + // do not cross references + if(rel_is_ref(target) || rel_is_ref(parent)) + return rel; + + // ref cnt + printf("[rel_graph_pda] cnt: %d\n", graph_rel->ref.refcnt); + + // case 1 - try to push down through a join or another graph operator + if(is_join(target->op) || is_graph(target->op)){ + sql_rel* l = target->l; + sql_rel* r = target->r; + sql_exp* ne = NULL; + bool pda_lhs = true; // otherwise go to the right + + // can we push down to the lhs or rhs of the join? + bool left = r->op == op_join || r->op == op_left || r->op == op_graph_join || r->op == op_graph_select; + bool right = r->op == op_join || r->op == op_right || r->op == op_graph_join; + + // push down to the lhs + if (left){ + ne = exp_push_down(sql, graph_pda, l, l); + } + // try to push to the rhs + if (!ne && right) { + pda_lhs = false; + ne = exp_push_down(sql, graph_pda, r, r); + } + + // success? + if (ne) { + list_remove_node(graph_rel->exps, graph_rel->exps->h); + assert(list_empty(graph_rel->exps)); + list_append(graph_rel->exps, ne); + + // reshape the tree + if (pda_lhs){ +
MonetDB: graph0 - SEMA: Shortest path expressions
Changeset: 8ce24c675b2c for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8ce24c675b2c Modified Files: sql/server/rel_dump.c sql/server/rel_dump.h sql/server/rel_exp.c sql/server/rel_exp.h sql/server/rel_graph.c sql/server/rel_graph.h sql/server/rel_optimizer.c sql/server/rel_rel.c sql/server/sql_parser.y sql/server/sql_scan.c Branch: graph0 Log Message: SEMA: Shortest path expressions diffs (truncated from 422 to 300 lines): diff --git a/sql/server/rel_dump.c b/sql/server/rel_dump.c --- a/sql/server/rel_dump.c +++ b/sql/server/rel_dump.c @@ -1410,3 +1410,47 @@ rel_read(mvc *sql, char *r, int *pos, li return rel; } + +// DEBUG ONLY -- copy & paste from sql_gencode.c + decorate = TRUE +str +dump_rel( mvc *sql, sql_rel *rel) +{ + buffer *b; + stream *s = buffer_wastream(b = buffer_create(1024), "rel_dump"); + list *refs = sa_list(sql->sa); + char *res = NULL; + + rel_print_refs(sql, s, rel, 0, refs, TRUE); + rel_print_(sql, s, rel, 0, refs, TRUE); + mnstr_printf(s, "\n"); + res = buffer_get_buf(b); + buffer_destroy(b); + mnstr_destroy(s); + return res; +} + +str +dump_exps(mvc *sql, list *exps ){ + buffer *b; + stream *s = buffer_wastream(b = buffer_create(1024), "rel_dump"); + char *res = NULL; + + exps_print(sql, s, exps, 0, /*alias=*/ 1, /*brackets=*/0); + mnstr_printf(s, "\n"); + res = buffer_get_buf(b); + buffer_destroy(b); + mnstr_destroy(s); + return res; +} + +str +dump(mvc *sql, void* data){ + typedef struct { int32_t x; int32_t y; } T; + T* tmp = (T*) data; + if(tmp->x < 10 /*arbitrary value*/ && tmp->y <= op_delete){ + return dump_rel(sql, data); + } else { + return dump_exps(sql, data); + } +} + diff --git a/sql/server/rel_dump.h b/sql/server/rel_dump.h --- a/sql/server/rel_dump.h +++ b/sql/server/rel_dump.h @@ -19,4 +19,9 @@ extern const char *op2string(operator_ty extern sql_rel *rel_read(mvc *sql, char *ra, int *pos, list *refs); +// DEBUG ONLY +extern str dump_rel(mvc *sql, sql_rel *rel); +extern str dump_exps(mvc *sql, list *exps); +extern str dump(mvc *sql, void* data); + #endif /*_REL_DUMP_H_*/ diff --git a/sql/server/rel_exp.c b/sql/server/rel_exp.c --- a/sql/server/rel_exp.c +++ b/sql/server/rel_exp.c @@ -993,6 +993,14 @@ exp_match_exp( sql_exp *e1, sql_exp *e2) return 0; } +int +exp_match_exp_cmp( sql_exp *e1, sql_exp *e2) +{ + if (exp_match_exp(e1,e2)) + return 0; + return -1; +} + static int exps_are_joins( list *l ) { diff --git a/sql/server/rel_exp.h b/sql/server/rel_exp.h --- a/sql/server/rel_exp.h +++ b/sql/server/rel_exp.h @@ -112,6 +112,7 @@ extern int exp_equal( sql_exp *e1, sql_e extern int exp_refers( sql_exp *p, sql_exp *c); extern int exp_match( sql_exp *e1, sql_exp *e2); extern int exp_match_exp( sql_exp *e1, sql_exp *e2); +extern int exp_match_exp_cmp( sql_exp *e1, sql_exp *e2); /* match just the column (cmp equality) expressions */ extern int exp_match_col_exps( sql_exp *e, list *l); extern int exps_match_col_exps( sql_exp *e1, sql_exp *e2); diff --git a/sql/server/rel_graph.c b/sql/server/rel_graph.c --- a/sql/server/rel_graph.c +++ b/sql/server/rel_graph.c @@ -17,46 +17,10 @@ #include "rel_select.h" #include "sql_relation.h" // rel_graph -// DEBUG ONLY -- copy & paste from sql_gencode.c + decorate = TRUE -str -rel2str1( mvc *sql, sql_rel *rel) -{ - buffer *b; - stream *s = buffer_wastream(b = buffer_create(1024), "rel_dump"); - list *refs = sa_list(sql->sa); - char *res = NULL; - - rel_print_refs(sql, s, rel, 0, refs, TRUE); - rel_print_(sql, s, rel, 0, refs, TRUE); - mnstr_printf(s, "\n"); - res = buffer_get_buf(b); - buffer_destroy(b); - mnstr_destroy(s); - return res; -} - - -str -exps2str(mvc *sql, list *exps ){ - buffer *b; - stream *s = buffer_wastream(b = buffer_create(1024), "rel_dump"); - - char *res = NULL; - - exps_print(sql, s, exps, 0, /*alias=*/ 1, /*brackets=*/0); - mnstr_printf(s, "\n"); - res = buffer_get_buf(b); - buffer_destroy(b); - mnstr_destroy(s); - return res; -} - - sql_rel* rel_graph_reaches(mvc *sql, sql_rel *rel, symbol *sq, int context){ // TODO handle edge components defined with multiple attributes // this needs changes in the parser to accept list of columns & scalars - dnode* lstoperands = NULL; // temp to navigate over the operands symbol* sym_qfrom = NULL; // the `from' column in the ast symbol* sym_qto = NULL; // the `to' column in the ast @@ -81,7 +45,7 @@ sql_rel* rel_graph_reaches(mvc *sql, sql sql->caching = false; // let's see what we have got so far -printf("[Semantic analysis] Input relation: %s", rel2str1(sql,
MonetDB: graph0 - Reintroduce the semantic for the shortest path
Changeset: 98a41b22d000 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=98a41b22d000 Modified Files: sql/server/rel_dump.c sql/server/rel_dump.h sql/server/rel_exp.c sql/server/rel_graph.c sql/server/rel_graph.h sql/server/rel_select.c Branch: graph0 Log Message: Reintroduce the semantic for the shortest path diffs (truncated from 439 to 300 lines): diff --git a/sql/server/rel_dump.c b/sql/server/rel_dump.c --- a/sql/server/rel_dump.c +++ b/sql/server/rel_dump.c @@ -64,8 +64,6 @@ cmp_print(mvc *sql, stream *fout, int cm mnstr_printf(fout, " %s ", r); } -static void exps_print(mvc *sql, stream *fout, list *exps, int depth, int alias, int brackets); - static void exp_print(mvc *sql, stream *fout, sql_exp *e, int depth, int comma, int alias) { @@ -237,7 +235,7 @@ exp_print(mvc *sql, stream *fout, sql_ex mnstr_printf(fout, ", "); } -static void +void exps_print(mvc *sql, stream *fout, list *exps, int depth, int alias, int brackets) { node *en; @@ -547,6 +545,9 @@ rel_print_(mvc *sql, stream *fout, sql_ exps_print(sql, fout, graph_ptr->efrom, depth, 1, 0); mnstr_printf(fout, ", dst:"); exps_print(sql, fout, graph_ptr->eto, depth, 1, 0); + print_indent(sql, fout, depth, decorate); + mnstr_printf(fout, "shortest paths: "); + exps_print(sql, fout, graph_ptr->spfw, depth, 1, 1); } break; default: assert(0); diff --git a/sql/server/rel_dump.h b/sql/server/rel_dump.h --- a/sql/server/rel_dump.h +++ b/sql/server/rel_dump.h @@ -14,6 +14,7 @@ extern void rel_print_(mvc *sql, stream *fout, sql_rel *rel, int depth, list *refs, int decorate); extern void rel_print_refs(mvc *sql, stream* fout, sql_rel *rel, int depth, list *refs, int decorate); +extern void exps_print(mvc *sql, stream *fout, list *exps, int depth, int alias, int brackets); extern const char *op2string(operator_type op); extern sql_rel *rel_read(mvc *sql, char *ra, int *pos, list *refs); diff --git a/sql/server/rel_exp.c b/sql/server/rel_exp.c --- a/sql/server/rel_exp.c +++ b/sql/server/rel_exp.c @@ -984,7 +984,8 @@ exp_match_exp( sql_exp *e1, sql_exp *e2) return 1; break; case e_graph: - assert(0 && "Not implemented yet"); + assert(0 && "This should not be necessary"); + return exp_match_exp(e1->l, e2->l) && exp_match_exp(e1->r, e2->r); default: break; } diff --git a/sql/server/rel_graph.c b/sql/server/rel_graph.c --- a/sql/server/rel_graph.c +++ b/sql/server/rel_graph.c @@ -36,6 +36,22 @@ rel2str1( mvc *sql, sql_rel *rel) } +str +exps2str(mvc *sql, list *exps ){ + buffer *b; + stream *s = buffer_wastream(b = buffer_create(1024), "rel_dump"); + + char *res = NULL; + + exps_print(sql, s, exps, 0, /*alias=*/ 1, /*brackets=*/0); + mnstr_printf(s, "\n"); + res = buffer_get_buf(b); + buffer_destroy(b); + mnstr_destroy(s); + return res; +} + + sql_rel* rel_graph_reaches(mvc *sql, sql_rel *rel, symbol *sq, int context){ // TODO handle edge components defined with multiple attributes // this needs changes in the parser to accept list of columns & scalars @@ -150,155 +166,193 @@ sql_rel* rel_graph_reaches(mvc *sql, sql * * */ -//static bool error_reported(mvc* sql){ return (sql->session->status < 0); } -// -//static sql_exp* bindg_ret(mvc *sql, sql_exp* bind1, sql_exp* bind2){ -//if (error_reported(sql)){ // an error already occurred -//return NULL; -//} else if(bind1 && bind2){ -//return sql_error(sql, ERR_AMBIGUOUS, "Ambiguous expression for CHEAPEST SUM: %s, %s", exp_name(bind1), exp_name(bind2)); -//} else if(bind1){ -//return bind1; -//} else { -//return bind2; // either if it has a value or it is null */ -//} -//} +static bool error_reported(mvc* sql){ return (sql->session->status < 0); } + +static sql_exp* bind_cheapest_sum_return(mvc *sql, sql_exp* bind1, sql_exp* bind2){ + if (error_reported(sql)){ // an error already occurred + return NULL; + } else if(bind1 && bind2){ + return sql_error(sql, ERR_AMBIGUOUS, "Ambiguous expression for CHEAPEST SUM: %s, %s", exp_name(bind1), exp_name(bind2)); + } else if(bind1){ + return bind1; + } else { + return bind2; // either if it has a value or it is null */ + } +} // //static sql_exp* bindg_filter_graph(mvc *sql, sql_exp *exp, dlist *parse_tree){ -//
MonetDB: graph0 - QRW: distinct_join_exps
Changeset: 2424f60e5ef5 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2424f60e5ef5 Modified Files: sql/server/rel_optimizer.c Branch: graph0 Log Message: QRW: distinct_join_exps diffs (56 lines): diff --git a/sql/server/rel_optimizer.c b/sql/server/rel_optimizer.c --- a/sql/server/rel_optimizer.c +++ b/sql/server/rel_optimizer.c @@ -615,6 +615,7 @@ order_join_expressions(mvc *sql, list *d return res; } +// returns 0 if |exps| > 1 static int find_join_rels(list **L, list **R, list *exps, list *rels) { @@ -656,7 +657,7 @@ distinct_join_exps(list *aje, list *lrel for(n = lrels->h, m = rrels->h, j = 0; n && m; n = n->next, m = m->next, j++) { if (n->data && m->data) - for(o = n->next, p = m->next, i = j+1; o && p; + for(o = n->next, p = m->next, i = j+1; o && p; o = o->next, p = p->next, i++) { if (o->data == n->data && p->data == m->data) used[i] = 1; @@ -1045,7 +1046,7 @@ reorder_join(mvc *sql, sql_rel *rel) if (rel->op == op_join) rel->exps = push_up_join_exps(sql, rel); - exps = rel->exps; + exps = rel->exps; if (!exps) /* crosstable, ie order not important */ return rel; rel->exps = NULL; /* should be all crosstables by now */ @@ -1118,9 +1119,12 @@ rel_join_order(mvc *sql, sql_rel *rel) rel->l = rel_join_order(sql, rel->l); rel->r = rel_join_order(sql, rel->r); break; + case op_graph_select: + rel->l = rel_join_order(sql, rel->l); + break; case op_graph_join: - case op_graph_select: - assert(0 && "Not implemented yet"); // TODO: not handled + // nop, jump to reorder_join + break; } if (is_join(rel->op) && rel->exps && !rel_is_ref(rel)) { rel = rewrite(sql, rel, _remove_empty_select, _changes); @@ -4606,9 +4610,9 @@ rel_remove_empty_join(mvc *sql, sql_rel return rel_inplace_project(sql->sa, rel, rel_dup(l), rel->exps); } } else if ((is_project(rel->op) || is_topn(rel->op) || is_select(rel->op) - || is_sample(rel->op)) && rel->l) { + || is_sample(rel->op) || rel->op == op_graph_select) && rel->l) { rel->l = rel_remove_empty_join(sql, rel->l, changes); - } else if (is_join(rel->op)) { + } else if (is_join(rel->op) || rel->op == op_graph_join) { rel->l = rel_remove_empty_join(sql, rel->l, changes); rel->r = rel_remove_empty_join(sql, rel->r, changes); } ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: graph0 - QRW: name_find_column
Changeset: 3c3fd42d875d for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3c3fd42d875d Modified Files: sql/server/rel_exp.c sql/server/rel_optimizer.c Branch: graph0 Log Message: QRW: name_find_column diffs (44 lines): diff --git a/sql/server/rel_exp.c b/sql/server/rel_exp.c --- a/sql/server/rel_exp.c +++ b/sql/server/rel_exp.c @@ -1818,9 +1818,9 @@ exp_copy( sql_allocator *sa, sql_exp * e break; case e_graph: ne = exp_create(sa, e_graph); + memcpy(ne, e, sizeof(sql_exp)); ne->l = exps_copy(sa, e->l); ne->r = exps_copy(sa, e->r); - ne->card = CARD_ATOM; break; } if (!ne) diff --git a/sql/server/rel_optimizer.c b/sql/server/rel_optimizer.c --- a/sql/server/rel_optimizer.c +++ b/sql/server/rel_optimizer.c @@ -158,7 +158,16 @@ name_find_column( sql_rel *rel, char *rn break; case op_graph_join: case op_graph_select: - assert(0 && "Not implemented yet"); // TODO: not handled + // here we are looking for the physical columns, ignore the shortest paths + // first attempt, left relation + if(!c) { c = name_find_column(rel->l, rname, name, pnr, bt); } + + // second attempt, right relation in case of join + if(!c && rel->r ) { + assert(rel->op == op_graph_join); + c = name_find_column(rel->r, rname, name, pnr, bt); + } + break; } if (alias) { /* we found an expression with the correct name, but we need sql_columns */ @@ -4860,7 +4869,7 @@ rel_reduce_groupby_exps(int *changes, mv } } } - if (cnr && nr && list_length(tbls[j]->pkey->k.columns) == nr) { + if (cnr && nr && list_length(tbls[j]->pkey->k.columns) == nr /*=all*/) { list *ngbe = new_exp_list(sql->sa); list *exps = rel->exps, *nexps = new_exp_list(sql->sa); ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: graph0 - Additional comments (ignore me)
Changeset: f57634842de8 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f57634842de8 Modified Files: sql/server/rel_exp.c sql/server/rel_optimizer.c Branch: graph0 Log Message: Additional comments (ignore me) diffs (48 lines): diff --git a/sql/server/rel_exp.c b/sql/server/rel_exp.c --- a/sql/server/rel_exp.c +++ b/sql/server/rel_exp.c @@ -1017,6 +1017,7 @@ exp_is_join_exp(sql_exp *e) return -1; } +// ignore for graphs, current code path can invoke it only on exp_is_join() when e->type == e_cmp static int exp_is_complex_select( sql_exp *e ) { @@ -1097,6 +1098,7 @@ distinct_rel(sql_exp *e, const char **rn return 0; } +// So -1 means no and 0 = yes int rel_has_exp(sql_rel *rel, sql_exp *e) { @@ -1162,6 +1164,7 @@ exp_is_rangejoin(sql_exp *e, list *rels) return -1; } +// here 0 = true, -1 = false int exp_is_join(sql_exp *e, list *rels) { @@ -1229,6 +1232,7 @@ rel_find_exp_( sql_rel *rel, sql_exp *e) case e_atom: return e; case e_graph: + // Check: this code path seems to be used to find the generator of an expression return NULL; } return ne; diff --git a/sql/server/rel_optimizer.c b/sql/server/rel_optimizer.c --- a/sql/server/rel_optimizer.c +++ b/sql/server/rel_optimizer.c @@ -8815,7 +8815,9 @@ static sql_rel * /* rewrite semijoin (A, join(A,B)) into semijoin (A,B) */ rel = rewrite(sql, rel, _rewrite_semijoin, ); /* push semijoin through join */ + if(level == 0) printf("Optimizer rel_reduce_casts [before]: %s", rel2str1(sql, rel)); rel = rewrite(sql, rel, _push_semijoin_down, ); + if(level == 0) printf("Optimizer rel_push_semijoin_down [after]: %s", rel2str1(sql, rel)); /* antijoin(a, union(b,c)) -> antijoin(antijoin(a,b), c) */ rel = rewrite(sql, rel, _rewrite_antijoin, ); if (level <= 0) ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: graph0 - QRW: handle push down for selects
Changeset: 81b3ccc3f7ce for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=81b3ccc3f7ce Modified Files: sql/include/sql_relation.h sql/server/rel_dump.c sql/server/rel_graph.c sql/server/rel_optimizer.c sql/server/rel_rel.c Branch: graph0 Log Message: QRW: handle push down for selects diffs (218 lines): diff --git a/sql/include/sql_relation.h b/sql/include/sql_relation.h --- a/sql/include/sql_relation.h +++ b/sql/include/sql_relation.h @@ -230,7 +230,7 @@ typedef enum operator_type { #define is_sample(op) \ (op == op_sample) #define is_graph(op) \ - (op == op_graph_join || op_graph_select) + (op == op_graph_join || op == op_graph_select) /* NO NIL semantics of aggr operations */ #define need_no_nil(e) \ diff --git a/sql/server/rel_dump.c b/sql/server/rel_dump.c --- a/sql/server/rel_dump.c +++ b/sql/server/rel_dump.c @@ -514,7 +514,8 @@ rel_print_(mvc *sql, stream *fout, sql_ if (rel->exps) exps_print(sql, fout, rel->exps, depth, 1, 0); } break; - case op_graph_join: { + case op_graph_join: + case op_graph_select: { sql_graph *graph_ptr = (sql_graph*) rel; print_indent(sql, fout, depth, decorate); mnstr_printf(fout, "%s", op2string(rel->op)); @@ -525,6 +526,7 @@ rel_print_(mvc *sql, stream *fout, sql_ } else rel_print_(sql, fout, rel->l, depth+1, refs, decorate); if (rel->r) { + assert(rel->op == op_graph_join && "Expected join semantics when a rhs is present"); if (rel_is_ref(rel->r)) { int nr = find_ref(refs, rel->r); print_indent(sql, fout, depth+1, decorate); diff --git a/sql/server/rel_graph.c b/sql/server/rel_graph.c --- a/sql/server/rel_graph.c +++ b/sql/server/rel_graph.c @@ -78,7 +78,7 @@ sql_rel* rel_graph_reaches(mvc *sql, sql if(!qto) return NULL; // cannot refer to qto // TODO: to be handled with graph_select if(qfrom->card != CARD_MULTI || qto->card != CARD_MULTI){ - return sql_error(sql, 42, "["__FILE__ ":%d] select/filter syntax not implemented yet", __LINE__); + return sql_error(sql, 42, "["__FILE__ ":%d] select/filter semantic not allowed for the time being", __LINE__); } // edges table @@ -141,7 +141,7 @@ sql_rel* rel_graph_reaches(mvc *sql, sql // let us see if what we are creating makes sense printf("[Semantic analysis] Output relation: %s\n", rel2str1(sql, result)); -return rel; +return result; } /* diff --git a/sql/server/rel_optimizer.c b/sql/server/rel_optimizer.c --- a/sql/server/rel_optimizer.c +++ b/sql/server/rel_optimizer.c @@ -3912,13 +3912,13 @@ rel_push_select_down(int *changes, mvc * r && r->op == op_project && !(rel_is_ref(r))) return rel_merge_projects(changes, sql, rel); - /* push select through join */ - if (is_select(rel->op) && r && (is_join(r->op) || is_apply(r->op)) && !(rel_is_ref(r))) { + /* push select through graph/join */ + if (is_select(rel->op) && r && (is_join(r->op) || is_graph(r->op) || is_apply(r->op)) && !(rel_is_ref(r))) { sql_rel *jl = r->l; sql_rel *jr = r->r; // booleans, can we push down in the lhs and rhs? - int left = r->op == op_join || r->op == op_left; - int right = r->op == op_join || r->op == op_right; + int left = r->op == op_join || r->op == op_left || is_graph(r->op); + int right = r->op == op_join || r->op == op_right || r->op == op_graph_join; if (is_apply(r->op)) { left = right = 1; @@ -3930,10 +3930,10 @@ rel_push_select_down(int *changes, mvc * /* introduce selects under the join (if needed) */ set_processed(jl); - set_processed(jr); + if(jr) set_processed(jr); if (!is_select(jl->op)) r->l = jl = rel_select(sql->sa, jl, NULL); - if (!is_select(jr->op)) + if (jr && !is_select(jr->op)) r->r = jr = rel_select(sql->sa, jr, NULL); rel->exps = new_exp_list(sql->sa); @@ -4074,7 +4074,7 @@ rel_remove_empty_select(int *changes, mv { (void)sql; - if ((is_join(rel->op) || is_semi(rel->op) || is_select(rel->op) || is_project(rel->op) || is_topn(rel->op) || is_sample(rel->op)) && rel->l) { + if ((is_join(rel->op) || is_semi(rel->op) || is_select(rel->op) || is_project(rel->op) || is_topn(rel->op) || is_sample(rel->op) || is_graph(rel->op)) && rel->l) { sql_rel *l = rel->l; if (is_select(l->op)
MonetDB: graph0 - Split op_graph in op_graph_join and op_graph_s...
Changeset: 0f8f143a1df6 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0f8f143a1df6 Modified Files: sql/backends/monet5/rel_bin.c sql/include/sql_relation.h sql/server/rel_distribute.c sql/server/rel_dump.c sql/server/rel_exp.c sql/server/rel_graph.c sql/server/rel_optimizer.c sql/server/rel_partition.c sql/server/rel_rel.c sql/server/rel_select.c Branch: graph0 Log Message: Split op_graph in op_graph_join and op_graph_select diffs (truncated from 529 to 300 lines): diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c --- a/sql/backends/monet5/rel_bin.c +++ b/sql/backends/monet5/rel_bin.c @@ -1331,7 +1331,8 @@ rel2bin_args(backend *be, sql_rel *rel, case op_delete: args = rel2bin_args(be, rel->r, args); break; - case op_graph: + case op_graph_join: + case op_graph_select: assert(0 && "Not implemented yet"); // TODO: not handled } return args; @@ -4787,7 +4788,8 @@ subrel_bin(backend *be, sql_rel *rel, li case op_ddl: s = rel2bin_ddl(be, rel, refs); break; - case op_graph: + case op_graph_join: + case op_graph_select: assert(0 && "Not implemented yet"); // TODO: not handled } if (s && rel_is_ref(rel)) { @@ -5031,7 +5033,8 @@ rel_deps(sql_allocator *sa, sql_rel *r, exps_deps(sa, r->exps, refs, l); } break; - case op_graph: + case op_graph_join: + case op_graph_select: assert(0 && "Not implemented yet"); // TODO: not handled } if (r->exps) diff --git a/sql/include/sql_relation.h b/sql/include/sql_relation.h --- a/sql/include/sql_relation.h +++ b/sql/include/sql_relation.h @@ -160,7 +160,8 @@ typedef enum operator_type { op_groupby, op_topn, op_sample, - op_graph, + op_graph_join, + op_graph_select, op_insert, /* insert(l=table, r insert expressions) */ op_update, /* update(l=table, r update expressions) */ op_delete, /* delete(l=table, r delete expression) */ @@ -229,9 +230,7 @@ typedef enum operator_type { #define is_sample(op) \ (op == op_sample) #define is_graph(op) \ - (op == op_graph) -#define is_join_like(op) \ - (is_join(op) || is_graph(op)) + (op == op_graph_join || op_graph_select) /* NO NIL semantics of aggr operations */ #define need_no_nil(e) \ diff --git a/sql/server/rel_distribute.c b/sql/server/rel_distribute.c --- a/sql/server/rel_distribute.c +++ b/sql/server/rel_distribute.c @@ -65,7 +65,8 @@ has_remote_or_replica( sql_rel *rel ) if (rel->r && has_remote_or_replica( rel->r )) return 1; break; - case op_graph: + case op_graph_join: + case op_graph_select: assert(0 && "Not implemented yet"); // TODO: not handled } return 0; @@ -177,7 +178,8 @@ replica(mvc *sql, sql_rel *rel, char *ur case op_delete: rel->r = replica(sql, rel->r, uri); break; - case op_graph: + case op_graph_join: + case op_graph_select: assert(0 && "Not implemented yet"); // TODO: not handled } return rel; @@ -274,7 +276,8 @@ distribute(mvc *sql, sql_rel *rel) case op_delete: rel->r = distribute(sql, rel->r); break; - case op_graph: + case op_graph_join: + case op_graph_select: assert(0 && "Not implemented yet"); // TODO: not handled } return rel; @@ -322,7 +325,8 @@ rel_remote_func(mvc *sql, sql_rel *rel) case op_delete: rel->r = rel_remote_func(sql, rel->r); break; - case op_graph: + case op_graph_join: + case op_graph_select: assert(0 && "Not implemented yet"); // TODO: not handled } if (find_prop(rel->p, PROP_REMOTE) != NULL) { diff --git a/sql/server/rel_dump.c b/sql/server/rel_dump.c --- a/sql/server/rel_dump.c +++ b/sql/server/rel_dump.c @@ -294,8 +294,10 @@ op2string(operator_type op) case op_update: case op_delete: return "modify op"; - case op_graph: - return "graph"; + case op_graph_join: + return "graph/2"; + case op_graph_select: + return "graph/1"; default: return "unknown"; } @@ -512,10 +514,10 @@ rel_print_(mvc *sql, stream *fout, sql_ if (rel->exps) exps_print(sql, fout, rel->exps, depth, 1, 0); } break; - case op_graph: { + case op_graph_join: { sql_graph *graph_ptr = (sql_graph*) rel;
MonetDB: graph0 - Optimizer: up to rel_rewrite_types
Changeset: abe28d2d919e for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=abe28d2d919e Modified Files: sql/server/rel_optimizer.c sql/server/rel_rel.c Branch: graph0 Log Message: Optimizer: up to rel_rewrite_types diffs (40 lines): diff --git a/sql/server/rel_optimizer.c b/sql/server/rel_optimizer.c --- a/sql/server/rel_optimizer.c +++ b/sql/server/rel_optimizer.c @@ -8779,9 +8779,7 @@ static sql_rel * gp.cnt[op_select]) { rel = rewrite(sql, rel, _find_range, ); rel = rel_project_reduce_casts(, sql, rel); - printf("Optimizer rel_reduce_casts [before]: %s", rel2str1(sql, rel)); rel = rewrite(sql, rel, _reduce_casts, ); - printf("Optimizer rel_reduce_casts [after]: %s", rel2str1(sql, rel)); } if (gp.cnt[op_union]) @@ -8793,9 +8791,10 @@ static sql_rel * if (gp.cnt[op_project]) rel = rewrite(sql, rel, _project_cse, ); - rel = rewrite(sql, rel, _rewrite_types, ); + rel = rewrite(sql, rel, _rewrite_types, ); // dummy if (gp.cnt[op_anti] || gp.cnt[op_semi]) { + printf("Optimizer rel_reduce_casts [before]: %s", rel2str1(sql, rel)); /* rewrite semijoin (A, join(A,B)) into semijoin (A,B) */ rel = rewrite(sql, rel, _rewrite_semijoin, ); /* push semijoin through join */ diff --git a/sql/server/rel_rel.c b/sql/server/rel_rel.c --- a/sql/server/rel_rel.c +++ b/sql/server/rel_rel.c @@ -65,6 +65,11 @@ rel_destroy_(sql_rel *rel) } else if (is_modify(rel->op)) { if (rel->r) rel_destroy(rel->r); + } else if (is_graph(rel->op)){ + sql_graph* graph_ptr = (sql_graph*) rel; + rel_destroy(rel->l); + rel_destroy(rel->r); + rel_destroy(graph_ptr->edges); } } ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: graph0 - QRW: checked up to rel_project_reduce_casts
Changeset: 6e25dde32c0c for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6e25dde32c0c Modified Files: sql/server/rel_exp.c sql/server/rel_optimizer.c Branch: graph0 Log Message: QRW: checked up to rel_project_reduce_casts diffs (54 lines): diff --git a/sql/server/rel_exp.c b/sql/server/rel_exp.c --- a/sql/server/rel_exp.c +++ b/sql/server/rel_exp.c @@ -983,6 +983,8 @@ exp_match_exp( sql_exp *e1, sql_exp *e2) if (e1->l && e2->l && !atom_cmp(e1->l, e2->l)) return 1; break; + case e_graph: + assert(0 && "Not implemented yet"); default: break; } diff --git a/sql/server/rel_optimizer.c b/sql/server/rel_optimizer.c --- a/sql/server/rel_optimizer.c +++ b/sql/server/rel_optimizer.c @@ -5250,7 +5250,7 @@ exp_use_consts(mvc *sql, sql_exp *e, lis case e_psm: return e; case e_graph: - assert(0 && "Not implemented yet"); + assert(0 && "Invalid code path from the QRW rel_remove_join. It should not affect graph expressions"); } return NULL; } @@ -6722,7 +6722,7 @@ split_exp(mvc *sql, sql_exp *e, sql_rel case e_atom: return e; case e_graph: - assert(0 && "Not implemented yet"); + assert(0 && "Invalid expression of type graph. It should not appear here."); } return e; } @@ -8756,10 +8756,8 @@ static sql_rel * } } /* push (simple renaming) projections up */ - printf("Optimizer rel_push_project_up [before]: %s", rel2str1(sql, rel)); if (gp.cnt[op_project]) rel = rewrite(sql, rel, _push_project_up, ); - printf("Optimizer rel_push_project_up [after]: %s", rel2str1(sql, rel)); if (level <= 0 && (gp.cnt[op_project] || gp.cnt[op_groupby])) rel = rel_split_project(, sql, rel, 1); @@ -8781,7 +8779,9 @@ static sql_rel * gp.cnt[op_select]) { rel = rewrite(sql, rel, _find_range, ); rel = rel_project_reduce_casts(, sql, rel); + printf("Optimizer rel_reduce_casts [before]: %s", rel2str1(sql, rel)); rel = rewrite(sql, rel, _reduce_casts, ); + printf("Optimizer rel_reduce_casts [after]: %s", rel2str1(sql, rel)); } if (gp.cnt[op_union]) ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: graph0 - Starting to work on the optimizer
Changeset: bec155f92a89 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bec155f92a89 Modified Files: sql/backends/monet5/rel_bin.c sql/include/sql_relation.h sql/server/Makefile.ag sql/server/rel_dump.c sql/server/rel_exp.c sql/server/rel_exp.h sql/server/rel_graph.c sql/server/rel_graph.h sql/server/rel_optimizer.c sql/server/rel_planner.c sql/server/rel_rel.c sql/server/rel_select.c sql/server/sql_parser.y Branch: graph0 Log Message: Starting to work on the optimizer Up to rel_push_project_up diffs (truncated from 712 to 300 lines): diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c --- a/sql/backends/monet5/rel_bin.c +++ b/sql/backends/monet5/rel_bin.c @@ -1268,6 +1268,8 @@ exp2bin_args(backend *be, sql_exp *e, li list_append(args, s); } } + case e_graph: + assert(0 && "Not implemented yet"); } return args; } @@ -4918,6 +4920,8 @@ exp_deps(sql_allocator *sa, sql_exp *e, return exp_deps(sa, e->f, refs, l); } } break; + case e_graph: + assert(0 && "Not implemented yet"); } return 0; } diff --git a/sql/include/sql_relation.h b/sql/include/sql_relation.h --- a/sql/include/sql_relation.h +++ b/sql/include/sql_relation.h @@ -21,7 +21,8 @@ typedef enum expression_type { e_func, e_aggr, e_convert, - e_psm + e_psm, + e_graph, } expression_type; #define CARD_ATOM 1 @@ -140,8 +141,6 @@ typedef struct expression { #define DDL_EMPTY 100 -#define MAXOPS 21 - typedef enum operator_type { op_basetable = 0, op_table, @@ -161,12 +160,15 @@ typedef enum operator_type { op_groupby, op_topn, op_sample, + op_graph, op_insert, /* insert(l=table, r insert expressions) */ op_update, /* update(l=table, r update expressions) */ op_delete, /* delete(l=table, r delete expression) */ - op_graph, } operator_type; +// set to the last element of operator_type +#define MAXOPS ((int) op_delete +1) + #define is_atom(et) \ (et == e_atom) /* a simple atom is a literal or on the query stack */ @@ -228,6 +230,8 @@ typedef enum operator_type { (op == op_sample) #define is_graph(op) \ (op == op_graph) +#define is_join_like(op) \ + (is_join(op) || is_graph(op)) /* NO NIL semantics of aggr operations */ #define need_no_nil(e) \ @@ -303,8 +307,7 @@ typedef struct { sql_rel *edges; // edge table list *efrom; list *eto; - list *qfrom; - list *qto; + list *spfw; } sql_graph; #endif /* SQL_RELATION_H */ diff --git a/sql/server/Makefile.ag b/sql/server/Makefile.ag --- a/sql/server/Makefile.ag +++ b/sql/server/Makefile.ag @@ -49,7 +49,8 @@ lib_sqlserver = { rel_psm.c \ rel_xml.c \ rel_dump.c \ - rel_dump.h rel_exp.h rel_rel.h \ + rel_graph.c \ + rel_dump.h rel_graph.h rel_exp.h rel_rel.h \ rel_optimizer.h rel_partition.h rel_distribute.h rel_prop.h rel_schema.h rel_select.h \ rel_semantic.h rel_sequence.h rel_trans.h \ rel_updates.h rel_psm.h rel_xml.h sql_atom.h sql_datetime.h \ diff --git a/sql/server/rel_dump.c b/sql/server/rel_dump.c --- a/sql/server/rel_dump.c +++ b/sql/server/rel_dump.c @@ -204,6 +204,12 @@ exp_print(mvc *sql, stream *fout, sql_ex exp_print(sql, fout, e->r, depth+1, 0, 0); } break; + case e_graph: + exps_print(sql, fout, e->l, depth, alias, 1); + mnstr_printf(fout, " -> "); + exps_print(sql, fout, e->r, depth, alias, 1); + break; + default: ; } @@ -529,14 +535,13 @@ rel_print_(mvc *sql, stream *fout, sql_ print_indent(sql, fout, depth+1, decorate); mnstr_printf(fout, "& REF %d ", nr); } else { - rel_print_(sql, fout, rel->r, depth+1, refs, decorate); + rel_print_(sql, fout, graph_ptr->edges, depth+1, refs, decorate); } - exps_print(sql, fout, graph_ptr->qfrom, depth, 1, 0); - mnstr_printf(fout, " -> "); - exps_print(sql, fout, graph_ptr->qto, depth, 1, 0); - mnstr_printf(fout, ", src: "); + print_indent(sql, fout, depth, decorate); + exps_print(sql, fout, rel->exps, depth, 1, 0); + mnstr_printf(fout, ", src:"); exps_print(sql, fout, graph_ptr->efrom, depth, 1, 0); - mnstr_printf(fout,
MonetDB: graph0 - Exclude Eclipse files in .gitignore
Changeset: c92779ea8d6c for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c92779ea8d6c Modified Files: .gitignore Branch: graph0 Log Message: Exclude Eclipse files in .gitignore diffs (13 lines): diff --git a/.gitignore b/.gitignore --- a/.gitignore +++ b/.gitignore @@ -110,4 +110,9 @@ syntax: regexp ^java/target$ +# Eclipse +/.cproject +/.project +/.settings/ /build +/symbols.xml ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: graph0 - Merge parser changes
Changeset: 8d2db438489d for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8d2db438489d Modified Files: sql/server/sql_parser.h sql/server/sql_parser.y sql/server/sql_scan.c Branch: graph0 Log Message: Merge parser changes diffs (192 lines): diff --git a/sql/server/sql_parser.h b/sql/server/sql_parser.h --- a/sql/server/sql_parser.h +++ b/sql/server/sql_parser.h @@ -172,7 +172,9 @@ typedef enum tokens { SQL_XMLQUERY, SQL_XMLTEXT, SQL_XMLVALIDATE, - SQL_XMLNAMESPACES + SQL_XMLNAMESPACES, + SQL_GRAPH_REACHES, + SQL_GRAPH_CHEAPEST_SUM, } tokens; typedef enum jt { diff --git a/sql/server/sql_parser.y b/sql/server/sql_parser.y --- a/sql/server/sql_parser.y +++ b/sql/server/sql_parser.y @@ -297,6 +297,11 @@ int yydebug=1; XML_value_expression XML_primary opt_comma_string_value_expression +graph_reaches_exp +graph_reaches_column_def +graph_reaches_edges_table +graph_cheapest_sum +graph_cheapest_sum_arg %type data_type @@ -333,6 +338,7 @@ int yydebug=1; XML_namespace_prefix XML_PI_target function_body + aggr %type passwd_schema @@ -512,7 +518,7 @@ int yydebug=1; /* sql prefixes to avoid name clashes on various architectures */ %token - IDENT aTYPE ALIAS AGGR AGGR2 RANK sqlINT OIDNUM HEXADECIMAL INTNUM APPROXNUM + IDENT aTYPE ALIAS AGGR SUM AGGR2 RANK sqlINT OIDNUM HEXADECIMAL INTNUM APPROXNUM USING GLOBAL CAST CONVERT CHARACTER VARYING LARGE OBJECT VARCHAR CLOB sqlTEXT BINARY sqlBLOB @@ -558,6 +564,8 @@ int yydebug=1; %token XMLVALIDATE RETURNING LOCATION ID ACCORDING XMLSCHEMA URI XMLAGG %token FILTER +/* GRAPH tokens */ +%token CHEAPEST REACHES EDGE /* operators */ %left UNION EXCEPT INTERSECT CORRESPONDING UNIONJOIN @@ -3346,6 +3354,8 @@ predicate: | existence_test | filter_exp | scalar_exp + | graph_reaches_exp + | graph_cheapest_sum ; pred_exp: @@ -3791,6 +3801,56 @@ param: $$ = _symbol_create_int( SQL_PARAMETER, nr ); } +graph_reaches_exp: + graph_reaches_column_def REACHES graph_reaches_column_def OVER graph_reaches_edges_table EDGE '(' graph_reaches_column_def ',' graph_reaches_column_def ')' +{ +dlist *l = L(); +append_symbol(l, $1); +append_symbol(l, $3); +append_symbol(l, $5); +append_symbol(l, $8); +append_symbol(l, $10); +$$ = _symbol_create_list(SQL_GRAPH_REACHES, l); +} +; + +graph_reaches_column_def: +ident { $$ = _symbol_create_list( SQL_COLUMN, append_string(L(), $1)); } +| ident '.' ident { $$ = _symbol_create_list( SQL_COLUMN, append_string(append_string(L(), $1), $3)); } +; + +graph_reaches_edges_table: + qname opt_table_name + { + dlist *l = L(); + append_list(l, $1); + append_symbol(l, $2); + $$ = _symbol_create_list(SQL_NAME, l); +} +; + +graph_cheapest_sum_arg: +ident ':' scalar_exp +{ + dlist *l = L(); + append_string(l, $1); // opt_table_name_ref + append_symbol(l, $3); // weight expression + $$ = _symbol_create_list( SQL_GRAPH_CHEAPEST_SUM, l ); +} +| scalar_exp +{ + dlist *l = L(); + append_string(l, NULL); + append_symbol(l, $1); + $$ = _symbol_create_list( SQL_GRAPH_CHEAPEST_SUM, l ); +} +; + +graph_cheapest_sum: + CHEAPEST SUM '(' graph_cheapest_sum_arg ')' { $$ = $4; } +; + + /* ::= OVER @@ -4141,9 +4201,14 @@ qrank: append_string(L(), $1), $3);} ; +aggr: + AGGR + | SUM { $$ = sa_strdup(SA, "sum"); } + ; + qaggr: - AGGR{ $$ = append_string(L(), $1); } - | ident '.' AGGR { $$ = append_string( + aggr{ $$ = append_string(L(), $1); } + | ident '.' aggr { $$ = append_string( append_string(L(), $1), $3);} ; @@ -5162,7 +5227,7 @@ restricted_ident: IDENT { $$ = $1; } | aTYPE { $$ = $1; } | ALIAS { $$ = $1; } - | AGGR { $$ = $1; }/* without '(' */ + | aggr { $$ = $1; }/* without '(' */ | AGGR2 { $$ = $1; }/* without '(' */ | RANK { $$ = $1; }/* without '(' */ ; @@ -5172,7 +5237,7 @@ ident: | aTYPE { $$ = $1; } | FILTER_FUNC{ $$ = $1; } | ALIAS { $$ = $1; } - | AGGR { $$ = $1; }/* without '(' */ + | aggr { $$ = $1; }/* without '(' */ | AGGR2 { $$ = $1; }/* without '(' */ | RANK { $$ = $1; }/* without '(' */ | non_reserved_word diff --git a/sql/server/sql_scan.c b/sql/server/sql_scan.c --- a/sql/server/sql_scan.c +++ b/sql/server/sql_scan.c @@ -101,7 +101,7 @@ scanner_init_keywords(void) keywords_insert("AVG", AGGR); keywords_insert("MIN", AGGR); keywords_insert("MAX", AGGR); -
MonetDB: graph0 - Add .gitignore
Changeset: 523c623e2547 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=523c623e2547 Added Files: .gitignore Branch: graph0 Log Message: Add .gitignore diffs (118 lines): diff --git a/.gitignore b/.gitignore new file mode 100644 --- /dev/null +++ b/.gitignore @@ -0,0 +1,113 @@ +# Copy of .hgignore +#syntax: glob + +# This ignore file purposely does not cater for building in situ. We +# recommend that you build in a directory other than the source +# directory. + +# You can add files to the ignore list by creating your private ignore +# file in your .hg directory. Add these two lines to your .hg/hgrc +# file: +# [ui] +# ignore = /hgignore +# and create a file .hg/hgignore that contains your ignore patterns. + +# This file contains patterns of files that get generated by the +# recommended build process plus a few patterns of files that we never +# want in the repository (object files and such). + +# files generated by bootstrap +Makefile.am +Makefile.in +Makefile.msc +aclocal.m4 +acout.in +autom4te.cache +buildtools/conf/compile +buildtools/conf/config.guess +buildtools/conf/config.sub +buildtools/conf/install-sh +buildtools/conf/libtool.m4 +buildtools/conf/ltmain.sh +buildtools/conf/ltoptions.m4 +buildtools/conf/ltsugar.m4 +buildtools/conf/ltversion.m4 +buildtools/conf/lt~obsolete.m4 +buildtools/conf/missing +buildtools/conf/ylwrap +configure +configure.ac +doc.lst +install.lst +monetdb_config.h.in +*.pyc + +# files generated by various editors +*.swp +*~ +\#* +.#* + +# files generated by compilers +lex.yy.c +*.tab.c +*.tab.h +.libs +*.exe +*.exe.manifest +*.la +*.lo +*.o +*.obj +*.lib +# notwithstanding clients/odbc/winsetup/winredist/*.dll: +*.dll +# ruby: +*.gem +# java: +*.jar +java/build +java/target +java/bin +java/src/main/java/nl/cwi/monetdb/jdbc/MonetDriver.java +# python: +dist + +# other files we don't want +TAGS +tags +*.elc +*.pyo +*.rej +*.orig + +# build results on Windows +NT/.monetdb +NT/buildtools +NT/clients +NT/common +NT/gdk +NT/geom +NT/inttypes.h +NT/java +NT/monetdb5 +NT/monetdb_config.h +NT/sql +NT/testing +NT/tools +NT/unistd.h + +# package building on Mac OS X +MacOSX/build +MacOSX/usr + +# Build directory +BUILD + +syntax: regexp +^java/build$ +syntax: regexp +^java/target$ + + +/build ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: graph0 - SEMA: increase the values related to the flags
Changeset: 3321126f24e7 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3321126f24e7 Modified Files: sql/common/sql_types.c sql/include/sql_relation.h sql/server/rel_exp.c Branch: graph0 Log Message: SEMA: increase the values related to the flags diffs (39 lines): diff --git a/sql/common/sql_types.c b/sql/common/sql_types.c --- a/sql/common/sql_types.c +++ b/sql/common/sql_types.c @@ -543,7 +543,7 @@ sql_bind_aggr_(sql_allocator *sa, sql_sc continue; if (strcmp(a->base.name, sqlaname) == 0 && - (list_cmp(a->ops, ops, (fcmp) _subtype_cmp) == 0 || a->vararg)) + (list_cmp(a->ops, ops, (fcmp) _subtype_cmp) == 0 || a->vararg)) return _dup_subaggr(sa, a, type); } } diff --git a/sql/include/sql_relation.h b/sql/include/sql_relation.h --- a/sql/include/sql_relation.h +++ b/sql/include/sql_relation.h @@ -63,9 +63,9 @@ typedef struct expression { #define ASCENDING 32 #define CMPMASK(ASCENDING-1) #define get_cmp(e) (e->flag) -#define ANTISEL32 -#define HAS_NO_NIL 64 -#define EXP_INTERN 128 +#define ANTISEL64 +#define HAS_NO_NIL 128 +#define EXP_INTERN 256 #define UPD_COMP 1 #define UPD_LOCKED 2 diff --git a/sql/server/rel_exp.c b/sql/server/rel_exp.c --- a/sql/server/rel_exp.c +++ b/sql/server/rel_exp.c @@ -107,7 +107,6 @@ exp_compare(sql_allocator *sa, sql_exp * return e; } - sql_exp* exp_unnest(sql_allocator* sa, sql_exp* column, list* attributes){ sql_exp *e = exp_create(sa, e_cmp); ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: graph0 - SEMA: Avoid to explicitly refer to the sql typ...
Changeset: 0710c29f03e9 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0710c29f03e9 Modified Files: sql/common/sql_types.c sql/include/sql_catalog.h sql/server/rel_schema.c sql/server/rel_select.c sql/storage/sql_catalog.c sql/storage/store.c Branch: graph0 Log Message: SEMA: Avoid to explicitly refer to the sql type nested_table diffs (109 lines): diff --git a/sql/common/sql_types.c b/sql/common/sql_types.c --- a/sql/common/sql_types.c +++ b/sql/common/sql_types.c @@ -1031,6 +1031,7 @@ sql_create_type(sql_allocator *sa, const t->radix = radix; t->eclass = eclass; t->s = NULL; + t->storage = true; if (!keyword_exists(t->sqlname) && !EC_INTERVAL(eclass)) keywords_insert(t->sqlname, KW_TYPE); list_append(types, t); @@ -1269,6 +1270,7 @@ sqltypeinit( sql_allocator *sa) sql_func *f; sql_arg *sres; sql_type *LargestINT, *LargestDEC; + sql_type *NESTED_TABLE; ANY = sql_create_type(sa, "ANY", 0, 0, 0, EC_ANY, "void"); @@ -1347,7 +1349,8 @@ sqltypeinit( sql_allocator *sa) *t++ = sql_create_type(sa, "BLOB", 0, 0, 0, EC_BLOB, "sqlblob"); - *t++ = sql_create_type(sa, "NESTED_TABLE", 0, 0, 0, EC_NESTED_TABLE, "nestedtable"); + NESTED_TABLE = *t++ = sql_create_type(sa, "NESTED_TABLE", 0, 0, 0, EC_NESTED_TABLE, "nestedtable"); + NESTED_TABLE->storage = false; if (geomcatalogfix_get() != NULL) { // the geom module is loaded diff --git a/sql/include/sql_catalog.h b/sql/include/sql_catalog.h --- a/sql/include/sql_catalog.h +++ b/sql/include/sql_catalog.h @@ -249,6 +249,7 @@ typedef struct sql_type { unsigned int bits; unsigned char eclass; /* types are grouped into equivalence classes */ sql_schema *s; + bool storage; } sql_type; typedef struct sql_alias { diff --git a/sql/server/rel_schema.c b/sql/server/rel_schema.c --- a/sql/server/rel_schema.c +++ b/sql/server/rel_schema.c @@ -645,6 +645,11 @@ create_column(mvc *sql, symbol *s, sql_s if (cname && ctype) { sql_column *cs = NULL; + if(!ctype->type->storage){ + sql_error(sql, 02, "42S21!%s TABLE: cannot refer to the type '%s' in the attribute '%s'", (alter)?"ALTER":"CREATE", ctype->type->sqlname, cname); + return SQL_ERR; + } + cs = find_sql_column(t, cname); if (cs) { sql_error(sql, 02, "42S21!%s TABLE: a column named '%s' already exists\n", (alter)?"ALTER":"CREATE", cname); diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c --- a/sql/server/rel_select.c +++ b/sql/server/rel_select.c @@ -4885,9 +4885,8 @@ rel_unique_names(mvc *sql, sql_rel *rel) return rel; } - static sql_rel * -validate_result_type (mvc *sql, sql_rel *rel){ +validate_result_type(mvc *sql, sql_rel *rel){ list *exps = rel_projections(sql, rel, NULL, true, false); for(node *n = exps->h; n; n = n->next){ sql_exp *e = n->data; diff --git a/sql/storage/sql_catalog.c b/sql/storage/sql_catalog.c --- a/sql/storage/sql_catalog.c +++ b/sql/storage/sql_catalog.c @@ -264,6 +264,9 @@ sql_trans_bind_type(sql_trans *tr, sql_s if (!t && c) t = find_sql_type(c, name); + + if(t && !t->storage){ return NULL; } // cannot explicitly refer to the nested table ftb + return t; } diff --git a/sql/storage/store.c b/sql/storage/store.c --- a/sql/storage/store.c +++ b/sql/storage/store.c @@ -719,6 +719,7 @@ load_type(sql_trans *tr, sql_schema *s, t->localtype = ATOMindex(t->base.name); t->bits = 0; t->s = s; + t->storage = (strcmp(s->base.name, "sys") == 0 && strcmp(t->sqlname, "nested_table") == 0) ? false : true; // a bit hacky return t; } @@ -2433,6 +2434,7 @@ type_dup(sql_trans *tr, int flag, sql_ty t->bits = ot->bits; t->localtype = ot->localtype; t->s = s; + t->storage = ot->storage; return t; } @@ -4058,6 +4060,7 @@ sql_trans_create_type(sql_trans *tr, sql t->eclass = eclass; t->localtype = localtype; t->s = s; + t->storage = true; cs_add(>types, t, TR_NEW); table_funcs.table_insert(tr, systype, >base.id, t->base.name, t->sqlname, >digits, >scale, , , >base.id); ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: graph0 - Bugfix: handle TYPE_void in the NEST function
Changeset: f7c963586972 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f7c963586972 Modified Files: monetdb5/modules/atoms/nested_table.c Branch: graph0 Log Message: Bugfix: handle TYPE_void in the NEST function diffs (47 lines): diff --git a/monetdb5/modules/atoms/nested_table.c b/monetdb5/modules/atoms/nested_table.c --- a/monetdb5/modules/atoms/nested_table.c +++ b/monetdb5/modules/atoms/nested_table.c @@ -61,7 +61,6 @@ mal_export str NESTEDTABLEnest1_oid(bat* const char* function_name = "nestedtable.nest1"; str rc = MAL_SUCCEED; BAT* group_mapping = NULL; - oid* __restrict group_mapping_values = NULL; BAT* histogram = NULL; lng* __restrict histogram_values = NULL; BAT* output = NULL; @@ -115,12 +114,29 @@ mal_export str NESTEDTABLEnest1_oid(bat* BATsetcount(output, output_sz); // insert the actual values into the vheap - group_mapping_values = (oid*) group_mapping->theap.base; - for(size_t i = 0, sz = BATcount(group_mapping); i < sz; i++){ - var_t offset = output_offsets[ group_mapping_values[i] ] << GDK_VARSHIFT; - oid* __restrict values = (oid*) (output_content + offset); - oid pos = ++values[0]; - values[pos] = i; + switch(group_mapping->ttype){ + case TYPE_oid: { // regular case + oid* __restrict group_mapping_values = (oid*) group_mapping->theap.base; + for(size_t i = 0, sz = BATcount(group_mapping); i < sz; i++){ + var_t offset = output_offsets[ group_mapping_values[i] ] << GDK_VARSHIFT; + oid* __restrict values = (oid*) (output_content + offset); + oid pos = ++values[0]; + values[pos] = i; + } + break; + } + case TYPE_void: { // extreme case causing seg~ faults + for(size_t i = group_mapping->T.seq /* tseqbase */, sz = BATcount(group_mapping); i < sz; i++){ + var_t offset = output_offsets[ i ] << GDK_VARSHIFT; + oid* __restrict values = (oid*) (output_content + offset); + oid pos = ++values[0]; + values[pos] = i; + } + break; + } + default: + assert(false && "Invalid input type for the parameter group_mapping"); + CHECK(false, ILLEGAL_ARGUMENT); // in case it skips the above assertion } success: ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: graph0 - PARSER: minor code clean up
Changeset: 4eefa8af4c42 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4eefa8af4c42 Modified Files: sql/server/rel_rel.c sql/server/sql_parser.y sql/server/sql_symbol.c Branch: graph0 Log Message: PARSER: minor code clean up diffs (44 lines): diff --git a/sql/server/rel_rel.c b/sql/server/rel_rel.c --- a/sql/server/rel_rel.c +++ b/sql/server/rel_rel.c @@ -394,7 +394,6 @@ rel_crossproduct(sql_allocator *sa, sql_ return rel; } - sql_rel * rel_unnest(sql_allocator* sa, sql_rel *l, sql_exp* e){ sql_rel *rel = rel_create(sa); diff --git a/sql/server/sql_parser.y b/sql/server/sql_parser.y --- a/sql/server/sql_parser.y +++ b/sql/server/sql_parser.y @@ -120,7 +120,9 @@ UTF8_strlen(const char *val) } %{ extern int sqllex( YYSTYPE *yylval, void *m ); +/* enable to activate debugging support int yydebug=1; +*/ %} /* symbolic tokens */ @@ -3194,7 +3196,7 @@ table_ref: append_symbol(l, $1); append_list(l, $3); append_symbol(l, $4); - $$ = _symbol_create_list( SQL_UNNEST, l); } + $$ = _symbol_create_list(SQL_UNNEST, l); } } | LATERAL subquery table_name { diff --git a/sql/server/sql_symbol.c b/sql/server/sql_symbol.c --- a/sql/server/sql_symbol.c +++ b/sql/server/sql_symbol.c @@ -284,7 +284,6 @@ dlist_prepend_symbol(sql_allocator* sa, return dlist_prepend_default(l, n); } - symbol * newSelectNode(sql_allocator *sa, int distinct, struct dlist *selection, struct dlist *into, symbol *from, symbol *where, symbol *groupby, symbol *having, symbol *orderby, symbol *name, symbol *limit, symbol *offset, symbol *sample) { ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: graph0 - PARSER: allow multiple sequences of the UNNEST...
Changeset: 01309573072e for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=01309573072e Modified Files: sql/server/rel_select.c sql/server/sql_parser.y sql/server/sql_symbol.c sql/server/sql_symbol.h Branch: graph0 Log Message: PARSER: allow multiple sequences of the UNNEST operator diffs (155 lines): diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c --- a/sql/server/rel_select.c +++ b/sql/server/rel_select.c @@ -5367,33 +5367,37 @@ rel_unionjoinquery(mvc *sql, sql_rel *re static sql_rel * rel_unnest_query(mvc* sql, sql_rel* rel, symbol* q){ dnode* head = q->data.lval->h; - sql_rel* lhs = NULL; - sql_exp* rhs = NULL; - list* attributes = NULL; - const char* attributes_tbl = NULL; symbol* symbol_table_alias = NULL; - // bind the table and the column - lhs = table_ref(sql, rel, head->data.sym, 0); - if(!lhs){ + // bind the table + rel = table_ref(sql, rel, head->data.sym, 0); + if(!rel){ return NULL; } - rhs = rel_column_ref(sql, , head->next->data.sym, sql_from); - if(!rhs){ - return NULL; - } - if(rhs->tpe.type->eclass != EC_NESTED_TABLE){ - //(void) sql_error(sql, 02, "relational query without result"); - return sql_error(sql, 02, "The attribute %s is not a nested table", exp_name(rhs)); - } - - rel = rel_unnest(sql->sa, lhs, rhs); - - // rename the attributes according to the table name of the nested column - attributes = rel_unnest_attributes(rel); - attributes_tbl = exp_relname(rhs); - for (node* n = attributes->h; n; n = n->next){ - exp_setname(sql->sa, n->data, attributes_tbl, NULL); + + // bind the nested table attributes + // we have a list for the general case T UNNEST T.x UNNEST T.y ... + // however typically there is only one entry in the list + for(dnode* nst = head->next->data.lval->h; nst; nst = nst->next){ + sql_exp* rhs = rel_column_ref(sql, , nst->data.sym, sql_from); + list* attributes = NULL; + const char* attributes_tbl = NULL; + + if(!rhs){ + return NULL; + } + + if(rhs->tpe.type->eclass != EC_NESTED_TABLE) + return sql_error(sql, 02, "The attribute %s is not a nested table", exp_name(rhs)); + + rel = rel_unnest(sql->sa, rel, rhs); + + // rename the attributes according to the table name of the nested column + attributes = rel_unnest_attributes(rel); + attributes_tbl = exp_relname(rhs); + for (node* n = attributes->h; n; n = n->next){ + exp_setname(sql->sa, n->data, attributes_tbl, NULL); + } } // table expression alias, i.e. table_exp UNNEST attr AS newName ( newColumns ) diff --git a/sql/server/sql_parser.y b/sql/server/sql_parser.y --- a/sql/server/sql_parser.y +++ b/sql/server/sql_parser.y @@ -41,6 +41,7 @@ #define append_symbol(l,d) dlist_append_symbol( SA, l, d) #define append_string(l,d) dlist_append_string( SA, l, d) #define append_type(l,d) dlist_append_type( SA, l, d) +#define prepend_symbol(l, d) dlist_prepend_symbol( SA, l, d) #define _atom_string(t, v) atom_string(SA, t, v) @@ -426,6 +427,7 @@ int yydebug=1; window_frame_extent window_frame_between routine_designator + nested_attributes %type any_all_some @@ -2961,6 +2963,13 @@ join_spec: { $$ = _symbol_create_list( SQL_USING, $2); } ; +nested_attributes: +ident +{ $$ = append_symbol(L(), _symbol_create_list(SQL_COLUMN, append_string(L(), $1))); } + | ident UNNEST nested_attributes +{ $$ = prepend_symbol($3, _symbol_create_list(SQL_COLUMN, append_string(L(), $1))); } + ; + /* ::= [ ] @@ -3179,11 +3188,11 @@ table_ref: append_symbol($1->data.lval, $2); } } - | subquery_with_orderby UNNEST ident opt_table_name + | subquery_with_orderby UNNEST nested_attributes opt_table_name { { dlist *l = L(); append_symbol(l, $1); - append_symbol(l, _symbol_create_list(SQL_COLUMN, append_string(L(), $3))); + append_list(l, $3); append_symbol(l, $4); $$ = _symbol_create_list( SQL_UNNEST, l); } } diff --git a/sql/server/sql_symbol.c b/sql/server/sql_symbol.c --- a/sql/server/sql_symbol.c +++ b/sql/server/sql_symbol.c @@ -263,6 +263,28 @@ dlist_append_type(sql_allocator *sa, dli return dlist_append_default(l, n); } +static dlist * +dlist_prepend_default(dlist *l, dnode *n) +{ + n->next = l->h; + l->h = n; + if(l->cnt == 0){ l->t = n; } + l->cnt++; + + return l; +} + +dlist *
MonetDB: graph0 - cleanup #1
Changeset: 4aa677e8f4ff for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4aa677e8f4ff Modified Files: sql/server/rel_select.c sql/server/sql_parser.y sql/storage/bat/bat_utils.c Branch: graph0 Log Message: cleanup #1 diffs (39 lines): diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c --- a/sql/server/rel_select.c +++ b/sql/server/rel_select.c @@ -5407,7 +5407,6 @@ rel_unnest_query(mvc* sql, sql_rel* rel, return rel; } - sql_rel * rel_subquery(mvc *sql, sql_rel *rel, symbol *sq, exp_kind ek, int apply) { diff --git a/sql/server/sql_parser.y b/sql/server/sql_parser.y --- a/sql/server/sql_parser.y +++ b/sql/server/sql_parser.y @@ -2919,7 +2919,7 @@ joined_table: append_int(l, 4); append_symbol(l, $3); append_symbol(l, $4); - $$ = _symbol_create_list( SQL_UNIONJOIN, l); } + $$ = _symbol_create_list( SQL_UNIONJOIN, l); } | table_ref join_type JOIN table_ref join_spec { dlist *l = L(); append_symbol(l, $1); diff --git a/sql/storage/bat/bat_utils.c b/sql/storage/bat/bat_utils.c --- a/sql/storage/bat/bat_utils.c +++ b/sql/storage/bat/bat_utils.c @@ -177,11 +177,7 @@ bat_utils_init(void) && (have_hge || t != TYPE_hge) #endif ) { - if(t == TYPE_nested_table){ - ebats[t] = bat_new(t, 0, TRANSIENT); - } else { - ebats[t] = bat_new(t, 0, TRANSIENT); - } + ebats[t] = bat_new(t, 0, TRANSIENT); bat_set_access(ebats[t], BAT_READ); } } ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: graph0 - SEMA: Avoid to return a nested table attribute
Changeset: 4a22cee0355a for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4a22cee0355a Modified Files: sql/server/rel_select.c Branch: graph0 Log Message: SEMA: Avoid to return a nested table attribute diffs (34 lines): diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c --- a/sql/server/rel_select.c +++ b/sql/server/rel_select.c @@ -4885,6 +4885,21 @@ rel_unique_names(mvc *sql, sql_rel *rel) return rel; } + +static sql_rel * +validate_result_type (mvc *sql, sql_rel *rel){ + list *exps = rel_projections(sql, rel, NULL, true, false); + for(node *n = exps->h; n; n = n->next){ + sql_exp *e = n->data; + sql_subtype *type = exp_subtype(e); + if(list_length(type->attributes) != 0){ + return sql_error(sql, 01, "SELECT: Nested table attribute in the topmost projection: %s", exp_name(e)); + } + } + + return rel; +} + static sql_rel * rel_query(mvc *sql, sql_rel *rel, symbol *sq, int toplevel, exp_kind ek, int apply) { @@ -5445,6 +5460,8 @@ rel_selects(mvc *sql, symbol *s) } if (!ret && sql->errstr[0] == 0) (void) sql_error(sql, 02, "relational query without result"); + else + ret = validate_result_type(sql, ret); return ret; } ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: graph0 - CODEGEN: do not assert iff list_nested_attribu...
Changeset: b3f8f4569d07 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b3f8f4569d07 Modified Files: sql/backends/monet5/sql_statement.c Branch: graph0 Log Message: CODEGEN: do not assert iff list_nested_attributes is not implemented for a given stmt diffs (21 lines): diff --git a/sql/backends/monet5/sql_statement.c b/sql/backends/monet5/sql_statement.c --- a/sql/backends/monet5/sql_statement.c +++ b/sql/backends/monet5/sql_statement.c @@ -19,6 +19,7 @@ #include "mal_debugger.h" #include "opt_prelude.h" +#include #include /* @@ -3558,7 +3559,8 @@ list *list_nested_attributes(stmt* st){ case st_var: // implies storage return NULL; default: - assert(0 && "Statement type not handled"); +// assert(0 && "Statement type not handled"); + fprintf(stderr, "[list_nested_attributes] Statement type not handled: %d\n", st->type); } return NULL; ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: graph0 - Bugfix: treat offsets in the vheap as byte dis...
Changeset: cfd7d5529bc7 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=cfd7d5529bc7 Modified Files: monetdb5/modules/atoms/nested_table.c Branch: graph0 Log Message: Bugfix: treat offsets in the vheap as byte displacements diffs (88 lines): diff --git a/monetdb5/modules/atoms/nested_table.c b/monetdb5/modules/atoms/nested_table.c --- a/monetdb5/modules/atoms/nested_table.c +++ b/monetdb5/modules/atoms/nested_table.c @@ -51,7 +51,7 @@ str NESTEDTABLEprelude(void* ret) { var_t NESTEDTABLEput(Heap *h, var_t *bun, nested_table *value) { const size_t size = (value->count+1) * sizeof(oid); - const var_t offset = HEAP_malloc(h, size); // longjmp in case of error O.o + const var_t offset = HEAP_malloc(h, size) << GDK_VARSHIFT; // longjmp in case of error O.o memcpy(h->base + offset, value, size); return (*bun = offset); } @@ -90,7 +90,7 @@ mal_export str NESTEDTABLEnest1_oid(bat* output_content_sz = output_sz + BATcount(group_mapping); heap_alloc_offset = HEAP_malloc(output->tvheap, output_content_sz * sizeof(oid)) << GDK_VARSHIFT; output_content = output->tvheap->base; -memset(output_content + heap_alloc_offset, 0, output_content_sz * sizeof(oid)); + memset(output_content + heap_alloc_offset, 0, output_content_sz * sizeof(oid)); // edge case, the input is empty if(output_sz == 0) goto success; @@ -98,13 +98,14 @@ mal_export str NESTEDTABLEnest1_oid(bat* // compute the offsets histogram_values = (lng*) histogram->T.heap.base; output_offsets = (var_t*) output->T.heap.base; - output_offsets[0] = sum = heap_alloc_offset; + sum = heap_alloc_offset; + output_offsets[0] = sum >> GDK_VARSHIFT; for (size_t i = 1; i < output_sz; i++){ - sum += histogram_values[i-1] + /* length */ 1; - output_offsets[i] = (var_t) sum; + sum += (histogram_values[i-1] + /* length */ 1) * sizeof(oid); + output_offsets[i] = ((var_t) sum) >> GDK_VARSHIFT; } - sum += histogram_values[output_sz -1] +1; - assert((sum - heap_alloc_offset) == output_content_sz && "computed sum != #groups + #values"); + sum += (histogram_values[output_sz -1] +1) * sizeof(oid); + assert((sum - heap_alloc_offset) == output_content_sz * sizeof(oid) && "computed sum != #groups + #values"); output->tvarsized = 1; output->tkey = 1; output->tdense = output->tnodense = 0; @@ -113,14 +114,14 @@ mal_export str NESTEDTABLEnest1_oid(bat* output->tnonil = 1; output->tnil = 0; BATsetcount(output, output_sz); -// insert the actual values into the vheap -group_mapping_values = (oid*) group_mapping->theap.base; -for(size_t i = 0, sz = BATcount(group_mapping); i < sz; i++){ - var_t offset = output_offsets[ group_mapping_values[i] ]; - oid* __restrict values = (oid*) (output_content + (offset << GDK_VARSHIFT)); - oid pos = ++values[0]; - values[pos] = i; -} + // insert the actual values into the vheap + group_mapping_values = (oid*) group_mapping->theap.base; + for(size_t i = 0, sz = BATcount(group_mapping); i < sz; i++){ + var_t offset = output_offsets[ group_mapping_values[i] ] << GDK_VARSHIFT; + oid* __restrict values = (oid*) (output_content + offset); + oid pos = ++values[0]; + values[pos] = i; + } success: BBPunfix(group_mapping->batCacheid); @@ -143,7 +144,7 @@ mal_export str NESTEDTABLEunnest101_oid( str rc = MAL_SUCCEED; BAT *nested_attribute = NULL; var_t* __restrict na_offsets = NULL; - oid* __restrict na_values = NULL; + char* __restrict na_values = NULL; oid na_count = 0; BAT *jl = NULL, *jr = NULL; @@ -162,11 +163,11 @@ mal_export str NESTEDTABLEunnest101_oid( na_count = BATcount(nested_attribute); na_offsets = (var_t*) nested_attribute->T.heap.base; assert(nested_attribute->T.vheap != NULL); - na_values = (oid*) nested_attribute->T.vheap->base; + na_values = nested_attribute->T.vheap->base; assert(na_values != NULL); for(oid i = 0; i < na_count; i++){ - var_t offset = na_offsets[i]; - oid* __restrict base = na_values + offset; + var_t offset = na_offsets[i] << GDK_VARSHIFT; + oid* __restrict base = (oid*) (na_values + offset); oid off_count = *(base++); assert((offset + (off_count * sizeof(oid)) <= nested_attribute->T.vheap->size) && "Index out of bounds"); for(oid j = 0; j < off_count; j++){ ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: graph0 - RUNTIME: use HEAP_malloc to obtain a memory ar...
Changeset: aa93fac297ed for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=aa93fac297ed Modified Files: monetdb5/modules/atoms/blob.c monetdb5/modules/atoms/nested_table.c monetdb5/modules/atoms/nested_table.mal sql/backends/monet5/sql_statement.c Branch: graph0 Log Message: RUNTIME: use HEAP_malloc to obtain a memory area for the values diffs (210 lines): diff --git a/monetdb5/modules/atoms/blob.c b/monetdb5/modules/atoms/blob.c --- a/monetdb5/modules/atoms/blob.c +++ b/monetdb5/modules/atoms/blob.c @@ -52,7 +52,6 @@ mal_export str BLOBtoblob(blob **retval, mal_export str BLOBfromblob(str *retval, blob **b); mal_export str BLOBfromidx(str *retval, blob **binp, int *index); mal_export str BLOBnitems(int *ret, blob *b); -mal_export int BLOBget(Heap *h, int *bun, int *l, blob **val); mal_export blob * BLOBread(blob *a, stream *s, size_t cnt); mal_export gdk_return BLOBwrite(blob *a, stream *s, size_t cnt); diff --git a/monetdb5/modules/atoms/nested_table.c b/monetdb5/modules/atoms/nested_table.c --- a/monetdb5/modules/atoms/nested_table.c +++ b/monetdb5/modules/atoms/nested_table.c @@ -12,6 +12,8 @@ #include "mal_exception.h" #include "gdk_bbp.h" +#include "nested_table.h" + // errors #if !defined(NDEBUG) /* debug only */ #define _CHECK_ERRLINE_EXPAND(LINE) #LINE @@ -27,28 +29,33 @@ mal_export str NESTEDTABLEnest1_oid(bat*, const bat*, const bat*); mal_export str NESTEDTABLEunnest101_oid(bat*, bat*, const bat*); mal_export void NESTEDTABLEheap(Heap*, size_t); +mal_export var_t NESTEDTABLEput(Heap *h, var_t *bun, nested_table *val); mal_export str NESTEDTABLEprelude(void*); // index in the BATatoms table int TYPE_nested_table; -// only needed for its side effect: it asks the gdk initialise the vheap storage -void NESTEDTABLEheap(Heap *heap, size_t capacity){ - (void) capacity; - heap->base = heap->base -1; // fool the gdk -> ATOMheap +void NESTEDTABLEheap(Heap* heap, size_t capacity){ + (void) capacity; // capacity refers to the #number of elements in the non virtual heap + HEAP_initialize(heap, 0, 0, sizeof(oid)); } // initializer str NESTEDTABLEprelude(void* ret) { - atomDesc* descriptor = NULL; - (void) ret; TYPE_nested_table = ATOMindex("nestedtable"); - descriptor = BATatoms + TYPE_nested_table; - descriptor->linear = FALSE; + + BATatoms[TYPE_nested_table].linear = FALSE; return MAL_SUCCEED; } +var_t NESTEDTABLEput(Heap *h, var_t *bun, nested_table *value) { + const size_t size = (value->count+1) * sizeof(oid); + const var_t offset = HEAP_malloc(h, size); // longjmp in case of error O.o + memcpy(h->base + offset, value, size); + return (*bun = offset); +} + // MAL interface mal_export str NESTEDTABLEnest1_oid(bat* id_out, const bat* id_group_mapping, const bat* id_histogram) { const char* function_name = "nestedtable.nest1"; @@ -58,9 +65,11 @@ mal_export str NESTEDTABLEnest1_oid(bat* BAT* histogram = NULL; lng* __restrict histogram_values = NULL; BAT* output = NULL; - var_t* __restrict output_offsets = NULL; - oid* __restrict output_content = NULL; + var_t heap_alloc_offset = 0; + var_t* /*__restrict*/ output_offsets = NULL; + char* /*__restrict*/ output_content = NULL; size_t output_sz = 0; + size_t output_content_sz = 0; oid sum = 0; // input arguments @@ -76,20 +85,26 @@ mal_export str NESTEDTABLEnest1_oid(bat* output = COLnew(group_mapping->hseqbase, TYPE_nested_table, BATcount(histogram), TRANSIENT); CHECK(output != NULL, MAL_MALLOC_FAIL); + // allocate the virtual heap + output_sz = BATcount(histogram); + output_content_sz = output_sz + BATcount(group_mapping); + heap_alloc_offset = HEAP_malloc(output->tvheap, output_content_sz * sizeof(oid)) << GDK_VARSHIFT; + output_content = output->tvheap->base; +memset(output_content + heap_alloc_offset, 0, output_content_sz * sizeof(oid)); + // edge case, the input is empty - output_sz = BATcount(histogram); if(output_sz == 0) goto success; // compute the offsets histogram_values = (lng*) histogram->T.heap.base; output_offsets = (var_t*) output->T.heap.base; - output_offsets[0] = 0; + output_offsets[0] = sum = heap_alloc_offset; for (size_t i = 1; i < output_sz; i++){ sum += histogram_values[i-1] + /* length */ 1; output_offsets[i] = (var_t) sum; } sum += histogram_values[output_sz -1] +1; - assert(sum == BATcount(histogram) + BATcount(group_mapping) && "#groups + #values != computed sum"); + assert((sum - heap_alloc_offset) == output_content_sz && "computed sum != #groups + #values"); output->tvarsized = 1; output->tkey = 1; output->tdense = output->tnodense = 0; @@ -98,20
MonetDB: graph0 - WIP
Changeset: 86f0e4522080 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=86f0e4522080 Modified Files: monetdb5/modules/atoms/nested_table.c monetdb5/modules/atoms/nested_table.mal sql/storage/bat/bat_utils.c Branch: graph0 Log Message: WIP diffs (91 lines): diff --git a/monetdb5/modules/atoms/nested_table.c b/monetdb5/modules/atoms/nested_table.c --- a/monetdb5/modules/atoms/nested_table.c +++ b/monetdb5/modules/atoms/nested_table.c @@ -26,11 +26,18 @@ // prototypes mal_export str NESTEDTABLEnest1_oid(bat*, const bat*, const bat*); mal_export str NESTEDTABLEunnest101_oid(bat*, bat*, const bat*); +mal_export void NESTEDTABLEheap(Heap*, size_t); mal_export str NESTEDTABLEprelude(void*); // index in the BATatoms table int TYPE_nested_table; +// only needed for its side effect: it asks the gdk initialise the vheap storage +void NESTEDTABLEheap(Heap *heap, size_t capacity){ + (void) capacity; + heap->base = heap->base -1; // fool the gdk -> ATOMheap +} + // initializer str NESTEDTABLEprelude(void* ret) { atomDesc* descriptor = NULL; @@ -38,7 +45,6 @@ str NESTEDTABLEprelude(void* ret) { (void) ret; TYPE_nested_table = ATOMindex("nestedtable"); descriptor = BATatoms + TYPE_nested_table; - descriptor->size = descriptor->align = sizeof(var_t); descriptor->linear = FALSE; return MAL_SUCCEED; } @@ -98,14 +104,14 @@ mal_export str NESTEDTABLEnest1_oid(bat* memset(output->tvheap->base, 0, output->tvheap->size); // insert the actual values into the vheap -group_mapping_values = (oid*) group_mapping->tvheap->base; +group_mapping_values = (oid*) group_mapping->theap.base; output_content = (oid*) output->T.vheap->base; for(size_t i = 0, sz = BATcount(group_mapping); i < sz; i++){ oid count = output_offsets[ group_mapping_values[i] ]; oid pos = ++output_content[count]; output_content[pos] = i; } -group_mapping->tvheap->free = sum * sizeof(oid); +output->tvheap->free = sum * sizeof(oid); success: BBPunfix(group_mapping->batCacheid); @@ -151,6 +157,7 @@ mal_export str NESTEDTABLEunnest101_oid( na_offsets = (var_t*) nested_attribute->T.heap.base; assert(nested_attribute->T.vheap != NULL); na_values = (oid*) nested_attribute->T.vheap->base; + assert(na_values != NULL && ((lng) na_values) != -1); for(oid i = 0; i < na_count; i++){ var_t offset = na_offsets[i]; oid* __restrict base = na_values + offset; diff --git a/monetdb5/modules/atoms/nested_table.mal b/monetdb5/modules/atoms/nested_table.mal --- a/monetdb5/modules/atoms/nested_table.mal +++ b/monetdb5/modules/atoms/nested_table.mal @@ -8,6 +8,7 @@ module nestedtable; atom nestedtable : oid; +command heap()address NESTEDTABLEheap; command prelude() address NESTEDTABLEprelude; command nest1(group_mapping :bat[:oid], histogram :bat[:lng]) :bat[:nestedtable] diff --git a/sql/storage/bat/bat_utils.c b/sql/storage/bat/bat_utils.c --- a/sql/storage/bat/bat_utils.c +++ b/sql/storage/bat/bat_utils.c @@ -164,6 +164,8 @@ ebat_copy(log_bid b, oid ibase, int temp return r; } +extern int TYPE_nested_table; + void bat_utils_init(void) { @@ -175,7 +177,11 @@ bat_utils_init(void) && (have_hge || t != TYPE_hge) #endif ) { - ebats[t] = bat_new(t, 0, TRANSIENT); + if(t == TYPE_nested_table){ + ebats[t] = bat_new(t, 0, TRANSIENT); + } else { + ebats[t] = bat_new(t, 0, TRANSIENT); + } bat_set_access(ebats[t], BAT_READ); } } ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: graph0 - CODEGEN: unnest
Changeset: 403d0b7e036f for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=403d0b7e036f Modified Files: monetdb5/modules/atoms/nested_table.c monetdb5/modules/atoms/nested_table.mal sql/backends/monet5/rel_bin.c sql/backends/monet5/sql_statement.c sql/backends/monet5/sql_statement.h sql/server/rel_select.c Branch: graph0 Log Message: CODEGEN: unnest diffs (truncated from 327 to 300 lines): diff --git a/monetdb5/modules/atoms/nested_table.c b/monetdb5/modules/atoms/nested_table.c --- a/monetdb5/modules/atoms/nested_table.c +++ b/monetdb5/modules/atoms/nested_table.c @@ -25,6 +25,7 @@ // prototypes mal_export str NESTEDTABLEnest1_oid(bat*, const bat*, const bat*); +mal_export str NESTEDTABLEunnest101_oid(bat*, bat*, const bat*); mal_export str NESTEDTABLEprelude(void*); // index in the BATatoms table @@ -104,6 +105,7 @@ mal_export str NESTEDTABLEnest1_oid(bat* oid pos = ++output_content[count]; output_content[pos] = i; } +group_mapping->tvheap->free = sum * sizeof(oid); success: BBPunfix(group_mapping->batCacheid); @@ -121,3 +123,61 @@ error: return rc; } +mal_export str NESTEDTABLEunnest101_oid(bat* out_jl, bat* out_jr, const bat* in_nested_attribute){ + const char* function_name = "nestedtable.unnest1"; + str rc = MAL_SUCCEED; + BAT *nested_attribute = NULL; + var_t* __restrict na_offsets = NULL; + oid* __restrict na_values = NULL; + oid na_count = 0; + BAT *jl = NULL, *jr = NULL; + + // input argument + CHECK(in_nested_attribute != NULL, ILLEGAL_ARGUMENT); + nested_attribute = BATdescriptor(*in_nested_attribute); + CHECK(nested_attribute != NULL, RUNTIME_OBJECT_MISSING); + CHECK(ATOMtype(nested_attribute->ttype) == TYPE_nested_table, ILLEGAL_ARGUMENT); + + // output arguments + assert(nested_attribute->hseqbase == 0 && "Partition unexpected"); + jl = COLnew(nested_attribute->hseqbase, TYPE_oid, BATcount(nested_attribute) * 5, TRANSIENT); // *5 <= arbitrary value + jr = COLnew(nested_attribute->hseqbase, TYPE_oid, BATcount(nested_attribute) * 5, TRANSIENT); + CHECK(jl != NULL && jr != NULL, MAL_MALLOC_FAIL); + + // empty argument? + na_count = BATcount(nested_attribute); + if(na_count == 0) goto success; // skip here as the vheap may not be effectively allocated + + na_offsets = (var_t*) nested_attribute->T.heap.base; + assert(nested_attribute->T.vheap != NULL); + na_values = (oid*) nested_attribute->T.vheap->base; + for(oid i = 0; i < na_count; i++){ + var_t offset = na_offsets[i]; + oid* __restrict base = na_values + offset; + oid off_count = *(base++); + assert(((offset+off_count) * sizeof(oid) <= nested_attribute->T.vheap->size) && "Index out of bounds"); + for(oid j = 0; j < off_count; j++){ + BUNappend(jl, , false); + } + for(oid j = 0; j < off_count; j++){ + oid off_value = base[j]; + BUNappend(jr, _value, false); + } + } + +success: + BBPunfix(nested_attribute->batCacheid); + *out_jl = jl->batCacheid; + BBPkeepref(jl->batCacheid); + *out_jr = jr->batCacheid; + BBPkeepref(jr->batCacheid); + + return rc; +error: + if(nested_attribute){ BBPunfix(nested_attribute->batCacheid); } + if(jl){ BBPunfix(jl->batCacheid); } + if(jr){ BBPunfix(jr->batCacheid); } + + return rc; +} + diff --git a/monetdb5/modules/atoms/nested_table.mal b/monetdb5/modules/atoms/nested_table.mal --- a/monetdb5/modules/atoms/nested_table.mal +++ b/monetdb5/modules/atoms/nested_table.mal @@ -14,5 +14,9 @@ command nest1(group_mapping :bat[:oid], address NESTEDTABLEnest1_oid comment "Create a nested table out of the grouped partitions"; +command unnest1(:bat[:nestedtable]) (:bat[:oid], :bat[:oid]) +address NESTEDTABLEunnest101_oid +comment "Extract the candidate list from a nested table" + # Initialize nestedtable.prelude(); \ No newline at end of file diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c --- a/sql/backends/monet5/rel_bin.c +++ b/sql/backends/monet5/rel_bin.c @@ -23,6 +23,7 @@ static stmt * exp_bin(backend *be, sql_exp *e, stmt *left, stmt *right, stmt *grp, stmt *ext, stmt *cnt, stmt *sel); static stmt * rel_bin(backend *be, sql_rel *rel); static stmt * subrel_bin(backend *be, sql_rel *rel, list *refs); +static stmt * stmt_rename(backend *be, sql_rel *rel, sql_exp *exp, stmt *s); static stmt * refs_find_rel(list *refs, sql_rel *rel) @@ -528,8 +529,8 @@ exp_bin(backend *be, sql_exp *e, stmt *l node *n; int first = 1; - ops = sa_list(sql->sa); - args = e->l; +
MonetDB: graph0 - SEMA: unnest operator
Changeset: 180f3e64fd15 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=180f3e64fd15 Modified Files: sql/backends/monet5/rel_bin.c sql/include/sql_relation.h sql/server/rel_distribute.c sql/server/rel_dump.c sql/server/rel_exp.c sql/server/rel_exp.h sql/server/rel_optimizer.c sql/server/rel_partition.c sql/server/rel_rel.c sql/server/rel_rel.h sql/server/rel_select.c sql/server/sql_parser.y sql/server/sql_scan.c Branch: graph0 Log Message: SEMA: unnest operator diffs (truncated from 730 to 300 lines): diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c --- a/sql/backends/monet5/rel_bin.c +++ b/sql/backends/monet5/rel_bin.c @@ -1226,7 +1226,7 @@ exp2bin_args(backend *be, sql_exp *e, li if (e->flag == cmp_or || get_cmp(e) == cmp_filter) { args = exps2bin_args(be, e->l, args); args = exps2bin_args(be, e->r, args); - } else if (e->flag == cmp_in || e->flag == cmp_notin) { + } else if (e->flag == cmp_in || e->flag == cmp_notin || e->flag == cmp_unnest) { args = exp2bin_args(be, e->l, args); args = exps2bin_args(be, e->r, args); } else { @@ -1319,6 +1319,7 @@ rel2bin_args(backend *be, sql_rel *rel, case op_select: case op_topn: case op_sample: + case op_unnest: if (rel->exps) args = exps2bin_args(be, rel->exps, args); args = rel2bin_args(be, rel->l, args); @@ -4771,6 +4772,9 @@ subrel_bin(backend *be, sql_rel *rel, li s = rel2bin_sample(be, rel, refs); sql->type = Q_TABLE; break; + case op_unnest: + assert("Not handled yet"); + break; case op_insert: s = rel2bin_insert(be, rel, refs); if (sql->type == Q_TABLE) @@ -4995,6 +4999,7 @@ rel_deps(sql_allocator *sa, sql_rel *r, case op_groupby: case op_topn: case op_sample: + case op_unnest: if (rel_deps(sa, r->l, refs, l) != 0) return -1; break; diff --git a/sql/include/sql_relation.h b/sql/include/sql_relation.h --- a/sql/include/sql_relation.h +++ b/sql/include/sql_relation.h @@ -60,7 +60,7 @@ typedef struct expression { #define APPLY_NOTEXISTS64 /* ASCENDING > 15 else we have problems with cmp types */ -#define ASCENDING 16 +#define ASCENDING 32 #define CMPMASK(ASCENDING-1) #define get_cmp(e) (e->flag) #define ANTISEL32 @@ -200,8 +200,10 @@ typedef enum operator_type { (op == op_join || is_outerjoin(op)) #define is_semi(op) \ (op == op_semi || op == op_anti) +#define is_unnest(op) \ + (op == op_unnest) #define is_joinop(op) \ - (is_join(op) || is_semi(op)) + (is_join(op) || is_semi(op) || is_unnest(op)) #define is_apply(op) \ (op == op_apply) #define is_select(op) \ @@ -227,6 +229,7 @@ typedef enum operator_type { #define is_sample(op) \ (op == op_sample) + /* NO NIL semantics of aggr operations */ #define need_no_nil(e) \ ((e->flag_NIL)==NO_NIL) diff --git a/sql/server/rel_distribute.c b/sql/server/rel_distribute.c --- a/sql/server/rel_distribute.c +++ b/sql/server/rel_distribute.c @@ -52,6 +52,7 @@ has_remote_or_replica( sql_rel *rel ) case op_groupby: case op_topn: case op_sample: + case op_unnest: if (has_remote_or_replica( rel->l )) return 1; break; @@ -163,6 +164,7 @@ replica(mvc *sql, sql_rel *rel, char *ur case op_groupby: case op_topn: case op_sample: + case op_unnest: rel->l = replica(sql, rel->l, uri); break; case op_ddl: @@ -252,6 +254,7 @@ distribute(mvc *sql, sql_rel *rel) case op_groupby: case op_topn: case op_sample: + case op_unnest: rel->l = distribute(sql, rel->l); l = rel->l; if (l && (p = find_prop(l->p, PROP_REMOTE)) != NULL) { @@ -304,6 +307,7 @@ rel_remote_func(mvc *sql, sql_rel *rel) case op_groupby: case op_topn: case op_sample: + case op_unnest: rel->l = rel_remote_func(sql, rel->l); break; case op_ddl: diff --git a/sql/server/rel_dump.c b/sql/server/rel_dump.c --- a/sql/server/rel_dump.c +++ b/sql/server/rel_dump.c @@ -183,6 +183,10 @@ exp_print(mvc *sql, stream *fout, sql_ex mnstr_printf(fout, " !"); mnstr_printf(fout, " FILTER %s ", f->func->base.name); exps_print(sql, fout, e->r, depth, alias, 1); + } else if
MonetDB: graph0 - WIP: op_unnest
Changeset: 9b542205f1f0 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9b542205f1f0 Modified Files: sql/common/sql_types.c sql/include/sql_catalog.h sql/include/sql_relation.h sql/server/rel_rel.c sql/server/rel_select.c sql/server/rel_xml.c sql/server/sql_parser.h sql/server/sql_parser.y sql/server/sql_scan.c Branch: graph0 Log Message: WIP: op_unnest diffs (226 lines): diff --git a/sql/common/sql_types.c b/sql/common/sql_types.c --- a/sql/common/sql_types.c +++ b/sql/common/sql_types.c @@ -158,6 +158,7 @@ sql_init_subtype(sql_subtype *res, sql_t if (t->digits && res->digits > t->digits) res->digits = t->digits; res->scale = scale; + res->attributes = NULL; } sql_subtype * diff --git a/sql/include/sql_catalog.h b/sql/include/sql_catalog.h --- a/sql/include/sql_catalog.h +++ b/sql/include/sql_catalog.h @@ -134,14 +134,15 @@ typedef enum comp_type { cmp_or = 7, cmp_in = 8, cmp_notin = 9, + cmp_unnest = 10, /* The followin cmp_* are only used within stmt (not sql_exp) */ - cmp_all = 10, /* special case for crossproducts */ - cmp_project = 11, /* special case for projection joins */ - cmp_joined = 12,/* special case already joined */ - cmp_equal_nil = 13, /* special case equi join, with nil = nil */ - cmp_left = 14, /* special case equi join, keep left order */ - cmp_left_project = 15 /* last step of outer join */ + cmp_all = 11, /* special case for crossproducts */ + cmp_project = 12, /* special case for projection joins */ + cmp_joined = 13,/* special case already joined */ + cmp_equal_nil = 14, /* special case equi join, with nil = nil */ + cmp_left = 15, /* special case equi join, keep left order */ + cmp_left_project = 16 /* last step of outer join */ } comp_type; /* for ranges we keep the requirment for symmetric */ @@ -262,6 +263,7 @@ typedef struct sql_subtype { sql_type *type; unsigned int digits; unsigned int scale; + list* attributes; // attributes for a nested table } sql_subtype; /* sql_func need type transform rules types are equal if underlying diff --git a/sql/include/sql_relation.h b/sql/include/sql_relation.h --- a/sql/include/sql_relation.h +++ b/sql/include/sql_relation.h @@ -140,8 +140,6 @@ typedef struct expression { #define DDL_EMPTY 100 -#define MAXOPS 21 - typedef enum operator_type { op_basetable = 0, op_table, @@ -161,11 +159,14 @@ typedef enum operator_type { op_groupby, op_topn, op_sample, + op_unnest, op_insert, /* insert(l=table, r insert expressions) */ op_update, /* update(l=table, r update expressions) */ op_delete /* delete(l=table, r delete expression) */ } operator_type; +#define MAXOPS (op_delete +1) + #define is_atom(et) \ (et == e_atom) /* a simple atom is a literal or on the query stack */ diff --git a/sql/server/rel_rel.c b/sql/server/rel_rel.c --- a/sql/server/rel_rel.c +++ b/sql/server/rel_rel.c @@ -374,6 +374,24 @@ rel_crossproduct(sql_allocator *sa, sql_ return rel; } + +sql_rel * +rel_unnest(sql_allocator* sa, sql_rel *l, sql_exp* e){ + sql_rel *rel = rel_create(sa); + + assert(exp_subtype(e)->type->eclass == EC_NESTED_TABLE); + assert(exp_subtype(e)->attributes != NULL); + assert(list_length(exp_subtype(e)->attributes) > 0); + + rel->l = l; + rel->r = e; + rel->op = op_unnest; + rel->exps = list_append(sa_list(sa), exp_compare(sa, exp_subtype(e)->attributes->h->data, NULL, cmp_unnest)); + rel->card = CARD_MULTI; + rel->nrcols = l->nrcols + list_length(exp_subtype(e)->attributes); + return rel; +} + sql_rel * rel_topn(sql_allocator *sa, sql_rel *l, list *exps ) { diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c --- a/sql/server/rel_select.c +++ b/sql/server/rel_select.c @@ -341,6 +341,16 @@ query_exp_optname(mvc *sql, sql_rel *r, return NULL; return rel_table_optname(sql, tq, q->data.lval->t->data.sym); } + case SQL_UNNEST: + { + sql_rel* tq = rel_unnestquery(sql, r, q); + + if(!tq) + return NULL; + + return rel_table_optname(sql, tq, q->data.lval->t->data.sym); + break; + } default: (void) sql_error(sql, 02, "case %d %s\n", q->token, token2string(q->token)); } @@ -3418,6 +3428,16 @@ static sql_exp * } } } + + // record the attributes for nested tables + if(a) { +
MonetDB: graph0 - Initialize the atom "nestedtable" and set the ...
Changeset: 46d4889b5c4c for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=46d4889b5c4c Modified Files: monetdb5/modules/atoms/nested_table.mal Branch: graph0 Log Message: Initialize the atom "nestedtable" and set the global var. TYPE_nested_table diffs (18 lines): diff --git a/monetdb5/modules/atoms/nested_table.mal b/monetdb5/modules/atoms/nested_table.mal --- a/monetdb5/modules/atoms/nested_table.mal +++ b/monetdb5/modules/atoms/nested_table.mal @@ -8,6 +8,11 @@ module nestedtable; atom nestedtable : oid; +command prelude() address NESTEDTABLEprelude; + command nest1(group_mapping :bat[:oid], histogram :bat[:lng]) :bat[:nestedtable] address NESTEDTABLEnest1_oid -comment "Create a nested table out of the grouped partitions"; \ No newline at end of file +comment "Create a nested table out of the grouped partitions"; + +# Initialize +nestedtable.prelude(); \ No newline at end of file ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: graph0 - Currently a nest of bugs...
Changeset: a8e9c0a2a7db for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a8e9c0a2a7db Added Files: monetdb5/modules/atoms/nested_table.c monetdb5/modules/atoms/nested_table.h monetdb5/modules/atoms/nested_table.mal sql/scripts/35_nested_table.sql Modified Files: gdk/gdk_private.h monetdb5/mal/mal_listing.c monetdb5/modules/atoms/Makefile.ag monetdb5/modules/mal/mal_init.mal sql/backends/monet5/rel_bin.c sql/common/sql_types.c sql/scripts/Makefile.ag Branch: graph0 Log Message: Currently a nest of bugs... diffs (297 lines): diff --git a/gdk/gdk_private.h b/gdk/gdk_private.h --- a/gdk/gdk_private.h +++ b/gdk/gdk_private.h @@ -155,9 +155,8 @@ void BBPdump(void); /* never called: fo __attribute__((__visibility__("hidden"))); __hidden Hash *HASHnew(Heap *hp, int tpe, BUN size, BUN mask, BUN count) __attribute__((__visibility__("hidden"))); -//__hidden gdk_return HEAPalloc(Heap *h, size_t nitems, size_t itemsize) -// __attribute__((__visibility__("hidden"))); -gdk_return HEAPalloc(Heap *h, size_t nitems, size_t itemsize); +__hidden gdk_return HEAPalloc(Heap *h, size_t nitems, size_t itemsize) + __attribute__((__visibility__("hidden"))); __hidden gdk_return HEAPcopy(Heap *dst, Heap *src) __attribute__((__visibility__("hidden"))); __hidden int HEAPdelete(Heap *h, const char *o, const char *ext) diff --git a/monetdb5/mal/mal_listing.c b/monetdb5/mal/mal_listing.c --- a/monetdb5/mal/mal_listing.c +++ b/monetdb5/mal/mal_listing.c @@ -294,13 +294,13 @@ instruction2str(MalBlkPtr mb, MalStkPtr case PATcall: case CMDcall: case ASSIGNsymbol : - // is any variable explicit or used - for (i = 0; i < p->retc; i++) - if ( !isTmpVar(mb,getArg(p,i)) || isVarUsed(mb, getArg(p, i)) || isVarUDFtype(mb,getArg(p,i))) - break; - - if (i == p->retc) - break; +// // is any variable explicit or used +// for (i = 0; i < p->retc; i++) +// if ( !isTmpVar(mb,getArg(p,i)) || isVarUsed(mb, getArg(p, i)) || isVarUDFtype(mb,getArg(p,i))) +// break; +// +// if (i == p->retc) +// break; /* display multi-assignment list */ if (p->retc > 1) diff --git a/monetdb5/modules/atoms/Makefile.ag b/monetdb5/modules/atoms/Makefile.ag --- a/monetdb5/modules/atoms/Makefile.ag +++ b/monetdb5/modules/atoms/Makefile.ag @@ -23,7 +23,7 @@ lib_atoms = { json.c json.h \ mcurl.c \ mtime.c mtime.h \ - nested.c \ + nested_table.c nested_table.h \ str.c str.h \ streams.c streams.h \ url.c url.h \ @@ -43,7 +43,7 @@ headers_mal = { json.mal \ mcurl.mal \ mtime.mal \ - nested.mal \ + nested_table.mal \ streams.mal \ str.mal \ url.mal \ diff --git a/monetdb5/modules/atoms/nested_table.c b/monetdb5/modules/atoms/nested_table.c new file mode 100644 --- /dev/null +++ b/monetdb5/modules/atoms/nested_table.c @@ -0,0 +1,123 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * Copyright 1997 - July 2008 CWI, August 2008 - 2017 MonetDB B.V. + */ + +#include "monetdb_config.h" + +#include "mal.h" +#include "mal_exception.h" +#include "gdk_bbp.h" + +// errors +#if !defined(NDEBUG) /* debug only */ +#define _CHECK_ERRLINE_EXPAND(LINE) #LINE +#define _CHECK_ERRLINE(LINE) _CHECK_ERRLINE_EXPAND(LINE) +#define _CHECK_ERRMSG(EXPR, ERROR) "[" __FILE__ ":" _CHECK_ERRLINE(__LINE__) "] " ERROR ": `" #EXPR "'" +#else /* release mode */ +#define _CHECK_ERRMSG(EXPR, ERROR) ERROR +#endif +#define CHECK( EXPR, ERROR ) if ( !(EXPR) ) \ + { rc = createException(MAL, function_name /*__FUNCTION__?*/, _CHECK_ERRMSG( EXPR, ERROR ) ); goto error; } + +// prototypes +mal_export str NESTEDTABLEnest1_oid(bat*, const bat*, const bat*); +mal_export str NESTEDTABLEprelude(void*); + +// index in the BATatoms table +int TYPE_nested_table; + +// initializer +str NESTEDTABLEprelude(void* ret) { + atomDesc* descriptor = NULL; + + (void) ret; + TYPE_nested_table = ATOMindex("nestedtable"); + descriptor = BATatoms + TYPE_nested_table; + descriptor->size = descriptor->align = sizeof(var_t); + descriptor->linear = FALSE; + return MAL_SUCCEED; +} + +// MAL interface +mal_export str NESTEDTABLEnest1_oid(bat* id_out, const bat* id_group_mapping, const bat* id_histogram) { + const char* function_name = "nestedtable.nest1"; +
MonetDB: graph0 - MAL entry point
Changeset: 8c41694f7605 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8c41694f7605 Modified Files: gdk/gdk_private.h monetdb5/modules/atoms/Makefile.ag sql/backends/monet5/rel_bin.c sql/backends/monet5/sql_statement.c sql/backends/monet5/sql_statement.h sql/scripts/Makefile.ag sql/server/rel_select.c Branch: graph0 Log Message: MAL entry point diffs (171 lines): diff --git a/gdk/gdk_private.h b/gdk/gdk_private.h --- a/gdk/gdk_private.h +++ b/gdk/gdk_private.h @@ -155,8 +155,9 @@ void BBPdump(void); /* never called: fo __attribute__((__visibility__("hidden"))); __hidden Hash *HASHnew(Heap *hp, int tpe, BUN size, BUN mask, BUN count) __attribute__((__visibility__("hidden"))); -__hidden gdk_return HEAPalloc(Heap *h, size_t nitems, size_t itemsize) - __attribute__((__visibility__("hidden"))); +//__hidden gdk_return HEAPalloc(Heap *h, size_t nitems, size_t itemsize) +// __attribute__((__visibility__("hidden"))); +gdk_return HEAPalloc(Heap *h, size_t nitems, size_t itemsize); __hidden gdk_return HEAPcopy(Heap *dst, Heap *src) __attribute__((__visibility__("hidden"))); __hidden int HEAPdelete(Heap *h, const char *o, const char *ext) diff --git a/monetdb5/modules/atoms/Makefile.ag b/monetdb5/modules/atoms/Makefile.ag --- a/monetdb5/modules/atoms/Makefile.ag +++ b/monetdb5/modules/atoms/Makefile.ag @@ -23,6 +23,7 @@ lib_atoms = { json.c json.h \ mcurl.c \ mtime.c mtime.h \ + nested.c \ str.c str.h \ streams.c streams.h \ url.c url.h \ @@ -42,6 +43,7 @@ headers_mal = { json.mal \ mcurl.mal \ mtime.mal \ + nested.mal \ streams.mal \ str.mal \ url.mal \ diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c --- a/sql/backends/monet5/rel_bin.c +++ b/sql/backends/monet5/rel_bin.c @@ -495,7 +495,11 @@ exp_bin(backend *be, sql_exp *e, stmt *l as = const_column(be, as); } } - s = stmt_aggr(be, as, grp, ext, a, 1, need_no_nil(e) /* ignore nil*/ ); + if(strcmp(a->aggr->base.name, "nest") == 0 && strcmp(a->aggr->s->base.name, "sys") == 0){ + s = stmt_nest(be, as, grp, ext, cnt, a); + } else { + s = stmt_aggr(be, as, grp, ext, a, 1, need_no_nil(e) /* ignore nil*/ ); + } if (find_prop(e->p, PROP_COUNT)) /* propagate count == 0 ipv NULL in outer joins */ s->flag |= OUTER_ZERO; } break; diff --git a/sql/backends/monet5/sql_statement.c b/sql/backends/monet5/sql_statement.c --- a/sql/backends/monet5/sql_statement.c +++ b/sql/backends/monet5/sql_statement.c @@ -2878,6 +2878,36 @@ stmt_aggr(backend *be, stmt *op1, stmt * return NULL; } +stmt *stmt_nest(backend *be, stmt *ops, stmt *grp, stmt *ext, stmt *histo, sql_subaggr *aggr){ + InstrPtr q = NULL; + + (void) ext; // not used ftm + assert(ops->type == st_list); + + q = newStmt(be->mb, aggr->aggr->mod, aggr->aggr->imp); + if(!q) return NULL; + setVarType(be->mb, getArg(q, 0), newBatType( ((sql_subtype*) aggr->res->h->data)->type->localtype )); + setVarUDFtype(be->mb, getArg(q, 0)); // TODO: what is this? + q = pushArgument(be->mb, q, grp->nr); + q = pushArgument(be->mb, q, histo->nr); + + if(q) { // same as stmt_aggr + stmt *s = stmt_create(be->mvc->sa, st_aggr); + s->op1 = ops; + s->op2 = grp; + s->op3 = histo; + s->nrcols = 1; + s->key = s->aggr = true; + s->flag = 1; + s->op4.aggrval = aggr; + s->nr = getDestVar(q); + s->q = q; + return s; + } + return NULL; + +} + static stmt * stmt_alias_(backend *be, stmt *op1, const char *tname, const char *alias) { diff --git a/sql/backends/monet5/sql_statement.h b/sql/backends/monet5/sql_statement.h --- a/sql/backends/monet5/sql_statement.h +++ b/sql/backends/monet5/sql_statement.h @@ -217,6 +217,7 @@ extern stmt *stmt_binop(backend *be, stm extern stmt *stmt_Nop(backend *be, stmt *ops, sql_subfunc *op); extern stmt *stmt_func(backend *be, stmt *ops, const char *name, sql_rel *imp, int f_union); extern stmt *stmt_aggr(backend *be, stmt *op1, stmt *grp, stmt *ext, sql_subaggr *op, int reduce, int no_nil); +extern stmt *stmt_nest(backend *be, stmt *ops, stmt *grp, stmt *ext, stmt *histo, sql_subaggr *aggr); extern stmt *stmt_alias(backend *be, stmt *op1, const char *tname, const char *name); diff --git a/sql/scripts/Makefile.ag b/sql/scripts/Makefile.ag --- a/sql/scripts/Makefile.ag +++
MonetDB: graph0 - add the nested_table type
Changeset: 0ae0eaefe7a3 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0ae0eaefe7a3 Modified Files: sql/common/sql_types.c sql/common/sql_types.h sql/server/rel_dump.c sql/server/rel_dump.h sql/server/rel_optimizer.c Branch: graph0 Log Message: add the nested_table type diffs (134 lines): diff --git a/sql/common/sql_types.c b/sql/common/sql_types.c --- a/sql/common/sql_types.c +++ b/sql/common/sql_types.c @@ -528,7 +528,7 @@ sql_bind_aggr_(sql_allocator *sa, sql_sc sql_func *a = n->data; if (strcmp(a->base.name, sqlaname) == 0 && - list_cmp(a->ops, ops, (fcmp) _subtype_cmp) == 0) + (list_cmp(a->ops, ops, (fcmp) _subtype_cmp) == 0 || a->vararg)) return _dup_subaggr(sa, a, type); n = n->next; } @@ -542,7 +542,7 @@ sql_bind_aggr_(sql_allocator *sa, sql_sc continue; if (strcmp(a->base.name, sqlaname) == 0 && - list_cmp(a->ops, ops, (fcmp) _subtype_cmp) == 0) + (list_cmp(a->ops, ops, (fcmp) _subtype_cmp) == 0 || a->vararg)) return _dup_subaggr(sa, a, type); } } @@ -733,7 +733,7 @@ sql_find_func(sql_allocator *sa, sql_sch assert(nrargs); MT_lock_set(>ht_lock); - he = funcs->ht->buckets[key&(funcs->ht->size-1)]; + he = funcs->ht->buckets[key&(funcs->ht->size-1)]; if (prev) { for (; he && !found; he = he->chain) if (he->value == prev->func) @@ -1346,6 +1346,8 @@ sqltypeinit( sql_allocator *sa) *t++ = sql_create_type(sa, "BLOB", 0, 0, 0, EC_BLOB, "sqlblob"); + *t++ = sql_create_type(sa, "NESTED_TABLE", 0, 0, 0, EC_NESTED_TABLE, "nested_table"); + if (geomcatalogfix_get() != NULL) { // the geom module is loaded GEOM = *t++ = sql_create_type(sa, "GEOMETRY", 0, SCALE_NONE, 0, EC_GEOM, "wkb"); diff --git a/sql/common/sql_types.h b/sql/common/sql_types.h --- a/sql/common/sql_types.h +++ b/sql/common/sql_types.h @@ -42,6 +42,7 @@ #define EC_TEMP(e) (e==EC_TIME||e==EC_DATE||e==EC_TIMESTAMP) #define EC_GEOM15 #define EC_EXTERNAL16 +#define EC_NESTED_TABLE 17 #define EC_TEMP_FRAC(e)(e==EC_TIME||e==EC_TIMESTAMP) diff --git a/sql/server/rel_dump.c b/sql/server/rel_dump.c --- a/sql/server/rel_dump.c +++ b/sql/server/rel_dump.c @@ -1346,3 +1346,48 @@ rel_read(mvc *sql, char *r, int *pos, li return rel; } +// DEBUG ONLY -- copy & paste from sql_gencode.c + decorate = TRUE +// use with case, the result needs to be freed once used +str +dump_rel(mvc *sql, sql_rel *rel) +{ + buffer *b; + stream *s = buffer_wastream(b = buffer_create(1024), "rel_dump"); + list *refs = sa_list(sql->sa); + char *res = NULL; + + rel_print_refs(sql, s, rel, 0, refs, TRUE); + rel_print_(sql, s, rel, 0, refs, TRUE); + mnstr_printf(s, "\n"); + res = buffer_get_buf(b); // leaks memory + buffer_destroy(b); + mnstr_destroy(s); + return res; +} + +// use with case, the result needs to be freed once used +str +dump_exps(mvc *sql, list *exps){ + buffer *b; + stream *s = buffer_wastream(b = buffer_create(1024), "rel_dump"); + char *res = NULL; + + exps_print(sql, s, exps, 0, /*alias=*/ 1, /*brackets=*/0); + mnstr_printf(s, "\n"); + res = buffer_get_buf(b); // leaks memory + buffer_destroy(b); + mnstr_destroy(s); + return res; +} + +str +dump(mvc *sql, void* data){ + typedef struct { int32_t x; int32_t y; } T; + T* tmp = (T*) data; + if(tmp->x < 10 /*arbitrary value*/ && tmp->y <= op_delete){ + return dump_rel(sql, data); + } else { + return dump_exps(sql, data); + } +} + diff --git a/sql/server/rel_dump.h b/sql/server/rel_dump.h --- a/sql/server/rel_dump.h +++ b/sql/server/rel_dump.h @@ -18,4 +18,9 @@ extern const char *op2string(operator_ty extern sql_rel *rel_read(mvc *sql, char *ra, int *pos, list *refs); +// DEBUG ONLY +extern str dump_rel(mvc *sql, sql_rel *rel); +extern str dump_exps(mvc *sql, list *exps); +extern str dump(mvc *sql, void* data); + #endif /*_REL_DUMP_H_*/ diff --git a/sql/server/rel_optimizer.c b/sql/server/rel_optimizer.c --- a/sql/server/rel_optimizer.c +++ b/sql/server/rel_optimizer.c @@ -8824,6 +8824,8 @@ static sql_rel * return rel; } + printf("QRW EXIT [%d]: %s\n", level, dump_rel(sql, rel)); + if (changes || level == 0) return _rel_optimizer(sql, rel, ++level); @@ -8833,5 +8835,6 @@ static sql_rel * sql_rel * rel_optimizer(mvc *sql, sql_rel *rel) { + printf("QRW ENTRY: %s\n", dump_rel(sql, rel)); return _rel_optimizer(sql, rel, 0); }
MonetDB: graph0 - Copy .gitignore from graph/master
Changeset: b49704b45808 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b49704b45808 Added Files: .gitignore Branch: graph0 Log Message: Copy .gitignore from graph/master diffs (124 lines): diff --git a/.gitignore b/.gitignore new file mode 100644 --- /dev/null +++ b/.gitignore @@ -0,0 +1,119 @@ +# Copy of .hgignore +#syntax: glob + +# This ignore file purposely does not cater for building in situ. We +# recommend that you build in a directory other than the source +# directory. + +# You can add files to the ignore list by creating your private ignore +# file in your .hg directory. Add these two lines to your .hg/hgrc +# file: +# [ui] +# ignore = /hgignore +# and create a file .hg/hgignore that contains your ignore patterns. + +# This file contains patterns of files that get generated by the +# recommended build process plus a few patterns of files that we never +# want in the repository (object files and such). + +# files generated by bootstrap +Makefile.am +Makefile.in +Makefile.msc +aclocal.m4 +acout.in +autom4te.cache +buildtools/conf/compile +buildtools/conf/config.guess +buildtools/conf/config.sub +buildtools/conf/install-sh +buildtools/conf/libtool.m4 +buildtools/conf/ltmain.sh +buildtools/conf/ltoptions.m4 +buildtools/conf/ltsugar.m4 +buildtools/conf/ltversion.m4 +buildtools/conf/lt~obsolete.m4 +buildtools/conf/missing +buildtools/conf/ylwrap +configure +configure.ac +doc.lst +install.lst +monetdb_config.h.in +*.pyc + +# files generated by various editors +*.swp +*~ +\#* +.#* + +# files generated by compilers +lex.yy.c +*.tab.c +*.tab.h +.libs +*.exe +*.exe.manifest +*.la +*.lo +*.o +*.obj +*.lib +# notwithstanding clients/odbc/winsetup/winredist/*.dll: +*.dll +# ruby: +*.gem +# java: +*.jar +java/build +java/target +java/bin +java/src/main/java/nl/cwi/monetdb/jdbc/MonetDriver.java +# python: +dist + +# other files we don't want +TAGS +tags +*.elc +*.pyo +*.rej +*.orig + +# build results on Windows +NT/.monetdb +NT/buildtools +NT/clients +NT/common +NT/gdk +NT/geom +NT/inttypes.h +NT/java +NT/monetdb5 +NT/monetdb_config.h +NT/sql +NT/testing +NT/tools +NT/unistd.h + +# package building on Mac OS X +MacOSX/build +MacOSX/usr + +# Build directory +BUILD + +syntax: regexp +^java/build$ +syntax: regexp +^java/target$ + + +# Eclipse +/.cproject +/.project +/.settings/ +/build +/symbols.xml +/Default/ ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: Jul2017 - Make thread safe.
Changeset: dbc145adc6f5 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=dbc145adc6f5 Modified Files: monetdb5/modules/kernel/bat5.c Branch: Jul2017 Log Message: Make thread safe. diffs (47 lines): diff --git a/monetdb5/modules/kernel/bat5.c b/monetdb5/modules/kernel/bat5.c --- a/monetdb5/modules/kernel/bat5.c +++ b/monetdb5/modules/kernel/bat5.c @@ -146,15 +146,11 @@ infoHeap(BAT *bk, BAT*bv, Heap *hp, str return GDK_SUCCEED; } -static char * -oidtostr(oid i) +static inline char * +oidtostr(oid i, char *p, int len) { - int len = 48; - static char bf[48]; - char *p = bf; - (void) OIDtoStr(, , ); - return bf; + return p; } /* @@ -673,6 +669,7 @@ BKCinfo(bat *ret1, bat *ret2, const bat { const char *mode, *accessmode; BAT *bk = NULL, *bv= NULL, *b; + char bf[oidStrlen]; if ((b = BATdescriptor(*bid)) == NULL) { throw(MAL, "bat.getInfo", RUNTIME_OBJECT_MISSING); @@ -737,14 +734,14 @@ BKCinfo(bat *ret1, bat *ret2, const bat BUNappend(bv, BATdirty(b) ? "dirty" : "clean", FALSE) != GDK_SUCCEED || BUNappend(bk, "hseqbase", FALSE) != GDK_SUCCEED || - BUNappend(bv, oidtostr(b->hseqbase), FALSE) != GDK_SUCCEED || + BUNappend(bv, oidtostr(b->hseqbase, bf, (int) sizeof(bf)), FALSE) != GDK_SUCCEED || BUNappend(bk, "tident", FALSE) != GDK_SUCCEED || BUNappend(bv, b->tident, FALSE) != GDK_SUCCEED || BUNappend(bk, "tdense", FALSE) != GDK_SUCCEED || BUNappend(bv, local_itoa((ssize_t)(BATtdense(b))), FALSE) != GDK_SUCCEED || BUNappend(bk, "tseqbase", FALSE) != GDK_SUCCEED || - BUNappend(bv, oidtostr(b->tseqbase), FALSE) != GDK_SUCCEED || + BUNappend(bv, oidtostr(b->tseqbase, bf, (int) sizeof(bf)), FALSE) != GDK_SUCCEED || BUNappend(bk, "tsorted", FALSE) != GDK_SUCCEED || BUNappend(bv, local_itoa((ssize_t)BATtordered(b)), FALSE) != GDK_SUCCEED || BUNappend(bk, "trevsorted", FALSE) != GDK_SUCCEED || ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: Jul2017 - Get rid of one completely unnecessary goto.
Changeset: 32cfde883fe6 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=32cfde883fe6 Modified Files: monetdb5/modules/mal/tablet.c Branch: Jul2017 Log Message: Get rid of one completely unnecessary goto. diffs (96 lines): diff --git a/monetdb5/modules/mal/tablet.c b/monetdb5/modules/mal/tablet.c --- a/monetdb5/modules/mal/tablet.c +++ b/monetdb5/modules/mal/tablet.c @@ -1085,48 +1085,47 @@ SQLload_parse_line(READERtask *task, int if (!fmt->skip && (!quote || !fmt->null_length) && fmt->nullstr && task->fields[i][idx] && strncasecmp(task->fields[i][idx], fmt->nullstr, fmt->null_length + 1) == 0) task->fields[i][idx] = 0; } - goto endofline; - } - assert(!task->quote); - assert(task->seplen == 1); - for (i = 0; i < as->nr_attrs; i++) { - task->fields[i][idx] = line; + } else { + assert(!task->quote); + assert(task->seplen == 1); + for (i = 0; i < as->nr_attrs; i++) { + task->fields[i][idx] = line; #ifdef _DEBUG_TABLET_ - mnstr_printf(GDKout, "before #2 %s\n", line); + mnstr_printf(GDKout, "before #2 %s\n", line); #endif - /* eat away the column separator */ - for (; *line; line++) - if (*line == '\\') { - if (line[1]) + /* eat away the column separator */ + for (; *line; line++) + if (*line == '\\') { + if (line[1]) + line++; + } else if (*line == ch) { + *line = 0; line++; - } else if (*line == ch) { - *line = 0; - line++; - goto endoffield2; + goto endoffield2; + } +#ifdef _DEBUG_TABLET_ + mnstr_printf(GDKout, "#after #23 %s\n", line); +#endif + /* not enough fields */ + if (i < as->nr_attrs - 1) { + errline = SQLload_error(task, idx,i+1); + snprintf(errmsg, BUFSIZ, "Column value "BUNFMT" missing",i+1); + tablet_error(task, idx, (int) i, errmsg, errline); + GDKfree(errline); + error++; + /* we save all errors detected */ + for (; i < as->nr_attrs; i++) + task->fields[i][idx] = NULL; + i--; } -#ifdef _DEBUG_TABLET_ - mnstr_printf(GDKout, "#after #23 %s\n", line); -#endif - /* not enough fields */ - if (i < as->nr_attrs - 1) { - errline = SQLload_error(task, idx,i+1); - snprintf(errmsg, BUFSIZ, "Column value "BUNFMT" missing",i+1); - tablet_error(task, idx, (int) i, errmsg, errline); - GDKfree(errline); - error++; - /* we save all errors detected */ - for (; i < as->nr_attrs; i++) - task->fields[i][idx] = NULL; - i--; - } - endoffield2: - ; - /* check for user defined NULL string */ - if (fmt->nullstr && task->fields[i][idx] && strncasecmp(task->fields[i][idx], fmt->nullstr, fmt->null_length + 1) == 0) { - task->fields[i][idx] = 0; + endoffield2: + ; + /* check for user defined NULL string */ + if (fmt->nullstr && task->fields[i][idx] && strncasecmp(task->fields[i][idx], fmt->nullstr, fmt->null_length + 1) == 0) { + task->fields[i][idx] = 0; + } } } -endofline: /* check for too many values as well*/ if (line && *line && i == as->nr_attrs) { errline = SQLload_error(task, idx, task->as->nr_attrs); @@ -1867,7 +1866,7 @@ SQLload_file(Client cntxt, Tablet *as, b #define trimerrors(TYPE) \ do { \ TYPE *src, *dst; \ -
MonetDB: viewless - Do not use BATslice to slice a candidate lis...
Changeset: 3822af945f28 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3822af945f28 Modified Files: gdk/gdk_cand.c gdk/gdk_private.h gdk/gdk_select.c Branch: viewless Log Message: Do not use BATslice to slice a candidate list, but CANDlist. A BATslice might lead to a view, which we want to get rid of. Instead use a CANDslice. diffs (240 lines): diff --git a/gdk/gdk_cand.c b/gdk/gdk_cand.c --- a/gdk/gdk_cand.c +++ b/gdk/gdk_cand.c @@ -20,14 +20,14 @@ BAT * CANDnewdense(oid first, oid last) { - BAT *bn; - if ((bn = COLnew(0, TYPE_void, 0, TRANSIENT)) == NULL) + BAT *s; + if ((s = COLnew(0, TYPE_void, 0, TRANSIENT)) == NULL) return NULL; if (last < first) first = last = 0; /* empty range */ - BATsetcount(bn, last - first + 1); - BATtseqbase(bn, first); - return bn; + BATsetcount(s, last - first + 1); + BATtseqbase(s, first); + return s; } /* binary search in a candidate list, return 1 if found, 0 if not */ @@ -87,3 +87,76 @@ CANDvirtualize(BAT *bn) return bn; } +BAT * +CANDdoublerange(oid l1, oid h1, oid l2, oid h2) +{ + BAT *bn; + oid *restrict p; + + assert(l1 <= h1); + assert(l2 <= h2); + assert(h1 <= l2); + if (l1 == h1 || l2 == h2) { + bn = COLnew(0, TYPE_void, h1 - l1 + h2 - l2, TRANSIENT); + if (bn == NULL) + return NULL; + BATsetcount(bn, h1 - l1 + h2 - l2); + BATtseqbase(bn, l1 == h1 ? l2 : l1); + return bn; + } + bn = COLnew(0, TYPE_oid, h1 - l1 + h2 - l2, TRANSIENT); + if (bn == NULL) + return NULL; + BATsetcount(bn, h1 - l1 + h2 - l2); + p = (oid *) Tloc(bn, 0); + while (l1 < h1) + *p++ = l1++; + while (l2 < h2) + *p++ = l2++; + bn->tkey = 1; + bn->tsorted = 1; + bn->trevsorted = BATcount(bn) <= 1; + bn->tnil = 0; + bn->tnonil = 1; + return bn; +} + +BAT * +CANDdoubleslice(BAT *s, BUN l1, BUN h1, BUN l2, BUN h2) +{ + BAT *bn; + oid *restrict p; + const oid *restrict o; + + assert(l1 <= h1); + assert(l2 <= h2); + assert(h1 <= l2); + assert(s->tsorted); + assert(s->tkey); + if (s->ttype == TYPE_void) + return CANDdoublerange(l1 + s->tseqbase, h1 + s->tseqbase, + l2 + s->tseqbase, h2 + s->tseqbase); + bn = COLnew(0, TYPE_oid, h1 - l1 + h2 - l2, TRANSIENT); + if (bn == NULL) + return NULL; + BATsetcount(bn, h1 - l1 + h2 - l2); + p = (oid *) Tloc(bn, 0); + o = (const oid *) Tloc(s, l1); + while (l1++ < h1) + *p++ = *o++; + o = (const oid *) Tloc(s, l2); + while (l2++ < h2) + *p++ = *o++; + bn->tkey = 1; + bn->tsorted = 1; + bn->trevsorted = BATcount(bn) <= 1; + bn->tnil = 0; + bn->tnonil = 1; + return CANDvirtualize(bn); +} + +BAT * +CANDslice(BAT *s, BUN l, BUN h) +{ + return CANDdoubleslice(s, 0,0, l, h); +} diff --git a/gdk/gdk_private.h b/gdk/gdk_private.h --- a/gdk/gdk_private.h +++ b/gdk/gdk_private.h @@ -226,6 +226,13 @@ void BBPdump(void);/* never called: fo __attribute__((__visibility__("hidden"))); __hidden BAT *CANDnewdense(oid first, oid last) __attribute__((__visibility__("hidden"))); +__hidden BAT *CANDslice(BAT *s, BUN l, BUN h) + __attribute__((__visibility__("hidden"))); +__hidden BAT *CANDdoubleslice(BAT *s, BUN l1, BUN h1, BUN l2, BUN h2) + __attribute__((__visibility__("hidden"))); +__hidden BAT *CANDdoublerange(oid l1, oid h1, oid l2, oid h2) + __attribute__((__visibility__("hidden"))); + __hidden void gdk_bbp_reset(void) diff --git a/gdk/gdk_select.c b/gdk/gdk_select.c --- a/gdk/gdk_select.c +++ b/gdk/gdk_select.c @@ -46,74 +46,6 @@ newempty(void) return bn; } -static BAT * -doublerange(oid l1, oid h1, oid l2, oid h2) -{ - BAT *bn; - oid *restrict p; - - assert(l1 <= h1); - assert(l2 <= h2); - assert(h1 <= l2); - if (l1 == h1 || l2 == h2) { - bn = COLnew(0, TYPE_void, h1 - l1 + h2 - l2, TRANSIENT); - if (bn == NULL) - return NULL; - BATsetcount(bn, h1 - l1 + h2 - l2); - BATtseqbase(bn, l1 == h1 ? l2 : l1); - return bn; - } - bn = COLnew(0, TYPE_oid, h1 - l1 + h2 - l2, TRANSIENT); - if (bn == NULL) - return NULL; - BATsetcount(bn, h1 - l1 + h2 - l2); - p = (oid *) Tloc(bn, 0); - while (l1 < h1) - *p++ = l1++; - while (l2 < h2) - *p++ = l2++; - bn->tkey = 1; - bn->tsorted = 1; - bn->trevsorted = BATcount(bn) <= 1; - bn->tnil = 0; -
MonetDB: viewless - moving shared candidate related function to ...
Changeset: 4fb5c7d4f9fa for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4fb5c7d4f9fa Added Files: gdk/gdk_cand.c Modified Files: gdk/Makefile.ag gdk/gdk_batop.c gdk/gdk_group.c gdk/gdk_join.c gdk/gdk_private.h gdk/gdk_select.c gdk/gdk_unique.c Branch: viewless Log Message: moving shared candidate related function to gdk_cand.c also introduce the CAND prefix for these functions diffs (truncated from 384 to 300 lines): diff --git a/gdk/Makefile.ag b/gdk/Makefile.ag --- a/gdk/Makefile.ag +++ b/gdk/Makefile.ag @@ -16,7 +16,7 @@ lib_gdk = { gdk_calc.c gdk_calc.h gdk_calc_compare.h gdk_calc_private.h \ gdk_ssort.c gdk_ssort_impl.h \ gdk_aggr.c \ - gdk.h gdk_cand.h gdk_atomic.h gdk_batop.c \ + gdk.h gdk_cand.h gdk_cand.c gdk_atomic.h gdk_batop.c \ gdk_search.c gdk_hash.c gdk_hash.h gdk_tm.c \ gdk_orderidx.c \ gdk_align.c gdk_bbp.c gdk_bbp.h \ diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c --- a/gdk/gdk_batop.c +++ b/gdk/gdk_batop.c @@ -1957,7 +1957,7 @@ BATmergecand(BAT *a, BAT *b) bn->tkey = 1; bn->tnil = 0; bn->tnonil = 1; - return virtualize(bn); + return CANDvirtualize(bn); } /* intersect two candidate lists and produce a new one @@ -2044,5 +2044,5 @@ BATintersectcand(BAT *a, BAT *b) bn->tkey = 1; bn->tnil = 0; bn->tnonil = 1; - return virtualize(bn); + return CANDvirtualize(bn); } diff --git a/gdk/gdk_cand.c b/gdk/gdk_cand.c new file mode 100644 --- /dev/null +++ b/gdk/gdk_cand.c @@ -0,0 +1,89 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * Copyright 1997 - July 2008 CWI, August 2008 - 2017 MonetDB B.V. + */ + +#include "monetdb_config.h" +#include "gdk.h" +#include "gdk_private.h" +#include "gdk_cand.h" + +/* This file contains function to create and manipulate candidate + * lists. The functions are shared across GDK and are inlined if + * needed. + */ + +/* create a new dense candiate list */ +BAT * +CANDnewdense(oid first, oid last) +{ + BAT *bn; + if ((bn = COLnew(0, TYPE_void, 0, TRANSIENT)) == NULL) + return NULL; + if (last < first) + first = last = 0; /* empty range */ + BATsetcount(bn, last - first + 1); + BATtseqbase(bn, first); + return bn; +} + +/* binary search in a candidate list, return 1 if found, 0 if not */ +inline int +CANDbinsearch(const oid *cand, BUN lo, BUN hi, oid v) +{ + BUN mid; + + --hi; /* now hi is inclusive */ + if (v < cand[lo] || v > cand[hi]) + return 0; + while (hi > lo) { + mid = (lo + hi) / 2; + if (cand[mid] == v) + return 1; + if (cand[mid] < v) + lo = mid + 1; + else + hi = mid - 1; + } + return cand[lo] == v; +} + +/* makes sure that a candidate list is virtualized to dense when possible */ +BAT * +CANDvirtualize(BAT *bn) +{ + /* input must be a valid candidate list or NULL */ + assert(bn == NULL || + (((bn->ttype == TYPE_void && bn->tseqbase != oid_nil) || +bn->ttype == TYPE_oid) && + bn->tkey && bn->tsorted)); + /* since bn has unique and strictly ascending tail values, we +* can easily check whether the tail is dense */ + if (bn && bn->ttype == TYPE_oid && + (BATcount(bn) <= 1 || +* (const oid *) Tloc(bn, 0) + BATcount(bn) - 1 == +* (const oid *) Tloc(bn, BUNlast(bn) - 1))) { + /* tail is dense, replace by virtual oid */ + ALGODEBUG fprintf(stderr, "#CANDvirtualize(bn=%s#"BUNFMT",seq="OIDFMT")\n", + BATgetId(bn), BATcount(bn), + BATcount(bn) > 0 ? * (const oid *) Tloc(bn, 0) : 0); + if (BATcount(bn) == 0) + bn->tseqbase = 0; + else + bn->tseqbase = * (const oid *) Tloc(bn, 0); + bn->tdense = 1; + HEAPfree(>theap, 1); + bn->theap.storage = bn->theap.newstorage = STORE_MEM; + bn->theap.size = 0; + bn->ttype = TYPE_void; + bn->tvarsized = 1; + bn->twidth = 0; + bn->tshift = 0; + } + + return bn; +} + diff --git a/gdk/gdk_group.c b/gdk/gdk_group.c --- a/gdk/gdk_group.c +++ b/gdk/gdk_group.c @@ -1061,7 +1061,7 @@ BATgroup_internal(BAT **groups, BAT **ex en->trevsorted = ngrp == 1; en->tnonil = 1; en->tnil = 0; -
MonetDB: viewless - Define a viewless macro that checks if a bat...
Changeset: 973f9c5e5306 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=973f9c5e5306 Modified Files: gdk/gdk.h Branch: viewless Log Message: Define a viewless macro that checks if a bat is a view or not diffs (11 lines): diff --git a/gdk/gdk.h b/gdk/gdk.h --- a/gdk/gdk.h +++ b/gdk/gdk.h @@ -2646,6 +2646,7 @@ gdk_export void ALIGNsetT(BAT *b1, BAT * ((x)->theap.parentid ||\ ((x)->tvheap && (x)->tvheap->parentid != (x)->batCacheid))) +#define viewless(x) (!VIEWtparent(x) && !VIEWvtparent(x)) #define VIEWtparent(x) ((x)->theap.parentid) #define VIEWvtparent(x)((x)->tvheap == NULL || (x)->tvheap->parentid == (x)->batCacheid ? 0 : (x)->tvheap->parentid) ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: wlcr - We need to check the result of BUNappend
Changeset: 5d2ffa2339a3 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5d2ffa2339a3 Modified Files: sql/backends/monet5/wlr.c Branch: wlcr Log Message: We need to check the result of BUNappend (or it will not compile) diffs (183 lines): diff --git a/sql/backends/monet5/wlr.c b/sql/backends/monet5/wlr.c --- a/sql/backends/monet5/wlr.c +++ b/sql/backends/monet5/wlr.c @@ -574,7 +574,7 @@ WLRaction(Client cntxt, MalBlkPtr mb, Ma str WLRcatalog(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci) -{ +{ return WLRquery(cntxt,mb,stk,pci); } @@ -589,22 +589,31 @@ WLRgeneric(Client cntxt, MalBlkPtr mb, M return MAL_SUCCEED; } +/* TODO: Martin take a look at this. + * + * PSA: DO NOT USE THIS OUT OF WLRappend or very bad things will happen! + * (variable msg and tag cleanup will not be defined). + */ #define WLRcolumn(TPE) \ - for( i = 4; i < pci->argc; i++){\ - TPE val = *getArgReference_##TPE(stk,pci,i);\ - BUNappend(ins, (void*) , FALSE);\ - } +for( i = 4; i < pci->argc; i++){\ +TPE val = *getArgReference_##TPE(stk,pci,i);\ +if (BUNappend(ins, (void*) , FALSE) != GDK_SUCCEED) { \ +msg = createException(MAL, "WLRappend", "BUNappend failed"); \ +goto cleanup; \ +} \ +} str WLRappend(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci) -{ str sname, tname, cname; -int tpe,i; +{ +str sname, tname, cname; +int tpe,i; mvc *m=NULL; sql_schema *s; sql_table *t; sql_column *c; BAT *ins = 0; - str msg= MAL_SUCCEED; +str msg = MAL_SUCCEED; if( cntxt->wlc_kind == WLC_ROLLBACK || cntxt->wlc_kind == WLC_ERROR) return msg; @@ -646,7 +655,10 @@ WLRappend(Client cntxt, MalBlkPtr mb, Ma case TYPE_str: for( i = 4; i < pci->argc; i++){ str val = *getArgReference_str(stk,pci,i); - BUNappend(ins, (void*) val, FALSE); +if (BUNappend(ins, (void*) val, FALSE) != GDK_SUCCEED) { +msg = createException(MAL, "WLRappend", "BUNappend failed"); +goto cleanup; +} } break; } @@ -657,17 +669,18 @@ WLRappend(Client cntxt, MalBlkPtr mb, Ma sql_idx *i = mvc_bind_idx(m, s, cname + 1); if (i) store_funcs.append_idx(m->session->tr, i, ins, tpe); - } +} + cleanup: BBPunfix(((BAT *) ins)->batCacheid); - return MAL_SUCCEED; +return msg; } str WLRdelete(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci) -{ +{ str sname, tname; -int i; +int i; mvc *m=NULL; sql_schema *s; sql_table *t; @@ -700,20 +713,31 @@ WLRdelete(Client cntxt, MalBlkPtr mb, Ma for( i = 3; i < pci->argc; i++){ o = *getArgReference_oid(stk,pci,i); - BUNappend(ins, (void*) , FALSE); +if (BUNappend(ins, (void*) , FALSE) != GDK_SUCCEED) { +msg = createException(MAL, "WLRdelete", "BUNappend failed"); +goto cleanup; +} } -store_funcs.delete_tab(m->session->tr, t, ins, TYPE_bat); +store_funcs.delete_tab(m->session->tr, t, ins, TYPE_bat); + cleanup: BBPunfix(((BAT *) ins)->batCacheid); - return MAL_SUCCEED; +return msg; } -#define WLRvalue(TPE) \ -{ TPE val = *getArgReference_##TPE(stk,pci,5);\ - BUNappend(upd, (void*) , FALSE);\ -} - +/* TODO: Martin take a look at this. + * + * PSA: DO NOT USE THIS OUT OF WLRupdate or very bad things will happen! + * (variable msg and tag cleanup will not be defined). + */ +#define WLRvalue(TPE) \ +{ TPE val = *getArgReference_##TPE(stk,pci,5);\ +if (BUNappend(upd, (void*) , FALSE) != GDK_SUCCEED) { \ +msg = createException(MAL, "WLRupdate", "BUNappend failed"); \ +goto cleanup; \ +} \ +} str WLRupdate(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci) @@ -757,7 +781,10 @@ WLRupdate(Client cntxt, MalBlkPtr mb, Ma BBPunfix(((BAT *) tids)->batCacheid); throw(SQL,"WLRupdate",MAL_MALLOC_FAIL); } - BUNappend(tids, , FALSE); +if (BUNappend(tids, , FALSE) != GDK_SUCCEED) { +msg =
MonetDB: wlcr - Merge with default
Changeset: 0f4eb8a8afe0 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0f4eb8a8afe0 Modified Files: .hgtags MonetDB.spec debian/changelog libversions monetdb5/ChangeLog-Archive monetdb5/ChangeLog.Dec2016 Branch: wlcr Log Message: Merge with default diffs (90 lines): diff --git a/.hgtags b/.hgtags --- a/.hgtags +++ b/.hgtags @@ -668,3 +668,6 @@ c57454c6c6f6e77fbbdf70de32a7cc845b67d1dd 07824a1c7beb75308b813378af33c243f1c2f511 Dec2016_SP4_release c57454c6c6f6e77fbbdf70de32a7cc845b67d1dd Dec2016_SP4_release 54a8c9d99dc3621a02579db0c59309781caceb54 Jul2017_root +05f4e62bc67911a25f19be7fe742009ab1ee41c7 Dec2016_21 +c57454c6c6f6e77fbbdf70de32a7cc845b67d1dd Dec2016_SP4_release +05f4e62bc67911a25f19be7fe742009ab1ee41c7 Dec2016_SP4_release diff --git a/MonetDB.spec b/MonetDB.spec --- a/MonetDB.spec +++ b/MonetDB.spec @@ -953,6 +953,16 @@ rm -f %{buildroot}%{_bindir}/Maddlog %postun -p /sbin/ldconfig %changelog +* Tue Apr 25 2017 Sjoerd Mullender <sjo...@acm.org> - 11.25.21-20170425 +- Rebuilt. +- BZ#6260: Sqlitelogictest crash +- BZ#6288: Function cannot find column in merge table +- BZ#6295: msqldump writes unescaped timestamp values when using inserts + +* Wed Apr 19 2017 Sjoerd Mullender <sjo...@acm.org> - 11.25.21-20170425 +- monetdb5: Fixed a bug causing a crash during cleanup when mserver5 is stopped + with monetdb stop database. + * Tue Apr 18 2017 Sjoerd Mullender <sjo...@acm.org> - 11.25.19-20170418 - Rebuilt. - BZ#6259: crash on select query from sqlitelogictests diff --git a/debian/changelog b/debian/changelog --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,19 @@ +monetdb (11.25.21) unstable; urgency=low + + * Rebuilt. + * BZ#6260: Sqlitelogictest crash + * BZ#6288: Function cannot find column in merge table + * BZ#6295: msqldump writes unescaped timestamp values when using inserts + + -- Sjoerd Mullender <sjo...@acm.org> Tue, 25 Apr 2017 11:05:40 +0200 + +monetdb (11.25.21) unstable; urgency=low + + * monetdb5: Fixed a bug causing a crash during cleanup when mserver5 is stopped +with monetdb stop database. + + -- Sjoerd Mullender <sjo...@acm.org> Wed, 19 Apr 2017 11:05:40 +0200 + monetdb (11.25.19) unstable; urgency=low * Rebuilt. diff --git a/libversions b/libversions --- a/libversions +++ b/libversions @@ -42,7 +42,7 @@ GDK_VERSION=14:6:1 MAPI_VERSION=8:1:0 # version of the MONETDB5 library (subdirectory monetdb5, not including extras) -MONETDB5_VERSION=22:5:1 +MONETDB5_VERSION=22:6:1 # version of the STREAM library (subdirectory common/stream) STREAM_VERSION=9:0:1 diff --git a/monetdb5/ChangeLog-Archive b/monetdb5/ChangeLog-Archive --- a/monetdb5/ChangeLog-Archive +++ b/monetdb5/ChangeLog-Archive @@ -1,6 +1,10 @@ # DO NOT EDIT THIS FILE -- MAINTAINED AUTOMATICALLY # This file contains past ChangeLog entries +* Wed Apr 19 2017 Sjoerd Mullender <sjo...@acm.org> - 11.25.21-20170425 +- Fixed a bug causing a crash during cleanup when mserver5 is stopped + with monetdb stop database. + * Tue Apr 18 2017 Sjoerd Mullender <sjo...@acm.org> - 11.25.19-20170418 - Some memory leaks were plugged. diff --git a/monetdb5/ChangeLog.Dec2016 b/monetdb5/ChangeLog.Dec2016 --- a/monetdb5/ChangeLog.Dec2016 +++ b/monetdb5/ChangeLog.Dec2016 @@ -1,7 +1,3 @@ # ChangeLog file for MonetDB5 # This file is updated with Maddlog -* Wed Apr 19 2017 Sjoerd Mullender <sjo...@acm.org> -- Fixed a bug causing a crash during cleanup when mserver5 is stopped - with monetdb stop database. - ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: arrays - Closing branch.
Changeset: 67e8463de132 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=67e8463de132 Branch: arrays Log Message: Closing branch. ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: grid - Closing branch.
Changeset: 5dbc41fc09aa for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5dbc41fc09aa Branch: grid Log Message: Closing branch. ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: default - Merge with Jul2017 branch.
Changeset: 04bd2993c2e2 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=04bd2993c2e2 Modified Files: .hgtags MonetDB.spec NT/monetdb_config.h.in NT/rules.msc clients/mapilib/mapi.rc clients/odbc/driver/driver.rc clients/odbc/winsetup/setup.rc configure.ag debian/changelog gdk/libbat.rc libversions monetdb5/ChangeLog-Archive monetdb5/ChangeLog.Dec2016 monetdb5/tools/libmonetdb5.rc vertoo.data Branch: default Log Message: Merge with Jul2017 branch. diffs (90 lines): diff --git a/.hgtags b/.hgtags --- a/.hgtags +++ b/.hgtags @@ -668,3 +668,6 @@ c57454c6c6f6e77fbbdf70de32a7cc845b67d1dd 07824a1c7beb75308b813378af33c243f1c2f511 Dec2016_SP4_release c57454c6c6f6e77fbbdf70de32a7cc845b67d1dd Dec2016_SP4_release 54a8c9d99dc3621a02579db0c59309781caceb54 Jul2017_root +05f4e62bc67911a25f19be7fe742009ab1ee41c7 Dec2016_21 +c57454c6c6f6e77fbbdf70de32a7cc845b67d1dd Dec2016_SP4_release +05f4e62bc67911a25f19be7fe742009ab1ee41c7 Dec2016_SP4_release diff --git a/MonetDB.spec b/MonetDB.spec --- a/MonetDB.spec +++ b/MonetDB.spec @@ -953,6 +953,16 @@ rm -f %{buildroot}%{_bindir}/Maddlog %postun -p /sbin/ldconfig %changelog +* Tue Apr 25 2017 Sjoerd Mullender <sjo...@acm.org> - 11.25.21-20170425 +- Rebuilt. +- BZ#6260: Sqlitelogictest crash +- BZ#6288: Function cannot find column in merge table +- BZ#6295: msqldump writes unescaped timestamp values when using inserts + +* Wed Apr 19 2017 Sjoerd Mullender <sjo...@acm.org> - 11.25.21-20170425 +- monetdb5: Fixed a bug causing a crash during cleanup when mserver5 is stopped + with monetdb stop database. + * Tue Apr 18 2017 Sjoerd Mullender <sjo...@acm.org> - 11.25.19-20170418 - Rebuilt. - BZ#6259: crash on select query from sqlitelogictests diff --git a/debian/changelog b/debian/changelog --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,19 @@ +monetdb (11.25.21) unstable; urgency=low + + * Rebuilt. + * BZ#6260: Sqlitelogictest crash + * BZ#6288: Function cannot find column in merge table + * BZ#6295: msqldump writes unescaped timestamp values when using inserts + + -- Sjoerd Mullender <sjo...@acm.org> Tue, 25 Apr 2017 11:05:40 +0200 + +monetdb (11.25.21) unstable; urgency=low + + * monetdb5: Fixed a bug causing a crash during cleanup when mserver5 is stopped +with monetdb stop database. + + -- Sjoerd Mullender <sjo...@acm.org> Wed, 19 Apr 2017 11:05:40 +0200 + monetdb (11.25.19) unstable; urgency=low * Rebuilt. diff --git a/libversions b/libversions --- a/libversions +++ b/libversions @@ -42,7 +42,7 @@ GDK_VERSION=14:6:1 MAPI_VERSION=8:1:0 # version of the MONETDB5 library (subdirectory monetdb5, not including extras) -MONETDB5_VERSION=22:5:1 +MONETDB5_VERSION=22:6:1 # version of the STREAM library (subdirectory common/stream) STREAM_VERSION=9:0:1 diff --git a/monetdb5/ChangeLog-Archive b/monetdb5/ChangeLog-Archive --- a/monetdb5/ChangeLog-Archive +++ b/monetdb5/ChangeLog-Archive @@ -1,6 +1,10 @@ # DO NOT EDIT THIS FILE -- MAINTAINED AUTOMATICALLY # This file contains past ChangeLog entries +* Wed Apr 19 2017 Sjoerd Mullender <sjo...@acm.org> - 11.25.21-20170425 +- Fixed a bug causing a crash during cleanup when mserver5 is stopped + with monetdb stop database. + * Tue Apr 18 2017 Sjoerd Mullender <sjo...@acm.org> - 11.25.19-20170418 - Some memory leaks were plugged. diff --git a/monetdb5/ChangeLog.Dec2016 b/monetdb5/ChangeLog.Dec2016 --- a/monetdb5/ChangeLog.Dec2016 +++ b/monetdb5/ChangeLog.Dec2016 @@ -1,7 +1,3 @@ # ChangeLog file for MonetDB5 # This file is updated with Maddlog -* Wed Apr 19 2017 Sjoerd Mullender <sjo...@acm.org> -- Fixed a bug causing a crash during cleanup when mserver5 is stopped - with monetdb stop database. - ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: Jul2017 - Merge with Dec2016 branch, not changing any f...
Changeset: f5eef050902d for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f5eef050902d Modified Files: MonetDB.spec NT/monetdb_config.h.in NT/rules.msc clients/mapilib/mapi.rc clients/odbc/driver/driver.rc clients/odbc/winsetup/setup.rc configure.ag gdk/libbat.rc monetdb5/tools/libmonetdb5.rc vertoo.data Branch: Jul2017 Log Message: Merge with Dec2016 branch, not changing any files.. ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: Dec2016 - Post release build.
Changeset: 9a63edb116a1 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9a63edb116a1 Modified Files: MonetDB.spec NT/installer32/MonetDB-ODBC-Installer.vdproj NT/installer32/MonetDB5-Geom-Module.vdproj NT/installer32/MonetDB5-SQL-Installer.vdproj NT/installer64/MonetDB-ODBC-Installer.vdproj NT/installer64/MonetDB5-Geom-Module.vdproj NT/installer64/MonetDB5-SQL-Installer.vdproj NT/monetdb_config.h.in NT/rules.msc clients/mapilib/mapi.rc clients/odbc/driver/driver.rc clients/odbc/winsetup/setup.rc configure.ag gdk/libbat.rc monetdb5/tools/libmonetdb5.rc vertoo.data Branch: Dec2016 Log Message: Post release build. diffs (truncated from 308 to 300 lines): diff --git a/MonetDB.spec b/MonetDB.spec --- a/MonetDB.spec +++ b/MonetDB.spec @@ -1,5 +1,5 @@ %define name MonetDB -%define version 11.25.21 +%define version 11.25.22 %{!?buildno: %global buildno %(date +%Y%m%d)} # groups of related archs diff --git a/NT/installer32/MonetDB-ODBC-Installer.vdproj b/NT/installer32/MonetDB-ODBC-Installer.vdproj --- a/NT/installer32/MonetDB-ODBC-Installer.vdproj +++ b/NT/installer32/MonetDB-ODBC-Installer.vdproj @@ -574,7 +574,7 @@ "RemovePreviousVersions" = "11:TRUE" "DetectNewerInstalledVersion" = "11:TRUE" "InstallAllUsers" = "11:TRUE" -"ProductVersion" = "8:11.25.21" +"ProductVersion" = "8:11.25.22" "Manufacturer" = "8:MonetDB" "ARPHELPTELEPHONE" = "8:" "ARPHELPLINK" = "8:http://www.monetdb.org/; diff --git a/NT/installer32/MonetDB5-Geom-Module.vdproj b/NT/installer32/MonetDB5-Geom-Module.vdproj --- a/NT/installer32/MonetDB5-Geom-Module.vdproj +++ b/NT/installer32/MonetDB5-Geom-Module.vdproj @@ -439,7 +439,7 @@ "RemovePreviousVersions" = "11:TRUE" "DetectNewerInstalledVersion" = "11:TRUE" "InstallAllUsers" = "11:TRUE" -"ProductVersion" = "8:11.25.21" +"ProductVersion" = "8:11.25.22" "Manufacturer" = "8:MonetDB" "ARPHELPTELEPHONE" = "8:" "ARPHELPLINK" = "8:http://www.monetdb.org/; diff --git a/NT/installer32/MonetDB5-SQL-Installer.vdproj b/NT/installer32/MonetDB5-SQL-Installer.vdproj --- a/NT/installer32/MonetDB5-SQL-Installer.vdproj +++ b/NT/installer32/MonetDB5-SQL-Installer.vdproj @@ -4322,7 +4322,7 @@ "RemovePreviousVersions" = "11:TRUE" "DetectNewerInstalledVersion" = "11:TRUE" "InstallAllUsers" = "11:TRUE" -"ProductVersion" = "8:11.25.21" +"ProductVersion" = "8:11.25.22" "Manufacturer" = "8:MonetDB" "ARPHELPTELEPHONE" = "8:" "ARPHELPLINK" = "8:http://www.monetdb.org/; diff --git a/NT/installer64/MonetDB-ODBC-Installer.vdproj b/NT/installer64/MonetDB-ODBC-Installer.vdproj --- a/NT/installer64/MonetDB-ODBC-Installer.vdproj +++ b/NT/installer64/MonetDB-ODBC-Installer.vdproj @@ -574,7 +574,7 @@ "RemovePreviousVersions" = "11:TRUE" "DetectNewerInstalledVersion" = "11:TRUE" "InstallAllUsers" = "11:TRUE" -"ProductVersion" = "8:11.25.21" +"ProductVersion" = "8:11.25.22" "Manufacturer" = "8:MonetDB" "ARPHELPTELEPHONE" = "8:" "ARPHELPLINK" = "8:http://www.monetdb.org/; diff --git a/NT/installer64/MonetDB5-Geom-Module.vdproj b/NT/installer64/MonetDB5-Geom-Module.vdproj --- a/NT/installer64/MonetDB5-Geom-Module.vdproj +++ b/NT/installer64/MonetDB5-Geom-Module.vdproj @@ -439,7 +439,7 @@ "RemovePreviousVersions" = "11:TRUE" "DetectNewerInstalledVersion" = "11:TRUE" "InstallAllUsers" = "11:TRUE" -"ProductVersion" = "8:11.25.21" +"ProductVersion" = "8:11.25.22" "Manufacturer" = "8:MonetDB" "ARPHELPTELEPHONE" = "8:" "ARPHELPLINK" = "8:http://www.monetdb.org/; diff --git a/NT/installer64/MonetDB5-SQL-Installer.vdproj b/NT/installer64/MonetDB5-SQL-Installer.vdproj --- a/NT/installer64/MonetDB5-SQL-Installer.vdproj +++ b/NT/installer64/MonetDB5-SQL-Installer.vdproj @@ -4322,7 +4322,7 @@ "RemovePreviousVersions" = "11:TRUE" "DetectNewerInstalledVersion" = "11:TRUE" "InstallAllUsers" = "11:TRUE" -"ProductVersion" = "8:11.25.21" +"ProductVersion" = "8:11.25.22" "Manufacturer" = "8:MonetDB" "ARPHELPTELEPHONE" = "8:" "ARPHELPLINK" = "8:http://www.monetdb.org/; diff --git a/NT/monetdb_config.h.in b/NT/monetdb_config.h.in --- a/NT/monetdb_config.h.in +++ b/NT/monetdb_config.h.in @@ -754,7 +754,7 @@ #define MONETDB5_PASSWDHASH_TOKEN SHA512 /* Release name or "unreleased" */ -#define MONETDB_RELEASE "Dec2016-SP4" +#define MONETDB_RELEASE "unreleased" /* Suffix for C++ files */ #define MX_CXX_SUFFIX "cxx" @@ -772,13 +772,13 @@ #define PACKAGE_NAME "MonetDB" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "MonetDB 11.25.21"
MonetDB: Jul2017 - Merge with Dec2016 branch.
Changeset: 29dbfc631a80 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=29dbfc631a80 Modified Files: .hgtags MonetDB.spec debian/changelog libversions monetdb5/ChangeLog-Archive monetdb5/ChangeLog.Dec2016 Branch: Jul2017 Log Message: Merge with Dec2016 branch. diffs (90 lines): diff --git a/.hgtags b/.hgtags --- a/.hgtags +++ b/.hgtags @@ -668,3 +668,6 @@ c57454c6c6f6e77fbbdf70de32a7cc845b67d1dd 07824a1c7beb75308b813378af33c243f1c2f511 Dec2016_SP4_release c57454c6c6f6e77fbbdf70de32a7cc845b67d1dd Dec2016_SP4_release 54a8c9d99dc3621a02579db0c59309781caceb54 Jul2017_root +05f4e62bc67911a25f19be7fe742009ab1ee41c7 Dec2016_21 +c57454c6c6f6e77fbbdf70de32a7cc845b67d1dd Dec2016_SP4_release +05f4e62bc67911a25f19be7fe742009ab1ee41c7 Dec2016_SP4_release diff --git a/MonetDB.spec b/MonetDB.spec --- a/MonetDB.spec +++ b/MonetDB.spec @@ -953,6 +953,16 @@ rm -f %{buildroot}%{_bindir}/Maddlog %postun -p /sbin/ldconfig %changelog +* Tue Apr 25 2017 Sjoerd Mullender <sjo...@acm.org> - 11.25.21-20170425 +- Rebuilt. +- BZ#6260: Sqlitelogictest crash +- BZ#6288: Function cannot find column in merge table +- BZ#6295: msqldump writes unescaped timestamp values when using inserts + +* Wed Apr 19 2017 Sjoerd Mullender <sjo...@acm.org> - 11.25.21-20170425 +- monetdb5: Fixed a bug causing a crash during cleanup when mserver5 is stopped + with monetdb stop database. + * Tue Apr 18 2017 Sjoerd Mullender <sjo...@acm.org> - 11.25.19-20170418 - Rebuilt. - BZ#6259: crash on select query from sqlitelogictests diff --git a/debian/changelog b/debian/changelog --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,19 @@ +monetdb (11.25.21) unstable; urgency=low + + * Rebuilt. + * BZ#6260: Sqlitelogictest crash + * BZ#6288: Function cannot find column in merge table + * BZ#6295: msqldump writes unescaped timestamp values when using inserts + + -- Sjoerd Mullender <sjo...@acm.org> Tue, 25 Apr 2017 11:05:40 +0200 + +monetdb (11.25.21) unstable; urgency=low + + * monetdb5: Fixed a bug causing a crash during cleanup when mserver5 is stopped +with monetdb stop database. + + -- Sjoerd Mullender <sjo...@acm.org> Wed, 19 Apr 2017 11:05:40 +0200 + monetdb (11.25.19) unstable; urgency=low * Rebuilt. diff --git a/libversions b/libversions --- a/libversions +++ b/libversions @@ -42,7 +42,7 @@ GDK_VERSION=14:6:1 MAPI_VERSION=8:1:0 # version of the MONETDB5 library (subdirectory monetdb5, not including extras) -MONETDB5_VERSION=22:5:1 +MONETDB5_VERSION=22:6:1 # version of the STREAM library (subdirectory common/stream) STREAM_VERSION=9:0:1 diff --git a/monetdb5/ChangeLog-Archive b/monetdb5/ChangeLog-Archive --- a/monetdb5/ChangeLog-Archive +++ b/monetdb5/ChangeLog-Archive @@ -1,6 +1,10 @@ # DO NOT EDIT THIS FILE -- MAINTAINED AUTOMATICALLY # This file contains past ChangeLog entries +* Wed Apr 19 2017 Sjoerd Mullender <sjo...@acm.org> - 11.25.21-20170425 +- Fixed a bug causing a crash during cleanup when mserver5 is stopped + with monetdb stop database. + * Tue Apr 18 2017 Sjoerd Mullender <sjo...@acm.org> - 11.25.19-20170418 - Some memory leaks were plugged. diff --git a/monetdb5/ChangeLog.Dec2016 b/monetdb5/ChangeLog.Dec2016 --- a/monetdb5/ChangeLog.Dec2016 +++ b/monetdb5/ChangeLog.Dec2016 @@ -1,7 +1,3 @@ # ChangeLog file for MonetDB5 # This file is updated with Maddlog -* Wed Apr 19 2017 Sjoerd Mullender <sjo...@acm.org> -- Fixed a bug causing a crash during cleanup when mserver5 is stopped - with monetdb stop database. - ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: Dec2016 - Setting tags Dec2016_21 and Dec2016_SP4 for t...
Changeset: 25c53bef6af1 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=25c53bef6af1 Modified Files: .hgtags Branch: Dec2016 Log Message: Setting tags Dec2016_21 and Dec2016_SP4 for the release build. diffs (10 lines): diff --git a/.hgtags b/.hgtags --- a/.hgtags +++ b/.hgtags @@ -667,3 +667,6 @@ 07824a1c7beb75308b813378af33c243f1c2f511 c57454c6c6f6e77fbbdf70de32a7cc845b67d1dd Dec2016_19 07824a1c7beb75308b813378af33c243f1c2f511 Dec2016_SP4_release c57454c6c6f6e77fbbdf70de32a7cc845b67d1dd Dec2016_SP4_release +05f4e62bc67911a25f19be7fe742009ab1ee41c7 Dec2016_21 +c57454c6c6f6e77fbbdf70de32a7cc845b67d1dd Dec2016_SP4_release +05f4e62bc67911a25f19be7fe742009ab1ee41c7 Dec2016_SP4_release ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: Dec2016 - Updated library versions.
Changeset: 497f56eeae03 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=497f56eeae03 Modified Files: libversions Branch: Dec2016 Log Message: Updated library versions. diffs (12 lines): diff --git a/libversions b/libversions --- a/libversions +++ b/libversions @@ -42,7 +42,7 @@ GDK_VERSION=14:6:1 MAPI_VERSION=8:1:0 # version of the MONETDB5 library (subdirectory monetdb5, not including extras) -MONETDB5_VERSION=22:5:1 +MONETDB5_VERSION=22:6:1 # version of the STREAM library (subdirectory common/stream) STREAM_VERSION=9:0:1 ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: Dec2016 - Pre-release version number update.
Changeset: 3ce6b00dd9eb for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3ce6b00dd9eb Modified Files: MonetDB.spec NT/installer32/MonetDB-ODBC-Installer.vdproj NT/installer32/MonetDB5-Geom-Module.vdproj NT/installer32/MonetDB5-SQL-Installer.vdproj NT/installer64/MonetDB-ODBC-Installer.vdproj NT/installer64/MonetDB5-Geom-Module.vdproj NT/installer64/MonetDB5-SQL-Installer.vdproj NT/monetdb_config.h.in NT/rules.msc clients/mapilib/mapi.rc clients/odbc/driver/driver.rc clients/odbc/winsetup/setup.rc configure.ag gdk/libbat.rc monetdb5/tools/libmonetdb5.rc vertoo.data Branch: Dec2016 Log Message: Pre-release version number update. diffs (truncated from 368 to 300 lines): diff --git a/MonetDB.spec b/MonetDB.spec --- a/MonetDB.spec +++ b/MonetDB.spec @@ -1,5 +1,5 @@ %define name MonetDB -%define version 11.25.20 +%define version 11.25.21 %{!?buildno: %global buildno %(date +%Y%m%d)} # groups of related archs diff --git a/NT/installer32/MonetDB-ODBC-Installer.vdproj b/NT/installer32/MonetDB-ODBC-Installer.vdproj --- a/NT/installer32/MonetDB-ODBC-Installer.vdproj +++ b/NT/installer32/MonetDB-ODBC-Installer.vdproj @@ -566,15 +566,15 @@ { "Name" = "8:Microsoft Visual Studio" "ProductName" = "8:MonetDB ODBC Driver" -"ProductCode" = "8:{3D6A93DD-85FF-4D85-BEAF-C76DD48CCFD3}" -"PackageCode" = "8:{1CCFB11C-CC3E-497C-8A93-D4F51021FE34}" +"ProductCode" = "8:{D6D291D9-0074-43EA-ADFF-6A38A938DA1D}" +"PackageCode" = "8:{05417555-1C07-4A7A-9397-C8C7CCC675BE}" "UpgradeCode" = "8:{C1F69378-3F5C-4120-8224-32F07D3458F3}" "AspNetVersion" = "8:4.0.30319.0" "RestartWWWService" = "11:FALSE" "RemovePreviousVersions" = "11:TRUE" "DetectNewerInstalledVersion" = "11:TRUE" "InstallAllUsers" = "11:TRUE" -"ProductVersion" = "8:11.25.20" +"ProductVersion" = "8:11.25.21" "Manufacturer" = "8:MonetDB" "ARPHELPTELEPHONE" = "8:" "ARPHELPLINK" = "8:http://www.monetdb.org/; diff --git a/NT/installer32/MonetDB5-Geom-Module.vdproj b/NT/installer32/MonetDB5-Geom-Module.vdproj --- a/NT/installer32/MonetDB5-Geom-Module.vdproj +++ b/NT/installer32/MonetDB5-Geom-Module.vdproj @@ -431,15 +431,15 @@ { "Name" = "8:Microsoft Visual Studio" "ProductName" = "8:MonetDB5 SQL GIS Module" -"ProductCode" = "8:{031B01C0-7B22-4689-91CA-B359AA5ADD5E}" -"PackageCode" = "8:{58F57A9F-32DC-4CAD-9E33-BEF4200D13EE}" +"ProductCode" = "8:{4ED1B665-C3F7-44C9-91FD-0EB250C23732}" +"PackageCode" = "8:{197B3E14-132E-465E-A636-D5271AB1A78B}" "UpgradeCode" = "8:{92C89C36-0E86-45E1-B3D8-0D6C91108F30}" "AspNetVersion" = "8:4.0.30319.0" "RestartWWWService" = "11:FALSE" "RemovePreviousVersions" = "11:TRUE" "DetectNewerInstalledVersion" = "11:TRUE" "InstallAllUsers" = "11:TRUE" -"ProductVersion" = "8:11.25.20" +"ProductVersion" = "8:11.25.21" "Manufacturer" = "8:MonetDB" "ARPHELPTELEPHONE" = "8:" "ARPHELPLINK" = "8:http://www.monetdb.org/; diff --git a/NT/installer32/MonetDB5-SQL-Installer.vdproj b/NT/installer32/MonetDB5-SQL-Installer.vdproj --- a/NT/installer32/MonetDB5-SQL-Installer.vdproj +++ b/NT/installer32/MonetDB5-SQL-Installer.vdproj @@ -4314,15 +4314,15 @@ { "Name" = "8:Microsoft Visual Studio" "ProductName" = "8:MonetDB5" -"ProductCode" = "8:{2D762729-3433-4733-AEF1-D55FD6167F99}" -"PackageCode" = "8:{27F789B2-F3E7-4E91-BCDE-59B086253BEF}" +"ProductCode" = "8:{3BB96EAD-5ABF-45C6-9320-192784CC07AE}" +"PackageCode" = "8:{08FA8DBF-DD24-49D9-B8C1-C88034ADEC59}" "UpgradeCode" = "8:{730C595B-DBA6-48D7-94B8-A98780AC92B6}" "AspNetVersion" = "8:4.0.30319.0" "RestartWWWService" = "11:FALSE" "RemovePreviousVersions" = "11:TRUE" "DetectNewerInstalledVersion" = "11:TRUE" "InstallAllUsers" = "11:TRUE" -"ProductVersion" = "8:11.25.20" +"ProductVersion" = "8:11.25.21" "Manufacturer" = "8:MonetDB" "ARPHELPTELEPHONE" = "8:" "ARPHELPLINK" = "8:http://www.monetdb.org/; diff --git a/NT/installer64/MonetDB-ODBC-Installer.vdproj b/NT/installer64/MonetDB-ODBC-Installer.vdproj --- a/NT/installer64/MonetDB-ODBC-Installer.vdproj +++ b/NT/installer64/MonetDB-ODBC-Installer.vdproj @@ -566,15 +566,15 @@ { "Name" = "8:Microsoft Visual Studio" "ProductName" = "8:MonetDB ODBC Driver" -"ProductCode" = "8:{6FF86A27-C17F-4617-B117-CC799EAF221E}" -"PackageCode" = "8:{CA63502B-CBBF-4299-B7F3-39AA42844120}" +"ProductCode" = "8:{59338743-E708-4F10-83C3-9183E8092C45}" +"PackageCode" = "8:{0ADDB49E-E83F-4041-9BE9-A636926F4AE2}"
MonetDB: data-vaults - Merge branch 'master' into branches/data-...
Changeset: a7ba64e33165 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a7ba64e33165 Added Files: ChangeLog.Jul2017 buildtools/ChangeLog.Jul2017 clients/ChangeLog.Jul2017 clients/mapilib/ChangeLog.Jul2017 common/stream/ChangeLog.Jul2017 gdk/ChangeLog.Jul2017 geom/ChangeLog.Jul2017 monetdb5/ChangeLog.Jul2017 sql/ChangeLog.Jul2017 sql/test/BugTracker-2017/Tests/nestedoperators.Bug-6292.sql testing/ChangeLog.Jul2017 tools/merovingian/ChangeLog.Jul2017 Modified Files: .hgtags ChangeLog MonetDB.spec NT/mkgeomwxs.py NT/mkodbcwxs.py NT/mksqlwxs.py NT/monetdb_config.h.in NT/rules.msc clients/ChangeLog clients/mapiclient/dump.c clients/mapilib/mapi.rc clients/odbc/driver/driver.rc clients/odbc/winsetup/setup.rc configure.ag gdk/ChangeLog gdk/libbat.rc monetdb5/ChangeLog monetdb5/tools/libmonetdb5.rc sql/ChangeLog sql/backends/monet5/sql_upgrades.c sql/test/BugTracker-2017/Tests/All sql/test/testdb-upgrade-chain-hge/Tests/dump.stable.out.int128 sql/test/testdb-upgrade-chain/Tests/dump.stable.out sql/test/testdb-upgrade-hge/Tests/dump.stable.out.int128 sql/test/testdb-upgrade/Tests/dump.stable.out sql/test/testdb/Tests/testdb-dump.stable.out sql/test/testdb/Tests/testdb-load.sql vertoo.data Branch: data-vaults Log Message: Merge branch 'master' into branches/data-vaults diffs (truncated from 674 to 300 lines): diff --git a/.hgtags b/.hgtags --- a/.hgtags +++ b/.hgtags @@ -667,3 +667,4 @@ 07824a1c7beb75308b813378af33c243f1c2f511 c57454c6c6f6e77fbbdf70de32a7cc845b67d1dd Dec2016_19 07824a1c7beb75308b813378af33c243f1c2f511 Dec2016_SP4_release c57454c6c6f6e77fbbdf70de32a7cc845b67d1dd Dec2016_SP4_release +54a8c9d99dc3621a02579db0c59309781caceb54 Jul2017_root diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,27 +1,3 @@ # ChangeLog file for devel # This file is updated with Maddlog -* Thu Apr 13 2017 Mark Raasveldt-- Added a new server-side protocol implementation. The new protocol - is backwards compatible with the old protocol. Clients can choose - whether they want to use the old or the new protocol during the initial - handshake with the server. The new protocol is a binary column-based - protocol that is significantly faster than the old protocol when - transferring large result sets. In addition, the new protocol supports - compression using Snappy or LZ4. - -* Mon Feb 20 2017 Sjoerd Mullender -- Moved the sphinx extension module to its own repository. - See https://dev.monetdb.org/hg/MonetDB-sphinx/. - -* Thu Feb 16 2017 Sjoerd Mullender -- Removed GSL module: it's now a separate (extension) package. - See https://dev.monetdb.org/hg/MonetDB-gsl/. -- The PCRE library is now optional for systems that support POSIX regular - expressions. - -* Thu Jan 12 2017 Martin van Dinther -- Added 5 new sys schema tables: function_languages, function_types, - key_types, index_types and privilege_codes. They are pre-loaded with - static content and contain descriptive names for the various integer - type and code values. See also sql/scripts/51_sys_schema_extension.sql diff --git a/ChangeLog b/ChangeLog.Jul2017 copy from ChangeLog copy to ChangeLog.Jul2017 diff --git a/MonetDB.spec b/MonetDB.spec --- a/MonetDB.spec +++ b/MonetDB.spec @@ -1,5 +1,5 @@ %define name MonetDB -%define version 11.26.0 +%define version 11.28.0 %{!?buildno: %global buildno %(date +%Y%m%d)} # groups of related archs diff --git a/NT/mkgeomwxs.py b/NT/mkgeomwxs.py --- a/NT/mkgeomwxs.py +++ b/NT/mkgeomwxs.py @@ -32,6 +32,7 @@ def main(): else: folder = r'ProgramFilesFolder' arch = 'x86' +vs = os.getenv('vs')# inherited from TestTools\common.bat features = [] print(r'') print(r'http://schemas.microsoft.com/wix/2006/wi;>') @@ -47,7 +48,7 @@ def main(): print(r'') print(r'') print(r'') -print(r' ' % arch) +print(r' ' % (vs, arch)) print(r' ' % folder) print(r'') print(r' ') diff --git a/NT/mkodbcwxs.py b/NT/mkodbcwxs.py --- a/NT/mkodbcwxs.py +++ b/NT/mkodbcwxs.py @@ -35,6 +35,7 @@ def main(): else: folder = r'ProgramFilesFolder' arch = 'x86' +vs = os.getenv('vs')# inherited from TestTools\common.bat features = [] print(r'') print(r'http://schemas.microsoft.com/wix/2006/wi;>') @@ -49,7 +50,7 @@ def main(): print(r'') print(r'') print(r'') -print(r' ' % arch) +print(r' ' % (vs, arch)) print(r' ' % folder) print(r'') print(r'
MonetDB: wlcr - Merge with default
Changeset: 1325957f394a for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1325957f394a Added Files: ChangeLog.Jul2017 NT/mkgeomwxs.py NT/mkodbcwxs.py NT/mksqlwxs.py buildtools/ChangeLog.Jul2017 clients/ChangeLog.Jul2017 clients/mapilib/ChangeLog.Jul2017 common/stream/ChangeLog.Jul2017 gdk/ChangeLog.Jul2017 geom/ChangeLog.Jul2017 monetdb5/ChangeLog.Jul2017 sql/ChangeLog.Jul2017 sql/test/BugTracker-2017/Tests/crash_in_in_handling.Bug-6260.sql sql/test/BugTracker-2017/Tests/crash_in_in_handling.Bug-6260.stable.err sql/test/BugTracker-2017/Tests/crash_in_in_handling.Bug-6260.stable.out sql/test/BugTracker-2017/Tests/function_and_mergetable.Bug-6288.sql sql/test/BugTracker-2017/Tests/function_and_mergetable.Bug-6288.stable.err sql/test/BugTracker-2017/Tests/function_and_mergetable.Bug-6288.stable.out sql/test/BugTracker-2017/Tests/nestedoperators.Bug-6292.sql sql/test/leaks/Tests/check1.reqtests sql/test/leaks/Tests/check1.sql sql/test/leaks/Tests/check2.reqtests sql/test/leaks/Tests/check3.reqtests sql/test/leaks/Tests/check4.reqtests sql/test/leaks/Tests/check5.reqtests sql/test/leaks/Tests/drop3.reqtests sql/test/leaks/Tests/initialize.sql sql/test/leaks/Tests/initialize.stable.err sql/test/leaks/Tests/initialize.stable.out sql/test/leaks/Tests/select1.reqtests sql/test/leaks/Tests/select2.reqtests sql/test/leaks/Tests/temp1.reqtests sql/test/leaks/Tests/temp2.reqtests sql/test/leaks/Tests/temp3.reqtests testing/ChangeLog.Jul2017 tools/merovingian/ChangeLog.Jul2017 Removed Files: NT/installer32/MonetDB-ODBC-Driver.sln NT/installer32/MonetDB-ODBC-Installer.vdproj NT/installer32/MonetDB5-Geom-Module.sln NT/installer32/MonetDB5-Geom-Module.vdproj NT/installer32/MonetDB5-SQL-Installer.sln NT/installer32/MonetDB5-SQL-Installer.vdproj NT/installer32/cv64-32.sh NT/installer64/MonetDB-ODBC-Driver.sln NT/installer64/MonetDB-ODBC-Installer.vdproj NT/installer64/MonetDB5-Geom-Module.sln NT/installer64/MonetDB5-Geom-Module.vdproj NT/installer64/MonetDB5-SQL-Installer.sln NT/installer64/MonetDB5-SQL-Installer.vdproj NT/installer64/cv32-64.sh NT/installer64/fixmsi.py monetdb5/scheduler/srvpool.c monetdb5/scheduler/srvpool.h monetdb5/scheduler/srvpool.mal sql/test/leaks/Tests/check0.sql sql/test/leaks/Tests/check0.stable.err sql/test/leaks/Tests/check0.stable.out sql/test/leaks/Tests/check0.stable.out.int128 sql/test/leaks/Tests/check1.sql.src Modified Files: .hgtags ChangeLog MonetDB.spec NT/Makefile NT/monetdb_config.h.in NT/rules.msc buildtools/conf/banner.bmp buildtools/doc/windowsbuild.rst clients/ChangeLog clients/Tests/MAL-signatures.stable.out clients/Tests/MAL-signatures.stable.out.int128 clients/Tests/exports.stable.out clients/mapiclient/dump.c clients/mapilib/mapi.rc clients/odbc/driver/driver.rc clients/odbc/winsetup/setup.rc configure.ag debian/changelog gdk/ChangeLog gdk/ChangeLog-Archive gdk/ChangeLog.Dec2016 gdk/gdk.h gdk/gdk_aggr.c gdk/gdk_align.c gdk/libbat.rc geom/monetdb5/Makefile.ag libversions monetdb5/ChangeLog monetdb5/ChangeLog-Archive monetdb5/ChangeLog.Dec2016 monetdb5/extras/mal_optimizer_template/Makefile.ag monetdb5/mal/mal_authorize.c monetdb5/mal/mal_linker.c monetdb5/mal/mal_parser.c monetdb5/mal/mal_stack.c monetdb5/modules/kernel/Makefile.ag monetdb5/modules/kernel/bat5.c monetdb5/modules/mal/Makefile.ag monetdb5/modules/mal/mal_init.mal monetdb5/modules/mal/mat.c monetdb5/optimizer/opt_prelude.c monetdb5/optimizer/opt_prelude.h monetdb5/scheduler/Makefile.ag monetdb5/tools/libmonetdb5.rc sql/ChangeLog sql/ChangeLog-Archive sql/ChangeLog.Dec2016 sql/backends/monet5/LSST/Makefile.ag sql/backends/monet5/Makefile.ag sql/backends/monet5/UDF/pyapi/pyapi.c sql/backends/monet5/rel_bin.c sql/backends/monet5/sql.c sql/backends/monet5/sql_bat2time.c sql/backends/monet5/sql_cast.c sql/backends/monet5/sql_execute.c sql/backends/monet5/sql_result.c sql/backends/monet5/sql_round_impl.h sql/backends/monet5/sql_upgrades.c sql/backends/monet5/vaults/Makefile.ag sql/backends/monet5/vaults/bam/bam_lib.c
MonetDB: default - Merge with Jul2017 branch.
Changeset: c11f53136f41 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c11f53136f41 Modified Files: NT/mkgeomwxs.py NT/mkodbcwxs.py NT/mksqlwxs.py clients/mapiclient/dump.c sql/test/testdb-upgrade-chain-hge/Tests/dump.stable.out.int128 sql/test/testdb-upgrade-chain/Tests/dump.stable.out sql/test/testdb-upgrade-hge/Tests/dump.stable.out.int128 sql/test/testdb-upgrade/Tests/dump.stable.out sql/test/testdb/Tests/testdb-dump.stable.out sql/test/testdb/Tests/testdb-load.sql Branch: default Log Message: Merge with Jul2017 branch. diffs (146 lines): diff --git a/NT/mkgeomwxs.py b/NT/mkgeomwxs.py --- a/NT/mkgeomwxs.py +++ b/NT/mkgeomwxs.py @@ -32,6 +32,7 @@ def main(): else: folder = r'ProgramFilesFolder' arch = 'x86' +vs = os.getenv('vs')# inherited from TestTools\common.bat features = [] print(r'') print(r'http://schemas.microsoft.com/wix/2006/wi;>') @@ -47,7 +48,7 @@ def main(): print(r'') print(r'') print(r'') -print(r' ' % arch) +print(r' ' % (vs, arch)) print(r' ' % folder) print(r'') print(r' ') diff --git a/NT/mkodbcwxs.py b/NT/mkodbcwxs.py --- a/NT/mkodbcwxs.py +++ b/NT/mkodbcwxs.py @@ -35,6 +35,7 @@ def main(): else: folder = r'ProgramFilesFolder' arch = 'x86' +vs = os.getenv('vs')# inherited from TestTools\common.bat features = [] print(r'') print(r'http://schemas.microsoft.com/wix/2006/wi;>') @@ -49,7 +50,7 @@ def main(): print(r'') print(r'') print(r'') -print(r' ' % arch) +print(r' ' % (vs, arch)) print(r' ' % folder) print(r'') print(r' ') diff --git a/NT/mksqlwxs.py b/NT/mksqlwxs.py --- a/NT/mksqlwxs.py +++ b/NT/mksqlwxs.py @@ -35,6 +35,7 @@ def main(): else: folder = r'ProgramFilesFolder' arch = 'x86' +vs = os.getenv('vs')# inherited from TestTools\common.bat features = [] print(r'') print(r'http://schemas.microsoft.com/wix/2006/wi;>') @@ -50,7 +51,7 @@ def main(): print(r'') print(r'') print(r'') -print(r' ' % arch) +print(r' ' % (vs, arch)) print(r' ' % folder) print(r'') print(r' ') diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c --- a/clients/mapiclient/dump.c +++ b/clients/mapiclient/dump.c @@ -1141,7 +1141,9 @@ dump_table_data(Mapi mid, char *schema, for (i = 0; i < cnt; i++) { string[i] = (strcmp(mapi_get_type(hdl, i), "char") == 0 || strcmp(mapi_get_type(hdl, i), "varchar") == 0 || -strcmp(mapi_get_type(hdl, i), "clob") == 0); +strcmp(mapi_get_type(hdl, i), "clob") == 0 || +strcmp(mapi_get_type(hdl, i), "timestamp") == 0 || +strcmp(mapi_get_type(hdl, i), "timestamptz") == 0); } while (mapi_fetch_row(hdl)) { char *s; diff --git a/sql/test/testdb-upgrade-chain-hge/Tests/dump.stable.out.int128 b/sql/test/testdb-upgrade-chain-hge/Tests/dump.stable.out.int128 --- a/sql/test/testdb-upgrade-chain-hge/Tests/dump.stable.out.int128 +++ b/sql/test/testdb-upgrade-chain-hge/Tests/dump.stable.out.int128 @@ -101215,7 +101215,7 @@ CREATE TABLE "testschema"."typestest" ( "character10"CHAR(10) ); COPY 2 RECORDS INTO "testschema"."typestest" FROM stdin USING DELIMITERS '\t','\n','"'; -true 10 1 100 100 100 1e+30 1e+20 1 123456789 12345.678 3.1415 3.1415 3.1415 2009-04-15 24 18 3 1728000.000 108000.000 12.000 10.000 36000.000 6000.0002000.000600.000 100.000 10.000 1995-07-15 07:30:00.00 1995-07-15 07:30:00.0 1995-07-15 07:30:00.00+00:001995-07-15 07:30:00.0+00:00 07:30:00 07:30:00.0 07:30:00+00:00 07:30:00.0+00:00123456 123456 "123456""123456""x" "varchar" "0123456789" +true 10 1 100 100 100 1e+30 1e+20 1 123456789 12345.678 3.1415 3.1415 3.1415 2009-04-15 24 18 3 1728000.000 108000.000 12.000 10.000 36000.000 6000.0002000.000600.000 100.000 10.000 "1995-07-15 07:30:00.00""1995-07-15 07:30:00.0" "1995-07-15 07:30:00.00+00:00" "1995-07-15 07:30:00.0+00:00" 07:30:00 07:30:00.0 07:30:00+00:00 07:30:00.0+00:00123456 123456 "123456""123456""x" "varchar" "0123456789" NULL NULLNULLNULLNULLNULLNULLNULLNULLNULL NULLNULL
MonetDB: Jul2017 - Merge with Dec2016 branch.
Changeset: d80576ecbcc7 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d80576ecbcc7 Modified Files: clients/mapiclient/dump.c sql/test/testdb-upgrade-chain-hge/Tests/dump.stable.out.int128 sql/test/testdb-upgrade-chain/Tests/dump.stable.out sql/test/testdb-upgrade-hge/Tests/dump.stable.out.int128 sql/test/testdb-upgrade/Tests/dump.stable.out sql/test/testdb/Tests/testdb-dump.stable.out sql/test/testdb/Tests/testdb-load.sql Branch: Jul2017 Log Message: Merge with Dec2016 branch. diffs (86 lines): diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c --- a/clients/mapiclient/dump.c +++ b/clients/mapiclient/dump.c @@ -1141,7 +1141,9 @@ dump_table_data(Mapi mid, char *schema, for (i = 0; i < cnt; i++) { string[i] = (strcmp(mapi_get_type(hdl, i), "char") == 0 || strcmp(mapi_get_type(hdl, i), "varchar") == 0 || -strcmp(mapi_get_type(hdl, i), "clob") == 0); +strcmp(mapi_get_type(hdl, i), "clob") == 0 || +strcmp(mapi_get_type(hdl, i), "timestamp") == 0 || +strcmp(mapi_get_type(hdl, i), "timestamptz") == 0); } while (mapi_fetch_row(hdl)) { char *s; diff --git a/sql/test/testdb-upgrade-chain-hge/Tests/dump.stable.out.int128 b/sql/test/testdb-upgrade-chain-hge/Tests/dump.stable.out.int128 --- a/sql/test/testdb-upgrade-chain-hge/Tests/dump.stable.out.int128 +++ b/sql/test/testdb-upgrade-chain-hge/Tests/dump.stable.out.int128 @@ -101215,7 +101215,7 @@ CREATE TABLE "testschema"."typestest" ( "character10"CHAR(10) ); COPY 2 RECORDS INTO "testschema"."typestest" FROM stdin USING DELIMITERS '\t','\n','"'; -true 10 1 100 100 100 1e+30 1e+20 1 123456789 12345.678 3.1415 3.1415 3.1415 2009-04-15 24 18 3 1728000.000 108000.000 12.000 10.000 36000.000 6000.0002000.000600.000 100.000 10.000 1995-07-15 07:30:00.00 1995-07-15 07:30:00.0 1995-07-15 07:30:00.00+00:001995-07-15 07:30:00.0+00:00 07:30:00 07:30:00.0 07:30:00+00:00 07:30:00.0+00:00123456 123456 "123456""123456""x" "varchar" "0123456789" +true 10 1 100 100 100 1e+30 1e+20 1 123456789 12345.678 3.1415 3.1415 3.1415 2009-04-15 24 18 3 1728000.000 108000.000 12.000 10.000 36000.000 6000.0002000.000600.000 100.000 10.000 "1995-07-15 07:30:00.00""1995-07-15 07:30:00.0" "1995-07-15 07:30:00.00+00:00" "1995-07-15 07:30:00.0+00:00" 07:30:00 07:30:00.0 07:30:00+00:00 07:30:00.0+00:00123456 123456 "123456""123456""x" "varchar" "0123456789" NULL NULLNULLNULLNULLNULLNULLNULLNULLNULL NULLNULLNULLNULLNULLNULLNULLNULLNULLNULL NULLNULLNULLNULLNULLNULLNULLNULLNULLNULL NULLNULLNULLNULLNULLNULLNULLNULLNULLNULL NULLNULLNULL CREATE TABLE "testschema"."keytest1" ( "key1" INTEGER NOT NULL, diff --git a/sql/test/testdb-upgrade-chain/Tests/dump.stable.out b/sql/test/testdb-upgrade-chain/Tests/dump.stable.out --- a/sql/test/testdb-upgrade-chain/Tests/dump.stable.out +++ b/sql/test/testdb-upgrade-chain/Tests/dump.stable.out @@ -101173,7 +101173,7 @@ CREATE TABLE "testschema"."typestest" ( "character10"CHAR(10) ); COPY 2 RECORDS INTO "testschema"."typestest" FROM stdin USING DELIMITERS '\t','\n','"'; -true 10 1 100 100 100 1e+30 1e+20 1 123456789 12345.678 3.1415 3.1415 3.1415 2009-04-15 24 18 3 1728000.000 108000.000 12.000 10.000 36000.000 6000.0002000.000600.000 100.000 10.000 1995-07-15 07:30:00.00 1995-07-15 07:30:00.0 1995-07-15 07:30:00.00+00:001995-07-15 07:30:00.0+00:00 07:30:00 07:30:00.0 07:30:00+00:00 07:30:00.0+00:00123456 123456 "123456""123456""x" "varchar" "0123456789" +true 10 1 100 100 100 1e+30 1e+20 1 123456789 12345.678 3.1415 3.1415 3.1415 2009-04-15 24 18 3 1728000.000 108000.000 12.000 10.000 36000.000 6000.0002000.000600.000 100.000 10.000 "1995-07-15 07:30:00.00""1995-07-15 07:30:00.0" "1995-07-15 07:30:00.00+00:00" "1995-07-15 07:30:00.0+00:00" 07:30:00
MonetDB: Dec2016 - Approve output.
Changeset: afc494ffcdbe for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=afc494ffcdbe Modified Files: clients/mapiclient/dump.c sql/test/testdb-upgrade-chain-hge/Tests/dump.stable.out.int128 sql/test/testdb-upgrade-chain/Tests/dump.stable.out sql/test/testdb-upgrade-hge/Tests/dump.stable.out.int128 sql/test/testdb-upgrade/Tests/dump.stable.out sql/test/testdb/Tests/testdb-dump.stable.out sql/test/testdb/Tests/testdb-load.sql Branch: Dec2016 Log Message: Approve output. diffs (90 lines): diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c --- a/clients/mapiclient/dump.c +++ b/clients/mapiclient/dump.c @@ -1219,10 +1219,10 @@ dump_table_data(Mapi mid, char *schema, string = malloc(sizeof(unsigned char) * cnt); for (i = 0; i < cnt; i++) { string[i] = (strcmp(mapi_get_type(hdl, i), "char") == 0 || -strcmp(mapi_get_type(hdl, i), "varchar") == 0 || -strcmp(mapi_get_type(hdl, i), "clob") == 0 || -strcmp(mapi_get_type(hdl, i), "timestamp") == 0 || -strcmp(mapi_get_type(hdl, i), "timestamptz") == 0); +strcmp(mapi_get_type(hdl, i), "varchar") == 0 || +strcmp(mapi_get_type(hdl, i), "clob") == 0 || +strcmp(mapi_get_type(hdl, i), "timestamp") == 0 || +strcmp(mapi_get_type(hdl, i), "timestamptz") == 0); } while (mapi_fetch_row(hdl)) { char *s; diff --git a/sql/test/testdb-upgrade-chain-hge/Tests/dump.stable.out.int128 b/sql/test/testdb-upgrade-chain-hge/Tests/dump.stable.out.int128 --- a/sql/test/testdb-upgrade-chain-hge/Tests/dump.stable.out.int128 +++ b/sql/test/testdb-upgrade-chain-hge/Tests/dump.stable.out.int128 @@ -101215,7 +101215,7 @@ CREATE TABLE "testschema"."typestest" ( "character10"CHAR(10) ); COPY 2 RECORDS INTO "testschema"."typestest" FROM stdin USING DELIMITERS '\t','\n','"'; -true 10 1 100 100 100 1e+30 1e+20 1 123456789 12345.678 3.1415 3.1415 3.1415 2009-04-15 24 18 3 1728000.000 108000.000 12.000 10.000 36000.000 6000.0002000.000600.000 100.000 10.000 1995-07-15 07:30:00.00 1995-07-15 07:30:00.0 1995-07-15 07:30:00.00+00:001995-07-15 07:30:00.0+00:00 07:30:00 07:30:00.0 07:30:00+00:00 07:30:00.0+00:00123456 123456 "123456""123456""x" "varchar" "0123456789" +true 10 1 100 100 100 1e+30 1e+20 1 123456789 12345.678 3.1415 3.1415 3.1415 2009-04-15 24 18 3 1728000.000 108000.000 12.000 10.000 36000.000 6000.0002000.000600.000 100.000 10.000 "1995-07-15 07:30:00.00""1995-07-15 07:30:00.0" "1995-07-15 07:30:00.00+00:00" "1995-07-15 07:30:00.0+00:00" 07:30:00 07:30:00.0 07:30:00+00:00 07:30:00.0+00:00123456 123456 "123456""123456""x" "varchar" "0123456789" NULL NULLNULLNULLNULLNULLNULLNULLNULLNULL NULLNULLNULLNULLNULLNULLNULLNULLNULLNULL NULLNULLNULLNULLNULLNULLNULLNULLNULLNULL NULLNULLNULLNULLNULLNULLNULLNULLNULLNULL NULLNULLNULL CREATE TABLE "testschema"."keytest1" ( "key1" INTEGER NOT NULL, diff --git a/sql/test/testdb-upgrade-chain/Tests/dump.stable.out b/sql/test/testdb-upgrade-chain/Tests/dump.stable.out --- a/sql/test/testdb-upgrade-chain/Tests/dump.stable.out +++ b/sql/test/testdb-upgrade-chain/Tests/dump.stable.out @@ -101173,7 +101173,7 @@ CREATE TABLE "testschema"."typestest" ( "character10"CHAR(10) ); COPY 2 RECORDS INTO "testschema"."typestest" FROM stdin USING DELIMITERS '\t','\n','"'; -true 10 1 100 100 100 1e+30 1e+20 1 123456789 12345.678 3.1415 3.1415 3.1415 2009-04-15 24 18 3 1728000.000 108000.000 12.000 10.000 36000.000 6000.0002000.000600.000 100.000 10.000 1995-07-15 07:30:00.00 1995-07-15 07:30:00.0 1995-07-15 07:30:00.00+00:001995-07-15 07:30:00.0+00:00 07:30:00 07:30:00.0 07:30:00+00:00 07:30:00.0+00:00123456 123456 "123456""123456""x" "varchar" "0123456789" +true 10 1 100 100 100 1e+30 1e+20 1 123456789 12345.678 3.1415 3.1415 3.1415
MonetDB: Dec2016 - Properly quote time stamps when dumping db
Changeset: b9f673db5b0e for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b9f673db5b0e Modified Files: clients/mapiclient/dump.c Branch: Dec2016 Log Message: Properly quote time stamps when dumping db This fixes bug 6295 diffs (16 lines): diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c --- a/clients/mapiclient/dump.c +++ b/clients/mapiclient/dump.c @@ -1219,8 +1219,10 @@ dump_table_data(Mapi mid, char *schema, string = malloc(sizeof(unsigned char) * cnt); for (i = 0; i < cnt; i++) { string[i] = (strcmp(mapi_get_type(hdl, i), "char") == 0 || -strcmp(mapi_get_type(hdl, i), "varchar") == 0 || -strcmp(mapi_get_type(hdl, i), "clob") == 0); +strcmp(mapi_get_type(hdl, i), "varchar") == 0 || +strcmp(mapi_get_type(hdl, i), "clob") == 0 || +strcmp(mapi_get_type(hdl, i), "timestamp") == 0 || +strcmp(mapi_get_type(hdl, i), "timestamptz") == 0); } while (mapi_fetch_row(hdl)) { char *s; ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: Jul2017 - Use merge modules for compiler we compiled with.
Changeset: fc28d16f3e6b for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fc28d16f3e6b Modified Files: NT/mkgeomwxs.py NT/mkodbcwxs.py NT/mksqlwxs.py Branch: Jul2017 Log Message: Use merge modules for compiler we compiled with. diffs (60 lines): diff --git a/NT/mkgeomwxs.py b/NT/mkgeomwxs.py --- a/NT/mkgeomwxs.py +++ b/NT/mkgeomwxs.py @@ -32,6 +32,7 @@ def main(): else: folder = r'ProgramFilesFolder' arch = 'x86' +vs = os.getenv('vs')# inherited from TestTools\common.bat features = [] print(r'') print(r'http://schemas.microsoft.com/wix/2006/wi;>') @@ -47,7 +48,7 @@ def main(): print(r'') print(r'') print(r'') -print(r' ' % arch) +print(r' ' % (vs, arch)) print(r' ' % folder) print(r'') print(r' ') diff --git a/NT/mkodbcwxs.py b/NT/mkodbcwxs.py --- a/NT/mkodbcwxs.py +++ b/NT/mkodbcwxs.py @@ -35,6 +35,7 @@ def main(): else: folder = r'ProgramFilesFolder' arch = 'x86' +vs = os.getenv('vs')# inherited from TestTools\common.bat features = [] print(r'') print(r'http://schemas.microsoft.com/wix/2006/wi;>') @@ -49,7 +50,7 @@ def main(): print(r'') print(r'') print(r'') -print(r' ' % arch) +print(r' ' % (vs, arch)) print(r' ' % folder) print(r'') print(r' ') diff --git a/NT/mksqlwxs.py b/NT/mksqlwxs.py --- a/NT/mksqlwxs.py +++ b/NT/mksqlwxs.py @@ -35,6 +35,7 @@ def main(): else: folder = r'ProgramFilesFolder' arch = 'x86' +vs = os.getenv('vs')# inherited from TestTools\common.bat features = [] print(r'') print(r'http://schemas.microsoft.com/wix/2006/wi;>') @@ -50,7 +51,7 @@ def main(): print(r'') print(r'') print(r'') -print(r' ' % arch) +print(r' ' % (vs, arch)) print(r' ' % folder) print(r'') print(r' ') ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list