Changeset: 2187e6c8161f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/2187e6c8161f
Modified Files:
monetdb5/optimizer/opt_pushselect.c
sql/test/prepare/Tests/sqlancer_prepare.sql
sql/test/prepare/Tests/sqlancer_prepare.stable.out
sql/test/prepare/Tests/sqlancer_prepare.stable.out.int128
Branch: Jul2021
Log Message:
fixed problem with sequential_pipe and push intersect down optimisation
(function resolving wasn't reexecuted, leading to the wrong function to be
called)
diffs (67 lines):
diff --git a/monetdb5/optimizer/opt_pushselect.c
b/monetdb5/optimizer/opt_pushselect.c
--- a/monetdb5/optimizer/opt_pushselect.c
+++ b/monetdb5/optimizer/opt_pushselect.c
@@ -889,7 +889,11 @@ OPTpushselectImplementation(Client cntxt
getArg(u, 3) = getArg(q,2); /* update ids */
//getArg(u, 4) = getArg(s,0);
p = pushArgument(mb, u, getArg(s,0)); /* push
at end */
+ /* make sure to resolve again */
+ u->token = ASSIGNsymbol;
u->typechk = TYPE_UNKNOWN;
+ u->fcn = NULL;
+ u->blk = NULL;
pushInstruction(mb,u);
oclean[i] = 1;
continue;
diff --git a/sql/test/prepare/Tests/sqlancer_prepare.sql
b/sql/test/prepare/Tests/sqlancer_prepare.sql
--- a/sql/test/prepare/Tests/sqlancer_prepare.sql
+++ b/sql/test/prepare/Tests/sqlancer_prepare.sql
@@ -69,3 +69,11 @@ PREPARE SELECT "quarter"(date '2021-01-0
PREPARE SELECT "quarter"(date '2021-01-02') IN ("second"(TIME '01:00:00'),
(select ? where true));
PREPARE SELECT 1 FROM idontexist(?,16); --error, function doesn't exist
+
+START TRANSACTION;
+create table deleteall (i integer, j integer);
+insert into deleteall (select a,a as b from generate_series(cast(1 as
integer),10000) as a(a));
+set optimizer='sequential_pipe';
+prepare select count(*) from deleteall where j in
(2001,2007,2016,2028,2037,2047,2053,2059,2063,2067,2076,2087,2094,2099,2110,2115,2124,2135,2142,2147);
+EXEC **();
+ROLLBACK;
diff --git a/sql/test/prepare/Tests/sqlancer_prepare.stable.out
b/sql/test/prepare/Tests/sqlancer_prepare.stable.out
--- a/sql/test/prepare/Tests/sqlancer_prepare.stable.out
+++ b/sql/test/prepare/Tests/sqlancer_prepare.stable.out
@@ -147,4 +147,14 @@
% 7, 2, 1, 0, 3, 3 # length
[ "boolean", 1, 0, "", "%11", "%11" ]
[ "decimal", 16, 6, NULL, NULL, NULL ]
-
+[ 9999 ]
+% .prepare, .prepare, .prepare, .prepare, .prepare,
.prepare # table_name
+% type, digits, scale, schema, table, column # name
+% varchar, int, int, str, str, str # type
+% 6, 2, 1, 0, 2, 2 # length
+[ "bigint", 64, 0, "", "%2", "%2" ]
+% .%2 # table_name
+% %2 # name
+% bigint # type
+% 2 # length
+[ 20 ]
diff --git a/sql/test/prepare/Tests/sqlancer_prepare.stable.out.int128
b/sql/test/prepare/Tests/sqlancer_prepare.stable.out.int128
--- a/sql/test/prepare/Tests/sqlancer_prepare.stable.out.int128
+++ b/sql/test/prepare/Tests/sqlancer_prepare.stable.out.int128
@@ -138,3 +138,14 @@
% 7, 2, 1, 0, 3, 3 # length
[ "boolean", 1, 0, "", "%11", "%11" ]
[ "decimal", 16, 6, NULL, NULL, NULL ]
+[ 9999 ]
+% .prepare, .prepare, .prepare, .prepare, .prepare,
.prepare # table_name
+% type, digits, scale, schema, table, column # name
+% varchar, int, int, str, str, str # type
+% 6, 2, 1, 0, 2, 2 # length
+[ "bigint", 64, 0, "", "%2", "%2" ]
+% .%2 # table_name
+% %2 # name
+% bigint # type
+% 2 # length
+[ 20 ]
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]