Changeset: fc6aaa7ee3e5 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/fc6aaa7ee3e5
Added Files:
        sql/test/BugTracker-2026/Tests/7781-truncate-sys-tables-corrupts-db.test
Modified Files:
        sql/test/BugTracker-2026/Tests/All
Branch: Dec2025
Log Message:

Add test for #7781
We need to prevent any user to TRUNCATE any of the system tables in sys, tmp 
and logging.
Idem for DELETE statement.


diffs (50 lines):

diff --git 
a/sql/test/BugTracker-2026/Tests/7781-truncate-sys-tables-corrupts-db.test 
b/sql/test/BugTracker-2026/Tests/7781-truncate-sys-tables-corrupts-db.test
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2026/Tests/7781-truncate-sys-tables-corrupts-db.test
@@ -0,0 +1,34 @@
+-- 1. Truncate a critical system table
+statement error TRUNCATE system tables is not allowed
+TRUNCATE TABLE sys._tables
+
+-- 2. Observe that metadata is gone (optional)
+query I nosort
+SELECT COUNT(*) > 0 FROM sys._tables
+----
+1
+
+statement error TRUNCATE system tables is not allowed
+TRUNCATE TABLE sys.auths     -- Immediate loss of credential checking
+
+query I nosort
+SELECT COUNT(*) > 0 FROM sys.auths
+----
+1
+
+statement error TRUNCATE system tables is not allowed
+TRUNCATE TABLE sys._columns   -- Loss of column definitions
+
+query I nosort
+SELECT COUNT(*) > 0 FROM sys._columns
+----
+1
+
+statement error TRUNCATE system tables is not allowed
+TRUNCATE TABLE sys.functions  -- Loss of built-in and user functions
+
+query I nosort
+SELECT COUNT(*) > 0 FROM sys.functions
+----
+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
@@ -5,6 +5,7 @@
 7771-assertion-failure
 7774-insert-into-renamed-table-assertion-failure
 7775-assertion-failure
+KNOWNFAIL?7781-truncate-sys-tables-corrupts-db
 7780-unnest-slow
 7782-roles-view
 7783-deleted-row
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to