Changeset: c6c4b69bebe7 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c6c4b69bebe7
Modified Files:
        sql/server/rel_exp.c
        sql/test/SQLancer/Tests/sqlancer03.sql
        sql/test/SQLancer/Tests/sqlancer03.stable.out
Branch: Jun2020
Log Message:

Propagate ref property. It fixes the crashing SQLancer query


diffs (69 lines):

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
@@ -846,6 +846,7 @@ exp_setalias(sql_exp *e, const char *rna
 void
 exp_prop_alias(sql_allocator *sa, sql_exp *e, sql_exp *oe )
 {
+       e->ref = oe->ref;
        if (oe->alias.name == NULL && exp_has_rel(oe)) {
                sql_rel *r = exp_rel_get_rel(sa, oe);
                if (!is_project(r->op))
diff --git a/sql/test/SQLancer/Tests/sqlancer03.sql 
b/sql/test/SQLancer/Tests/sqlancer03.sql
--- a/sql/test/SQLancer/Tests/sqlancer03.sql
+++ b/sql/test/SQLancer/Tests/sqlancer03.sql
@@ -248,9 +248,10 @@ 0.877
 0.550
 0.916
 
+select coalesce(1 = true, false);
 select coalesce(1 = true, t0.c0 > 0) from t0;
 select count(all coalesce ((case coalesce (((r'Mk|8''Fx#S4ᬊ')||(time 
'07:11:45')), ((r'')||(interval '-87' second))) when case cast(t0.c0 as double) 
when sql_max(r'', null) 
-then ((12)/(23)) end then cast("truncate"(r'bgmV\n[E!Ld}+ᅲ?^䋖9}z8j09뗓', 54) as 
boolean) else (coalesce (true, true, r'1', true)) = false end) = true, (t0.c0) 
not in (t0.c0))) from t0;
+then ((12)/(23)) end then cast("truncate"(r'1', 54) as boolean) else (coalesce 
(true, true, r'1', true)) = false end) = true, (t0.c0) not in (t0.c0))) from t0;
 ROLLBACK;
 
 START TRANSACTION; -- Bug 6924
diff --git a/sql/test/SQLancer/Tests/sqlancer03.stable.out 
b/sql/test/SQLancer/Tests/sqlancer03.stable.out
--- a/sql/test/SQLancer/Tests/sqlancer03.stable.out
+++ b/sql/test/SQLancer/Tests/sqlancer03.stable.out
@@ -401,6 +401,39 @@ stdout of test 'sqlancer03` in directory
 % 12 # length
 [ 9.70 ]
 #ROLLBACK;
+#START TRANSACTION; --Bug 6928
+#CREATE TABLE "sys"."t0" ("c0" DECIMAL(18,3) DEFAULT 0.968720);
+#COPY 5 RECORDS INTO "sys"."t0" FROM stdin USING DELIMITERS E'\t',E'\n','"';
+#0.938
+#0.958
+#0.877
+#0.550
+#0.916
+[ 5    ]
+#select coalesce(1 = true, false);
+% .%4 # table_name
+% %4 # name
+% boolean # type
+% 5 # length
+[ true ]
+#select coalesce(1 = true, t0.c0 > 0) from t0;
+% .%3 # table_name
+% %3 # name
+% boolean # type
+% 5 # length
+[ true ]
+[ true ]
+[ true ]
+[ true ]
+[ true ]
+#select count(all coalesce ((case coalesce (((r'Mk|8''Fx#S4ᬊ')||(time 
'07:11:45')), ((r'')||(interval '-87' second))) when case cast(t0.c0 as double) 
when sql_max(r'', null) 
+#then ((12)/(23)) end then cast("truncate"(r'1', 54) as boolean) else 
(coalesce (true, true, r'1', true)) = false end) = true, (t0.c0) not in 
(t0.c0))) from t0;
+% .%7 # table_name
+% %7 # name
+% bigint # type
+% 1 # length
+[ 5    ]
+#ROLLBACK;
 #START TRANSACTION; -- Bug 6924
 #CREATE TABLE "sys"."t0" ("a" INTEGER, "b" INTEGER NOT NULL, CONSTRAINT 
"t0_a_b_unique" UNIQUE ("a","b"));
 #COPY 39 RECORDS INTO "sys"."t0" FROM stdin USING DELIMITERS E'\t',E'\n','"';
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to