Changeset: fbb00768af74 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fbb00768af74 Modified Files: gdk/gdk_string.c monetdb5/modules/mal/wlc.c sql/server/rel_optimizer.c sql/storage/bat/bat_logger.c sql/test/miscellaneous/Tests/groupby_error.sql sql/test/miscellaneous/Tests/groupby_error.stable.out Branch: default Log Message:
Merge with linear-hashing branch. diffs (87 lines): diff --git a/gdk/gdk_string.c b/gdk/gdk_string.c --- a/gdk/gdk_string.c +++ b/gdk/gdk_string.c @@ -1109,7 +1109,7 @@ finish: } GDKfree(astrings); } - if (rres == GDK_FAIL) + if (rres != GDK_SUCCEED) BBPreclaim(bn); return rres; diff --git a/monetdb5/modules/mal/wlc.c b/monetdb5/modules/mal/wlc.c --- a/monetdb5/modules/mal/wlc.c +++ b/monetdb5/modules/mal/wlc.c @@ -501,7 +501,7 @@ WLCmaster(Client cntxt, MalBlkPtr mb, Ma throw(MAL, "wlc.master", "wlc master filename path is too large"); } // set location for logs - if( GDKcreatedir(path) == GDK_FAIL) + if( GDKcreatedir(path) != GDK_SUCCEED) throw(SQL,"wlc.master","Could not create %s\n", path); len = snprintf(wlc_name, IDLENGTH, "%s", GDKgetenv("gdk_dbname")); if (len == -1 || len >= IDLENGTH) 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 @@ -5891,10 +5891,13 @@ rel_groupby_distinct(int *changes, mvc * if (e != distinct) { if (e->type == e_aggr) { /* copy the arguments to the aggregate */ list *args = e->l; - sql_exp *dargs = args->h->data; - - list_append(ngbe, exp_copy(sql, dargs)); - list_append(exps, exp_copy(sql, dargs)); + if (args) { + for (node *n = args->h ; n ; n = n->next) { + sql_exp *e = n->data; + list_append(ngbe, exp_copy(sql, e)); + list_append(exps, exp_copy(sql, e)); + } + } } else { e = exp_ref(sql->sa, e); append(ngbe, e); diff --git a/sql/storage/bat/bat_logger.c b/sql/storage/bat/bat_logger.c --- a/sql/storage/bat/bat_logger.c +++ b/sql/storage/bat/bat_logger.c @@ -1047,7 +1047,7 @@ snapshot_bats(stream *plan, const char * goto end; } ret = snapshot_immediate_copy_file(plan, bbpdir, bbpdir + strlen(db_dir) + 1); - if (ret == GDK_FAIL) + if (ret != GDK_SUCCEED) goto end; // Open the catalog and parse the header diff --git a/sql/test/miscellaneous/Tests/groupby_error.sql b/sql/test/miscellaneous/Tests/groupby_error.sql --- a/sql/test/miscellaneous/Tests/groupby_error.sql +++ b/sql/test/miscellaneous/Tests/groupby_error.sql @@ -10,4 +10,6 @@ START TRANSACTION; CREATE TABLE tab0(col0 INTEGER, col1 INTEGER, col2 INTEGER); INSERT INTO tab0 VALUES(97,1,99), (15,81,47), (87,21,10); SELECT CAST(+ col1 * - col1 AS BIGINT) AS col2 FROM tab0 GROUP BY col2, col0, col1 HAVING + - col0 / - AVG ( ALL + col2 ) - - - AVG ( DISTINCT + col0 ) + col0 IS NULL; +SELECT DISTINCT + 40 / + + col0 AS col2 FROM tab0 GROUP BY col0, col0, col2 HAVING NOT ( NOT + - 80 BETWEEN NULL AND + - 73 ) OR NOT ( + col0 >= - COUNT ( * ) + - COUNT ( DISTINCT - col0 ) ); +SELECT ALL * FROM tab0 AS cor0 WHERE col2 NOT IN ( 22, 18, CAST ( NULL AS INTEGER ) + - 77 ); ROLLBACK; diff --git a/sql/test/miscellaneous/Tests/groupby_error.stable.out b/sql/test/miscellaneous/Tests/groupby_error.stable.out --- a/sql/test/miscellaneous/Tests/groupby_error.stable.out +++ b/sql/test/miscellaneous/Tests/groupby_error.stable.out @@ -76,6 +76,16 @@ stdout of test 'groupby_error` in direct % col2 # name % bigint # type % 1 # length +#SELECT DISTINCT + 40 / + + col0 AS col2 FROM tab0 GROUP BY col0, col0, col2 HAVING NOT ( NOT + - 80 BETWEEN NULL AND + - 73 ) OR NOT ( + col0 >= - COUNT ( * ) + - COUNT ( DISTINCT - col0 ) ); +% .L1 # table_name +% col2 # name +% int # type +% 1 # length +#SELECT ALL * FROM tab0 AS cor0 WHERE col2 NOT IN ( 22, 18, CAST ( NULL AS INTEGER ) + - 77 ); +% sys.cor0, sys.cor0, sys.cor0 # table_name +% col0, col1, col2 # name +% int, int, int # type +% 1, 1, 1 # length #ROLLBACK; # 10:56:47 > _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list