Changeset: 5efe2ae6d9b8 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5efe2ae6d9b8 Modified Files: sql/backends/monet5/rel_bin.c sql/server/rel_select.c sql/test/SQLancer/Tests/sqlancer08.sql sql/test/SQLancer/Tests/sqlancer08.stable.out Branch: Oct2020 Log Message:
Reverting my changes, they are not right diffs (52 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,7 +1268,7 @@ exp_bin(backend *be, sql_exp *e, stmt *l } else { if (r2) { /* handle all cases in stmt_uselect, reducing, non reducing, scalar etc */ - if (l->nrcols == 0 && (!left || (left && left->nrcols > 0))) + if (l->nrcols == 0 && left && left->nrcols > 0) l = left ? stmt_const(be, bin_first_column(be, left), l) : column(be, l); s = stmt_uselect2(be, l, r, r2, (comp_type)e->flag, sel, is_anti(e), reduce); } else { 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 @@ -3867,10 +3867,6 @@ rel_case_exp(sql_query *query, sql_rel * { dlist *l = se->data.lval; - /* Ensure there is always a projection */ - if (rel && !*rel) - *rel = rel_project(query->sql->sa, NULL, append(new_exp_list(query->sql->sa), exp_atom_bool(query->sql->sa, 1))); - if (se->token == SQL_COALESCE) { return rel_complex_case(query, rel, l, f, "coalesce"); } else if (se->token == SQL_NULLIF) { diff --git a/sql/test/SQLancer/Tests/sqlancer08.sql b/sql/test/SQLancer/Tests/sqlancer08.sql --- a/sql/test/SQLancer/Tests/sqlancer08.sql +++ b/sql/test/SQLancer/Tests/sqlancer08.sql @@ -224,3 +224,5 @@ PREPARE (SELECT DISTINCT ((CAST(- (CASE r'' WHEN r'tU1{D^㙝U' THEN 1739172851 WHEN ? THEN -1313600539 WHEN r'X(%4}' THEN NULL WHEN r')帘''舻CD' THEN 95 END) AS BIGINT))&(least(- (-235253756), 64))) WHERE ((rtrim(r'Z'))LIKE(r'rK'))) UNION ALL (SELECT ALL ? WHERE (scale_down(ifthenelse(TRUE, 18, ?), r'4')) IS NULL); SELECT round(- (((-443710828)||(1616633099))), 789092170); + +PREPARE VALUES (CASE WHEN true THEN 5 BETWEEN 4 AND 2 END); diff --git a/sql/test/SQLancer/Tests/sqlancer08.stable.out b/sql/test/SQLancer/Tests/sqlancer08.stable.out --- a/sql/test/SQLancer/Tests/sqlancer08.stable.out +++ b/sql/test/SQLancer/Tests/sqlancer08.stable.out @@ -311,6 +311,13 @@ stdout of test 'sqlancer08` in directory [ "char", 0, 0, NULL, NULL, NULL ] [ "bigint", 64, 0, NULL, NULL, NULL ] [ "tinyint", 5, 0, NULL, NULL, NULL ] +#PREPARE VALUES (CASE WHEN true THEN 5 BETWEEN 4 AND 2 END); +#PREPARE VALUES (CASE WHEN true THEN 5 BETWEEN 4 AND 2 END); +% .prepare, .prepare, .prepare, .prepare, .prepare, .prepare # table_name +% type, digits, scale, schema, table, column # name +% varchar, int, int, str, str, str # type +% 7, 1, 1, 0, 2, 2 # length +[ "boolean", 1, 0, "", "%1", "%1" ] # 11:38:36 > # 11:38:36 > "Done." _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list