Changeset: ed333780ee94 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/ed333780ee94 Modified Files: sql/server/rel_exp.c sql/test/miscellaneous/Tests/simple_selects.test Branch: properties Log Message:
Merged with default diffs (169 lines): diff --git a/gdk/gdk_logger_old.c b/gdk/gdk_logger_old.c --- a/gdk/gdk_logger_old.c +++ b/gdk/gdk_logger_old.c @@ -1715,6 +1715,13 @@ old_logger_destroy(old_logger *lg) BATloop(lg->add, p, q) { b = BATdescriptor(bids[p]); if (b) { + if (b != lg->lg->catalog_bid && + b != lg->lg->catalog_id && + b != lg->lg->dcatalog && + b != lg->lg->seqs_id && + b != lg->lg->seqs_val && + b != lg->lg->dseqs) + b = BATsetaccess(b, BAT_READ); BATmode(b, false); BBPunfix(bids[p]); } diff --git a/monetdb5/modules/atoms/xml.c b/monetdb5/modules/atoms/xml.c --- a/monetdb5/modules/atoms/xml.c +++ b/monetdb5/modules/atoms/xml.c @@ -817,9 +817,11 @@ size_t XMLunquotestring(const char **p, (void) buf; return 0; } -str XMLprelude(void) { +static str +XMLprelude(void) { return MAL_SUCCEED; /* to not break init */ } + str XMLepilogue(void *ret) { (void)ret; return MAL_SUCCEED; 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 @@ -706,7 +706,6 @@ exp_propagate(sql_allocator *sa, sql_exp set_unique(ne); if (is_basecol(oe)) set_basecol(ne); - ne->flag = oe->flag; /* needed if the referenced column is a parameter without type set yet */ ne->p = prop_copy(sa, oe->p); return ne; } diff --git a/sql/server/rel_optimize_others.c b/sql/server/rel_optimize_others.c --- a/sql/server/rel_optimize_others.c +++ b/sql/server/rel_optimize_others.c @@ -95,6 +95,7 @@ exps_push_down_prj(mvc *sql, list *exps, narg = exp_push_down_prj(sql, arg, f, t); if (!narg) return NULL; + narg = exp_propagate(sql->sa, narg, arg); append(nl, narg); } return nl; @@ -103,7 +104,7 @@ exps_push_down_prj(mvc *sql, list *exps, sql_exp * exp_push_down_prj(mvc *sql, sql_exp *e, sql_rel *f, sql_rel *t) { - sql_exp *ne = NULL, *l, *r, *r2; + sql_exp *ne = NULL, *l = NULL, *r = NULL, *r2 = NULL; assert(is_project(f->op)); @@ -152,29 +153,27 @@ exp_push_down_prj(mvc *sql, sql_exp *e, return exp_propagate(sql->sa, e, ne); case e_cmp: if (e->flag == cmp_or || e->flag == cmp_filter) { - list *l = exps_push_down_prj(sql, e->l, f, t); - list *r = exps_push_down_prj(sql, e->r, f, t); - - if (!l || !r) - return NULL; - if (e->flag == cmp_filter) - return exp_filter(sql->sa, l, r, e->f, is_anti(e)); - return exp_or(sql->sa, l, r, is_anti(e)); - } else if (e->flag == cmp_in || e->flag == cmp_notin) { - sql_exp *l = exp_push_down_prj(sql, e->l, f, t); - list *r = exps_push_down_prj(sql, e->r, f, t); + list *l = NULL, *r = NULL; - if (!l || !r) + if (!(l = exps_push_down_prj(sql, e->l, f, t)) || !(r = exps_push_down_prj(sql, e->r, f, t))) return NULL; - return exp_in(sql->sa, l, r, e->flag); + if (e->flag == cmp_filter) { + ne = exp_filter(sql->sa, l, r, e->f, is_anti(e)); + } else { + ne = exp_or(sql->sa, l, r, is_anti(e)); + } + } else if (e->flag == cmp_in || e->flag == cmp_notin) { + list *r = NULL; + + if (!(l = exp_push_down_prj(sql, e->l, f, t)) || !(r = exps_push_down_prj(sql, e->r, f, t))) + return NULL; + ne = exp_in(sql->sa, l, r, e->flag); } else { - l = exp_push_down_prj(sql, e->l, f, t); - r = exp_push_down_prj(sql, e->r, f, t); + if (!(l = exp_push_down_prj(sql, e->l, f, t)) || !(r = exp_push_down_prj(sql, e->r, f, t)) || (e->f && !(r2 = exp_push_down_prj(sql, e->f, f, t)))) + return NULL; if (e->f) { - r2 = exp_push_down_prj(sql, e->f, f, t); - if (l && r && r2) - ne = exp_compare2(sql->sa, l, r, r2, e->flag, is_symmetric(e)); - } else if (l && r) { + ne = exp_compare2(sql->sa, l, r, r2, e->flag, is_symmetric(e)); + } else { ne = exp_compare(sql->sa, l, r, e->flag); } } @@ -182,10 +181,10 @@ exp_push_down_prj(mvc *sql, sql_exp *e, return NULL; return exp_propagate(sql->sa, ne, e); case e_convert: - l = exp_push_down_prj(sql, e->l, f, t); - if (l) - return exp_convert(sql->sa, l, exp_fromtype(e), exp_totype(e)); - return NULL; + if (!(l = exp_push_down_prj(sql, e->l, f, t))) + return NULL; + ne = exp_convert(sql->sa, l, exp_fromtype(e), exp_totype(e)); + return exp_propagate(sql->sa, ne, e); case e_aggr: case e_func: { list *l = e->l, *nl = NULL; diff --git a/sql/test/miscellaneous/Tests/simple_selects.test b/sql/test/miscellaneous/Tests/simple_selects.test --- a/sql/test/miscellaneous/Tests/simple_selects.test +++ b/sql/test/miscellaneous/Tests/simple_selects.test @@ -974,6 +974,11 @@ SELECT min(1) FROM (SELECT DISTINCT 1) x ---- 1 +query T nosort +SELECT DISTINCT sql_sub(TIME '14:50:49', x.x) FROM (SELECT 1) y(y) CROSS JOIN (SELECT vx.x FROM (SELECT interval '7200' second) vx(x)) x(x) +---- +12:50:49 + statement ok create global temp table x(x int, y int) diff --git a/sql/test/sysmon/Tests/sys_queue_expand.SQL.py b/sql/test/sysmon/Tests/sys_queue_expand.SQL.py --- a/sql/test/sysmon/Tests/sys_queue_expand.SQL.py +++ b/sql/test/sysmon/Tests/sys_queue_expand.SQL.py @@ -54,7 +54,7 @@ def main(): # Check the long running query, but lets first wait for a moment for the # workers to start with their queries - mstcur.execute('call sys.sleep(500)') + mstcur.execute('call sys.sleep(1000)') query = 'select username, status, query from sys.queue() where query like \'call sys.sleep(5000)%\' order by query' expected_res = [ ('monetdb', 'running', 'call sys.sleep('+SLEEP_TIME+')\n;'), diff --git a/sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.32bit b/sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.32bit --- a/sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.32bit +++ b/sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.32bit @@ -2602,12 +2602,6 @@ insert into sys.functions values (904, ' insert into sys.functions values (905, 'sys_update_tables', 'update_tables', 'sql', 0, 2, true, false, false, 2000, true, true); Running database upgrade commands: -create procedure SHPattach(fname string) external name shp.attach; -create procedure SHPload(fid integer) external name shp.import; -create procedure SHPload(fid integer, filter geometry) external name shp.import; -update sys.functions set system = true where schema_id = 2000 and name in ('shpattach', 'shpload'); - -Running database upgrade commands: drop function sys.dump_database(boolean); drop procedure sys.dump_table_data(); drop procedure sys.dump_table_data(string, string); _______________________________________________ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org