Changeset: 3be3e07916ca for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/3be3e07916ca
Added Files:
sql/test/BugTracker-2026/Tests/8002-schema-renaming-makes-seq-invalid-bug.test
Modified Files:
sql/test/BugTracker-2026/Tests/All
Branch: Dec2025
Log Message:
Add test for issue #8002
diffs (74 lines):
diff --git
a/sql/test/BugTracker-2026/Tests/8002-schema-renaming-makes-seq-invalid-bug.test
b/sql/test/BugTracker-2026/Tests/8002-schema-renaming-makes-seq-invalid-bug.test
new file mode 100644
--- /dev/null
+++
b/sql/test/BugTracker-2026/Tests/8002-schema-renaming-makes-seq-invalid-bug.test
@@ -0,0 +1,61 @@
+statement ok
+CREATE SCHEMA test_schema
+
+statement ok
+CREATE SEQUENCE test_schema.myseq AS INTEGER
+
+query T nosort
+SELECT name FROM sys.schemas
+ WHERE name = 'test_schema'
+----
+test_schema
+
+query T nosort
+SELECT name FROM sys.sequences
+ WHERE name = 'myseq'
+ AND schema_id IN (SELECT id FROM sys.schemas WHERE name = 'test_schema')
+----
+myseq
+
+query I nosort
+SELECT next_value_for('test_schema', 'myseq')
+----
+1
+
+statement ok
+ALTER SCHEMA "test_schema" RENAME TO "new_schema"
+
+query T nosort
+SELECT name FROM sys.schemas
+ WHERE name IN ('test_schema', 'new_schema')
+----
+new_schema
+
+query T nosort
+SELECT name FROM sys.sequences
+ WHERE name = 'myseq'
+ AND schema_id IN (SELECT id FROM sys.schemas WHERE name = 'new_schema')
+----
+myseq
+
+-- next query incorrectly fails with error HY050!Cannot find the sequence
new_schema.myseq
+query I nosort
+SELECT next_value_for('new_schema', 'myseq')
+----
+2
+
+statement error 3F000!Cannot find the schema test_schema
+SELECT next_value_for('test_schema', 'myseq')
+
+statement ok
+DROP SEQUENCE new_schema.myseq
+
+statement ok
+DROP SEQUENCE IF EXISTS test_schema.myseq
+
+statement ok
+DROP SCHEMA new_schema
+
+statement ok
+DROP SCHEMA IF EXISTS test_schema
+
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
@@ -182,3 +182,4 @@ KNOWNFAIL?7998-scalar-subquery-error-msg
7999-not-not-expr-bug
KNOWNFAIL?8000-select-count-distinct-assert-failure
KNOWNFAIL?8001-select-count-where-having-bug
+KNOWNFAIL?8002-schema-renaming-makes-seq-invalid-bug
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]