Changeset: b1a78cf6e941 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/b1a78cf6e941
Modified Files:
        sql/server/rel_rewriter.c
        sql/test/SQLancer/Tests/sqlancer23.test
Branch: default
Log Message:

Make sure the new single expression is false, so the generated NULL values 
won't match


diffs (26 lines):

diff --git a/sql/server/rel_rewriter.c b/sql/server/rel_rewriter.c
--- a/sql/server/rel_rewriter.c
+++ b/sql/server/rel_rewriter.c
@@ -221,6 +221,8 @@ rewrite_simplify(visitor *v, uint8_t cyc
                                rel->r = NULL;
                                rel->op = op_select;
                        }
+                       /* make sure the single expression is false, so the 
generate NULL values won't match */
+                       rel->exps->h->data = exp_atom_bool(v->sql->sa, 0);
                        rel->l = rel_project(v->sql->sa, NULL, nexps);
                        rel->card = CARD_ATOM;
                        v->changes++;
diff --git a/sql/test/SQLancer/Tests/sqlancer23.test 
b/sql/test/SQLancer/Tests/sqlancer23.test
--- a/sql/test/SQLancer/Tests/sqlancer23.test
+++ b/sql/test/SQLancer/Tests/sqlancer23.test
@@ -163,6 +163,10 @@ SELECT 1 FROM t0, (SELECT 1 FROM (SELECT
 WHERE CASE WHEN TRUE THEN 2 = ANY(VALUES (vx.vx)) WHEN FALSE THEN t0.c0 = 
t0.c0 END
 ----
 
+query I nosort
+SELECT 1 FROM t0 GROUP BY t0.c0 HAVING max(FALSE) IS NULL
+----
+
 # Postgres doesn't give an error here, but we are confident it must
 statement error GDK reported error: mergejoin: more than one match
 SELECT 1 FROM t0 CROSS JOIN LATERAL (SELECT (VALUES (y.y), (y.y)) FROM (SELECT 
1) y(y) WHERE t0.c0 = 2) x(x)
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to