Changeset: 9466e88ba3d5 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9466e88ba3d5
Modified Files:
        sql/backends/monet5/rel_bin.c
        sql/test/SQLancer/Tests/sqlancer11.test
Branch: default
Log Message:

Tunning cases needed to create const columm on l argument to between, it would 
be easier to implement the scalar version in the backend :/ Small identation


diffs (27 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,8 +1268,8 @@ 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)
-                                       l = stmt_const(be, bin_first_column(be, 
left), l);
+                               if (l->nrcols == 0 && ((sel && sel->nrcols > 0) 
|| r->nrcols > 0 || r2->nrcols > 0 || reduce))
+                                       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 {
                                /* value compare or select */
diff --git a/sql/test/SQLancer/Tests/sqlancer11.test 
b/sql/test/SQLancer/Tests/sqlancer11.test
--- a/sql/test/SQLancer/Tests/sqlancer11.test
+++ b/sql/test/SQLancer/Tests/sqlancer11.test
@@ -909,7 +909,8 @@ statement ok
 INSERT INTO "sys"."t2" VALUES (6),(7),(1),(1457323133),(8);
 
 statement ok
-INSERT INTO t1(c2) VALUES(COALESCE(BLOB '23f0', ifthenelse(FALSE, BLOB '', 
BLOB '70'), COALESCE(BLOB 'f7b1FD', BLOB 'A0', BLOB '0c', BLOB '', BLOB ''))), 
(CASE WHEN NOT EXISTS (SELECT ALL l2t2.c2 FROM t2 AS l2t2, t0 AS l2t0, t1 AS 
l2t1 WHERE FALSE) THEN BLOB 'F0' ELSE (SELECT DISTINCT NULL WHERE TRUE) END);
+INSERT INTO t1(c2) VALUES(COALESCE(BLOB '23f0', ifthenelse(FALSE, BLOB '', 
BLOB '70'), COALESCE(BLOB 'f7b1FD', BLOB 'A0', BLOB '0c', BLOB '', BLOB ''))),
+(CASE WHEN NOT EXISTS (SELECT ALL l2t2.c2 FROM t2 AS l2t2, t0 AS l2t0, t1 AS 
l2t1 WHERE FALSE) THEN BLOB 'F0' ELSE (SELECT DISTINCT NULL WHERE TRUE) END);
 
 statement ok
 ROLLBACK
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to