Changeset: 20dcd60413a7 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/20dcd60413a7
Modified Files:
        sql/backends/monet5/vaults/csv/csv.c
        sql/test/BugTracker-2025/Tests/All
Branch: default
Log Message:

Merge with Mar2025 branch.


diffs (113 lines):

diff --git a/debian/libmonetdb-client-odbc.postinst 
b/debian/libmonetdb-client-odbc.postinst
--- a/debian/libmonetdb-client-odbc.postinst
+++ b/debian/libmonetdb-client-odbc.postinst
@@ -18,8 +18,8 @@ if [ "$1" = configure ]; then
        odbcinst -i -d -r <<EOF
 [MonetDB]
 Description = ODBC for MonetDB
-Driver = /usr/lib/libMonetODBC.so
-Setup = /usr/lib/libMonetODBCs.so
+Driver = /usr/lib/x86_64-linux-gnu/libMonetODBC.so
+Setup = /usr/lib/x86_64-linux-gnu/libMonetODBCs.so
 EOF
     fi
 fi
diff --git a/sql/backends/monet5/sql_cat.c b/sql/backends/monet5/sql_cat.c
--- a/sql/backends/monet5/sql_cat.c
+++ b/sql/backends/monet5/sql_cat.c
@@ -567,11 +567,12 @@ create_trigger(mvc *sql, char *sname, ch
                        throw(SQL,"sql.create_trigger",SQLSTATE(3F000) "%s: no 
such schema '%s'", base, sname);
        }
 
-       if ((other = mvc_bind_trigger(sql, s, triggername)) && !replace)
+       other = mvc_bind_trigger(sql, s, triggername);
+       if (other && !replace)
                throw(SQL,"sql.create_trigger",SQLSTATE(3F000) "%s: name '%s' 
already in use", base, triggername);
 
-       if (replace && other) {
-               if (other->t->base.id != t->base.id) /* defensive line */
+       if (other && replace) {
+               if (t && other->t && other->t->base.id != t->base.id) /* 
defensive line */
                        throw(SQL,"sql.create_trigger",SQLSTATE(3F000) "%s: the 
to be replaced trigger '%s' is not from table '%s'", base, triggername, tname);
                switch (mvc_drop_trigger(sql, s, other)) {
                        case -1:
diff --git a/sql/test/BugTracker-2025/Tests/7659_trigger_crashes.test 
b/sql/test/BugTracker-2025/Tests/7659_trigger_crashes.test
--- a/sql/test/BugTracker-2025/Tests/7659_trigger_crashes.test
+++ b/sql/test/BugTracker-2025/Tests/7659_trigger_crashes.test
@@ -1,5 +1,4 @@
-# crashes of both issues 7659 and 7661
-# 7659
+# crash of issue 7659
 statement ok
 CREATE TABLE table1(column1 INT, column2 INT)
 
@@ -15,13 +14,3 @@ drop table table1
 statement ok
 drop table table2
 
-# 7661
-statement ok
-CREATE TABLE table1(column1 INT, column2 INT)
-
-statement error
-CREATE TRIGGER trigger6 AFTER UPDATE ON table1 REFERENCING OLD TABLE AS 
old_table NEW TABLE AS new_table FOR EACH STATEMENT SELECT * FROM sys.triggers
-
-statement ok
-drop table table1
-
diff --git a/sql/test/BugTracker-2025/Tests/7661_trigger_crash.test 
b/sql/test/BugTracker-2025/Tests/7661_trigger_crash.test
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2025/Tests/7661_trigger_crash.test
@@ -0,0 +1,10 @@
+# crash of issue 7661
+statement ok
+CREATE TABLE table1(column1 INT, column2 INT)
+
+statement error
+CREATE TRIGGER trigger6 AFTER UPDATE ON table1 REFERENCING OLD TABLE AS 
old_table NEW TABLE AS new_table FOR EACH STATEMENT SELECT * FROM sys.triggers
+
+statement ok
+drop table table1
+
diff --git a/sql/test/BugTracker-2025/Tests/7682_trigger_crash.test 
b/sql/test/BugTracker-2025/Tests/7682_trigger_crash.test
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2025/Tests/7682_trigger_crash.test
@@ -0,0 +1,24 @@
+# crash of issue 7682
+statement ok
+CREATE OR REPLACE TRIGGER trigALogin AFTER LOGIN BEGIN ATOMIC SET SCHEMA dwh; 
END
+
+query T nosort
+select name from sys.triggers where name like 'tri%'
+----
+trigalogin
+
+-- next statement used to crash the server
+statement ok
+CREATE OR REPLACE TRIGGER trigALogin AFTER LOGIN BEGIN ATOMIC SET SCHEMA dwh; 
END
+
+statement ok
+DROP TRIGGER trigALogin
+
+statement ok
+CREATE TRIGGER trigALogin AFTER LOGIN BEGIN ATOMIC SET SCHEMA dwh; END
+
+statement ok
+CREATE OR REPLACE TRIGGER trigALogin AFTER LOGIN BEGIN ATOMIC SET SCHEMA dwh; 
END
+
+statement ok
+DROP TRIGGER trigALogin
diff --git a/sql/test/BugTracker-2025/Tests/All 
b/sql/test/BugTracker-2025/Tests/All
--- a/sql/test/BugTracker-2025/Tests/All
+++ b/sql/test/BugTracker-2025/Tests/All
@@ -23,6 +23,8 @@ 7653_incorrect_join_results
 7654_non_monetdb_user_remote_table_exec
 7656_incorrect_error
 7659_trigger_crashes
+7661_trigger_crash
 7671-lag-over-empty-bat
 7674-rel_find_designated_index_crash
 7680-union-all
+7682_trigger_crash
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to