Changeset: 97ee82b9df27 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/97ee82b9df27
Added Files:
sql/test/BugTracker-2026/Tests/7959-double-function-destroy.test
Modified Files:
sql/server/sql_qc.c
sql/test/BugTracker-2026/Tests/All
sql/test/SQLancer/Tests/sqlancer11.test
Branch: Dec2025
Log Message:
added test for issue #7959
fixed issue of double freeing a mal plan.
diffs (90 lines):
diff --git a/sql/server/sql_qc.c b/sql/server/sql_qc.c
--- a/sql/server/sql_qc.c
+++ b/sql/server/sql_qc.c
@@ -32,7 +32,7 @@ qc_create(allocator *sa, int clientid, i
static void
cq_delete(int clientid, cq *q)
{
- if (q->name)
+ if (q->name && q->f && q->f->instantiated)
backend_freecode(NULL, clientid, q->name);
/* q, params and name are allocated using sa, ie need to be delete last
*/
if (q->sa)
@@ -42,7 +42,7 @@ cq_delete(int clientid, cq *q)
static void
cq_restart(int clientid, cq *q)
{
- if (q->f->imp)
+ if (q->f && q->f->imp && q->f->instantiated)
backend_freecode(NULL, clientid, q->f->imp);
q->f->instantiated = false;
}
diff --git a/sql/test/BugTracker-2026/Tests/7959-double-function-destroy.test
b/sql/test/BugTracker-2026/Tests/7959-double-function-destroy.test
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2026/Tests/7959-double-function-destroy.test
@@ -0,0 +1,18 @@
+statement ok
+PREPARE SELECT 1
+
+statement error
+SELECT * FROM non_existent_table
+
+query I
+SELECT 1
+----
+1
+
+statement error
+SELECT * FROM another_non_existent_table;
+
+query I
+SELECT 1
+----
+1
diff --git a/sql/test/BugTracker-2026/Tests/All
b/sql/test/BugTracker-2026/Tests/All
--- a/sql/test/BugTracker-2026/Tests/All
+++ b/sql/test/BugTracker-2026/Tests/All
@@ -143,3 +143,4 @@ KNOWNFAIL?7954-exp_visitor-crash
KNOWNFAIL?7955-rel_setop_get_statistics-crash
KNOWNFAIL?7956-rel_remove_const_aggr-crash
KNOWNFAIL?7957-tail_type-crash
+7959-double-function-destroy
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
@@ -53,32 +53,13 @@ statement ok
CREATE TABLE "sys"."t0" ("c0" BOOLEAN,"c1" DECIMAL(14,3))
statement ok rowcount 7
-COPY 7 RECORDS INTO "sys"."t0" FROM stdin USING DELIMITERS E'\t',E'\n','"'
-<COPY_INTO_DATA>
-false 0.458
-true 4.112
-false 0.201
-false 0.347
-true 0.420
-false 0.127
-false 0.502
+insert into t0 values(false, 0.458), (true, 4.112), (false, 0.201), (false,
0.347), (true, 0.420), (false, 0.127), (false, 0.502)
statement ok
CREATE TABLE "sys"."t1" ("c0" BOOLEAN,"c1" DECIMAL(14,3))
statement ok rowcount 10
-COPY 10 RECORDS INTO "sys"."t1" FROM stdin USING DELIMITERS E'\t',E'\n','"'
-<COPY_INTO_DATA>
-NULL 0.000
-false 0.187
-false 0.000
-false NULL
-false NULL
-true NULL
-NULL 0.325
-NULL 0.374
-true NULL
-true NULL
+insert into t1 values(NULL, 0.000), (false, 0.187), (false, 0.000), (false,
NULL), (false, NULL), (true, NULL), (NULL, 0.325), (NULL, 0.374), (true, NULL),
(true, NULL)
statement error GDK reported error: BATsubcross: more than one match
select 1 from t1, t0 where cast(t1.c1 as clob) not like ((select 'A' from t0,
t1) except all (select 'B' from t0))
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]