Changeset: 9ea4933a2723 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9ea4933a2723
Modified Files:
        sql/server/rel_unnest.c
        sql/test/SQLancer/Tests/sqlancer07.sql
        sql/test/SQLancer/Tests/sqlancer07.stable.out
Branch: octbugs
Log Message:

I have to revert my change, it causes other issues


diffs (102 lines):

diff --git a/sql/server/rel_unnest.c b/sql/server/rel_unnest.c
--- a/sql/server/rel_unnest.c
+++ b/sql/server/rel_unnest.c
@@ -3203,7 +3203,7 @@ rewrite_values(visitor *v, sql_rel *rel)
                return rel;
        sql_exp *e = rel->exps->h->data;
 
-       if (!is_values(e) || list_length(exp_get_values(e))<=1 || 
(!rel_has_freevar(v->sql, rel) && !exp_has_rel(e)))
+       if (!is_values(e) || list_length(exp_get_values(e))<=1 || 
!rel_has_freevar(v->sql, rel))
                return rel;
 
        list *exps = sa_list(v->sql->sa);
@@ -3230,8 +3230,7 @@ rewrite_values(visitor *v, sql_rel *rel)
                                rel_set_exps(nrel, exps);
                                set_processed(nrel);
                        }
-                       if (!list_empty(nrel->exps))
-                               cur = nrel;
+                       cur = nrel;
                }
                rel = cur;
                set_single(rel);
diff --git a/sql/test/SQLancer/Tests/sqlancer07.sql 
b/sql/test/SQLancer/Tests/sqlancer07.sql
--- a/sql/test/SQLancer/Tests/sqlancer07.sql
+++ b/sql/test/SQLancer/Tests/sqlancer07.sql
@@ -228,3 +228,32 @@ CREATE TABLE "t1" ("c0" BIGINT NOT NULL,
 INSERT INTO t1(c0) VALUES(2), (+ ((VALUES (sql_min(3, 4)))));
 SELECT * from t1;
 ROLLBACK;
+
+START TRANSACTION;
+CREATE TABLE "t0" ("c0" TIMESTAMP NOT NULL,CONSTRAINT "t0_c0_pkey" PRIMARY KEY 
("c0"),CONSTRAINT "t0_c0_unique" UNIQUE ("c0"));
+COPY 5 RECORDS INTO "t0" FROM stdin USING DELIMITERS E'\t',E'\n','"';
+"1970-01-06 01:52:11.000000"
+"1970-01-14 10:55:10.000000"
+"1970-01-04 18:13:57.000000"
+"1970-01-03 16:27:13.000000"
+"1970-01-07 23:49:20.000000"
+
+CREATE TABLE "t1" ("c0" TIMESTAMP,CONSTRAINT "t1_c0_unique" UNIQUE ("c0"));
+CREATE TABLE "t2" ("c0" TIMESTAMP NOT NULL,CONSTRAINT "t2_c0_pkey" PRIMARY KEY 
("c0"));
+COPY 5 RECORDS INTO "t2" FROM stdin USING DELIMITERS E'\t',E'\n','"';
+"1970-01-18 20:11:31.000000"
+"1970-01-17 19:38:53.000000"
+"1970-01-04 22:47:27.000000"
+"1970-01-19 03:36:31.000000"
+"1970-01-06 00:11:21.000000"
+
+create view v0(c0) as (values (((-839450346)||(0.2907855)))) with check option;
+create view v1(c0) as (with cte0(c0) as (values (case when ((true)or(true)) 
then ((0.75)&(0.16181643)) else 0.5068248 end)) select all 0.48 from t1, v0, 
t2,t0,cte0);
+create view v2(c0) as (select distinct interval '883554454' month from t1, t2) 
with check option;
+
+VALUES ('b' LIKE (SELECT 'a' FROM t1)), (EXISTS (SELECT 1 WHERE TRUE));
+       -- NULL
+       -- True
+SELECT (VALUES ((('524519669')NOT ILIKE((SELECT 'X囊*T\f' FROM t1, v2 WHERE 
FALSE)))), (NOT EXISTS (SELECT DISTINCT sql_min(0.52, 0.90) WHERE TRUE))) FROM 
v1, t2 RIGHT OUTER JOIN v0 ON ((v0.c0)<>('Vx'));
+       -- empty
+ROLLBACK;
diff --git a/sql/test/SQLancer/Tests/sqlancer07.stable.out 
b/sql/test/SQLancer/Tests/sqlancer07.stable.out
--- a/sql/test/SQLancer/Tests/sqlancer07.stable.out
+++ b/sql/test/SQLancer/Tests/sqlancer07.stable.out
@@ -327,6 +327,40 @@ stdout of test 'sqlancer07` in directory
 [ 2    ]
 [ 3    ]
 #ROLLBACK;
+#START TRANSACTION;
+#CREATE TABLE "t0" ("c0" TIMESTAMP NOT NULL,CONSTRAINT "t0_c0_pkey" PRIMARY 
KEY ("c0"),CONSTRAINT "t0_c0_unique" UNIQUE ("c0"));
+#COPY 5 RECORDS INTO "t0" FROM stdin USING DELIMITERS E'\t',E'\n','"';
+#"1970-01-06 01:52:11.000000"
+#"1970-01-14 10:55:10.000000"
+#"1970-01-04 18:13:57.000000"
+#"1970-01-03 16:27:13.000000"
+#"1970-01-07 23:49:20.000000"
+[ 5    ]
+#CREATE TABLE "t1" ("c0" TIMESTAMP,CONSTRAINT "t1_c0_unique" UNIQUE ("c0"));
+#CREATE TABLE "t2" ("c0" TIMESTAMP NOT NULL,CONSTRAINT "t2_c0_pkey" PRIMARY 
KEY ("c0"));
+#COPY 5 RECORDS INTO "t2" FROM stdin USING DELIMITERS E'\t',E'\n','"';
+#"1970-01-18 20:11:31.000000"
+#"1970-01-17 19:38:53.000000"
+#"1970-01-04 22:47:27.000000"
+#"1970-01-19 03:36:31.000000"
+#"1970-01-06 00:11:21.000000"
+[ 5    ]
+#create view v0(c0) as (values (((-839450346)||(0.2907855)))) with check 
option;
+#create view v1(c0) as (with cte0(c0) as (values (case when ((true)or(true)) 
then ((0.75)&(0.16181643)) else 0.5068248 end)) select all 0.48 from t1, v0, 
t2,t0,cte0);
+#create view v2(c0) as (select distinct interval '883554454' month from t1, 
t2) with check option;
+#VALUES ('b' LIKE (SELECT 'a' FROM t1)), (EXISTS (SELECT 1 WHERE TRUE));
+% .%1 # table_name
+% %1 # name
+% boolean # type
+% 5 # length
+[ NULL ]
+[ true ]
+#SELECT (VALUES ((('524519669')NOT ILIKE((SELECT 'X囊*T\f' FROM t1, v2 WHERE 
FALSE)))), (NOT EXISTS (SELECT DISTINCT sql_min(0.52, 0.90) WHERE TRUE))) FROM 
v1, t2 RIGHT OUTER JOIN v0 ON ((v0.c0)<>('Vx'));
+% .%7 # table_name
+% %7 # name
+% boolean # type
+% 5 # length
+#ROLLBACK;
 
 # 10:16:14 >  
 # 10:16:14 >  "Done."
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to