Changeset: 8a53a168b01e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/8a53a168b01e
Modified Files:
sql/backends/monet5/sql_cat.c
sql/test/BugTracker/Tests/authorization.SF-1430616-3.test
sql/test/BugTracker/Tests/set_a_new_user_password.SF-1844050.SQL.py
Branch: Jan2022
Log Message:
Throw a more descriptive error message
diffs (33 lines):
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
@@ -1467,7 +1467,7 @@ SQLdrop_schema(Client cntxt, MalBlkPtr m
if (s->system)
throw(SQL,"sql.drop_schema",SQLSTATE(42000) "DROP SCHEMA:
access denied for '%s'", sname);
if (sql_schema_has_user(sql, s))
- throw(SQL,"sql.drop_schema",SQLSTATE(2BM37) "DROP SCHEMA:
unable to drop schema '%s' (there are database objects which depend on it)",
sname);
+ throw(SQL,"sql.drop_schema",SQLSTATE(2BM37) "DROP SCHEMA:
unable to drop schema '%s' (there are database users using it as session's
default schema)", sname);
if (!action /* RESTRICT */ && (
os_size(s->tables, tr) || os_size(s->types, tr) ||
os_size(s->funcs, tr) || os_size(s->seqs, tr)))
throw(SQL,"sql.drop_schema",SQLSTATE(2BM37) "DROP SCHEMA:
unable to drop schema '%s' (there are database objects which depend on it)",
sname);
diff --git a/sql/test/BugTracker/Tests/authorization.SF-1430616-3.test
b/sql/test/BugTracker/Tests/authorization.SF-1430616-3.test
--- a/sql/test/BugTracker/Tests/authorization.SF-1430616-3.test
+++ b/sql/test/BugTracker/Tests/authorization.SF-1430616-3.test
@@ -1,4 +1,4 @@
-statement error 2BM37!DROP SCHEMA: unable to drop schema 'voc' (there are
database objects which depend on it)
+statement error 2BM37!DROP SCHEMA: unable to drop schema 'voc' (there are
database users using it as session's default schema)
DROP SCHEMA voc
statement error M1M05!DROP USER: 'voc' owns a schema
diff --git
a/sql/test/BugTracker/Tests/set_a_new_user_password.SF-1844050.SQL.py
b/sql/test/BugTracker/Tests/set_a_new_user_password.SF-1844050.SQL.py
--- a/sql/test/BugTracker/Tests/set_a_new_user_password.SF-1844050.SQL.py
+++ b/sql/test/BugTracker/Tests/set_a_new_user_password.SF-1844050.SQL.py
@@ -45,7 +45,7 @@ with tempfile.TemporaryDirectory() as fa
with server_start() as srv:
with SQLTestCase() as tc:
tc.connect(username="monetdb", password="monetdb", port=myport,
database='db1')
- tc.execute("DROP SCHEMA \"voc2\";").assertFailed(err_message='DROP
SCHEMA: unable to drop schema \'voc2\' (there are database objects which depend
on it)')
+ tc.execute("DROP SCHEMA \"voc2\";").assertFailed(err_message='DROP
SCHEMA: unable to drop schema \'voc2\' (there are database users using it as
session\'s default schema)')
tc.execute("""
ALTER user "voc2" SET SCHEMA "sys";
DROP SCHEMA "voc2";
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list