Changeset: 52e9961b2e3a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/52e9961b2e3a
Modified Files:
sql/test/BugTracker-2025/Tests/All
sql/test/emptydb/Tests/check.stable.out
sql/test/emptydb/Tests/check.stable.out.int128
testing/Mtest.py.in
Branch: default
Log Message:
Merge with Mar2025 branch.
diffs (truncated from 477 to 300 lines):
diff --git a/sql/backends/monet5/sql_user.c b/sql/backends/monet5/sql_user.c
--- a/sql/backends/monet5/sql_user.c
+++ b/sql/backends/monet5/sql_user.c
@@ -27,6 +27,7 @@
#include "mal_authorize.h"
#include "mcrypt.h"
#include "sql_execute.h"
+#include "opt_pipes.h"
static inline sql_table*
getUsersTbl(mvc *m)
@@ -321,6 +322,11 @@ monet5_create_user(ptr _mvc, str user, s
if (!optimizer)
optimizer = default_optimizer;
+ if (!isOptimizerPipe(optimizer)) {
+ GDKfree(schema_buf);
+ throw(MAL, "sql.create_user", SQLSTATE(42000) "Optimizer pipe
%s unknown", optimizer);
+ }
+
if (!enc) {
if (!(pwd = mcrypt_BackendSum(passwd, strlen(passwd)))) {
diff --git a/sql/test/BugTracker-2025/Tests/7699-create-user.test
b/sql/test/BugTracker-2025/Tests/7699-create-user.test
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2025/Tests/7699-create-user.test
@@ -0,0 +1,7 @@
+statement error
+CREATE USER test WITH PASSWORD 'me' NAME 'tester' OPTIMIZER 'xyz'
+
+query TTITIITI
+SELECT * FROM sys.users WHERE name = 'tester'
+----
+
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
@@ -46,6 +46,7 @@ 7695-antijoin-without-expressions
7696-antijoin-with-complex-expression
7697-exists-any-semantics
7698-get-statistics-problem
+7699-create-user
7701-alter-user-max_workers
7702-stmt_convert_cands
7703-left-join
diff --git a/sql/test/emptydb/Tests/check.SQL.py
b/sql/test/emptydb/Tests/check.SQL.py
--- a/sql/test/emptydb/Tests/check.SQL.py
+++ b/sql/test/emptydb/Tests/check.SQL.py
@@ -87,7 +87,7 @@ sys_pkeys = [
('var_values', 'var_name'),
('table_partitions', 'id'),
- ('range_partitions', 'table_id, partition_id, minimum'),
+ ('range_partitions', 'table_id'),
('value_partitions', 'table_id, partition_id, "value"'),
('queue', 'tag'),
@@ -131,7 +131,6 @@ sys_akeys = [
('table_partitions WHERE column_id IS NOT NULL', 'table_id, column_id'),
('table_partitions WHERE "expression" IS NOT NULL', 'table_id,
"expression"'),
- ('range_partitions', 'table_id, partition_id, "maximum"'),
('fkey_actions', 'action_name'),
('fkeys', 'table_id, name'),
diff --git a/sql/test/emptydb/Tests/check.stable.out
b/sql/test/emptydb/Tests/check.stable.out
--- a/sql/test/emptydb/Tests/check.stable.out
+++ b/sql/test/emptydb/Tests/check.stable.out
@@ -114,7 +114,7 @@ select 'duplicates in comments', count(*
select 'duplicates in ids', count(*), id from sys.ids group by id having
count(*) > 1;
select 'duplicates in var_values', count(*), var_name from sys.var_values
group by var_name having count(*) > 1;
select 'duplicates in table_partitions', count(*), id from
sys.table_partitions group by id having count(*) > 1;
-select 'duplicates in range_partitions', count(*), table_id, partition_id,
minimum from sys.range_partitions group by table_id, partition_id, minimum
having count(*) > 1;
+select 'duplicates in range_partitions', count(*), table_id from
sys.range_partitions group by table_id having count(*) > 1;
select 'duplicates in value_partitions', count(*), table_id, partition_id,
"value" from sys.value_partitions group by table_id, partition_id, "value"
having count(*) > 1;
select 'duplicates in queue', count(*), tag from sys.queue group by tag having
count(*) > 1;
select 'duplicates in sessions', count(*), sessionid from sys.sessions group
by sessionid having count(*) > 1;
@@ -149,7 +149,6 @@ select 'duplicates in privilege_codes',
select 'duplicates in comments', count(*), id from sys.comments group by id
having count(*) > 1;
select 'duplicates in table_partitions WHERE column_id IS NOT NULL', count(*),
table_id, column_id from sys.table_partitions WHERE column_id IS NOT NULL group
by table_id, column_id having count(*) > 1;
select 'duplicates in table_partitions WHERE expression IS NOT NULL',
count(*), table_id, "expression" from sys.table_partitions WHERE "expression"
IS NOT NULL group by table_id, "expression" having count(*) > 1;
-select 'duplicates in range_partitions', count(*), table_id, partition_id,
"maximum" from sys.range_partitions group by table_id, partition_id, "maximum"
having count(*) > 1;
select 'duplicates in fkey_actions', count(*), action_name from
sys.fkey_actions group by action_name having count(*) > 1;
select 'duplicates in fkeys', count(*), table_id, name from sys.fkeys group by
table_id, name having count(*) > 1;
select 'missing reference in schemas authorization', authorization, * from
sys.schemas where (authorization) not in (select id from sys.auths);
@@ -5782,10 +5781,10 @@ select 'null in fkeys.delete_action', de
% %2, %1, id # name
% varchar, bigint, int # type
% 0, 1, 1 # length
-% .%2, sys.%1, sys.range_partitions, sys.range_partitions,
sys.range_partitions # table_name
-% %2, %1, table_id, partition_id, minimum # name
-% varchar, bigint, int, int, varchar # type
-% 0, 1, 1, 1, 0 # length
+% .%2, sys.%1, sys.range_partitions # table_name
+% %2, %1, table_id # name
+% varchar, bigint, int # type
+% 0, 1, 1 # length
% .%2, sys.%1, sys.value_partitions, sys.value_partitions,
sys.value_partitions # table_name
% %2, %1, table_id, partition_id, value # name
% varchar, bigint, int, int, varchar # type
@@ -5922,10 +5921,6 @@ select 'null in fkeys.delete_action', de
% %2, %1, table_id, expression # name
% varchar, bigint, int, varchar # type
% 0, 1, 1, 0 # length
-% .%2, sys.%1, sys.range_partitions, sys.range_partitions,
sys.range_partitions # table_name
-% %2, %1, table_id, partition_id, maximum # name
-% varchar, bigint, int, int, varchar # type
-% 0, 1, 1, 1, 0 # length
% .%2, sys.%1, sys.fkey_actions # table_name
% %2, %1, action_name # name
% varchar, bigint, varchar # type
diff --git a/sql/test/emptydb/Tests/check.stable.out.32bit
b/sql/test/emptydb/Tests/check.stable.out.32bit
--- a/sql/test/emptydb/Tests/check.stable.out.32bit
+++ b/sql/test/emptydb/Tests/check.stable.out.32bit
@@ -114,7 +114,7 @@ select 'duplicates in comments', count(*
select 'duplicates in ids', count(*), id from sys.ids group by id having
count(*) > 1;
select 'duplicates in var_values', count(*), var_name from sys.var_values
group by var_name having count(*) > 1;
select 'duplicates in table_partitions', count(*), id from
sys.table_partitions group by id having count(*) > 1;
-select 'duplicates in range_partitions', count(*), table_id, partition_id,
minimum from sys.range_partitions group by table_id, partition_id, minimum
having count(*) > 1;
+select 'duplicates in range_partitions', count(*), table_id from
sys.range_partitions group by table_id having count(*) > 1;
select 'duplicates in value_partitions', count(*), table_id, partition_id,
"value" from sys.value_partitions group by table_id, partition_id, "value"
having count(*) > 1;
select 'duplicates in queue', count(*), tag from sys.queue group by tag having
count(*) > 1;
select 'duplicates in sessions', count(*), sessionid from sys.sessions group
by sessionid having count(*) > 1;
@@ -149,7 +149,6 @@ select 'duplicates in privilege_codes',
select 'duplicates in comments', count(*), id from sys.comments group by id
having count(*) > 1;
select 'duplicates in table_partitions WHERE column_id IS NOT NULL', count(*),
table_id, column_id from sys.table_partitions WHERE column_id IS NOT NULL group
by table_id, column_id having count(*) > 1;
select 'duplicates in table_partitions WHERE expression IS NOT NULL',
count(*), table_id, "expression" from sys.table_partitions WHERE "expression"
IS NOT NULL group by table_id, "expression" having count(*) > 1;
-select 'duplicates in range_partitions', count(*), table_id, partition_id,
"maximum" from sys.range_partitions group by table_id, partition_id, "maximum"
having count(*) > 1;
select 'duplicates in fkey_actions', count(*), action_name from
sys.fkey_actions group by action_name having count(*) > 1;
select 'duplicates in fkeys', count(*), table_id, name from sys.fkeys group by
table_id, name having count(*) > 1;
select 'missing reference in schemas authorization', authorization, * from
sys.schemas where (authorization) not in (select id from sys.auths);
@@ -5732,10 +5731,10 @@ select 'null in fkeys.delete_action', de
% %2, %1, id # name
% varchar, bigint, int # type
% 0, 1, 1 # length
-% .%2, sys.%1, sys.range_partitions, sys.range_partitions,
sys.range_partitions # table_name
-% %2, %1, table_id, partition_id, minimum # name
-% varchar, bigint, int, int, varchar # type
-% 0, 1, 1, 1, 0 # length
+% .%2, sys.%1, sys.range_partitions # table_name
+% %2, %1, table_id # name
+% varchar, bigint, int # type
+% 0, 1, 1 # length
% .%2, sys.%1, sys.value_partitions, sys.value_partitions,
sys.value_partitions # table_name
% %2, %1, table_id, partition_id, value # name
% varchar, bigint, int, int, varchar # type
@@ -5872,10 +5871,6 @@ select 'null in fkeys.delete_action', de
% %2, %1, table_id, expression # name
% varchar, bigint, int, varchar # type
% 0, 1, 1, 0 # length
-% .%2, sys.%1, sys.range_partitions, sys.range_partitions,
sys.range_partitions # table_name
-% %2, %1, table_id, partition_id, maximum # name
-% varchar, bigint, int, int, varchar # type
-% 0, 1, 1, 1, 0 # length
% .%2, sys.%1, sys.fkey_actions # table_name
% %2, %1, action_name # name
% varchar, bigint, varchar # type
diff --git a/sql/test/emptydb/Tests/check.stable.out.int128
b/sql/test/emptydb/Tests/check.stable.out.int128
--- a/sql/test/emptydb/Tests/check.stable.out.int128
+++ b/sql/test/emptydb/Tests/check.stable.out.int128
@@ -114,7 +114,7 @@ select 'duplicates in comments', count(*
select 'duplicates in ids', count(*), id from sys.ids group by id having
count(*) > 1;
select 'duplicates in var_values', count(*), var_name from sys.var_values
group by var_name having count(*) > 1;
select 'duplicates in table_partitions', count(*), id from
sys.table_partitions group by id having count(*) > 1;
-select 'duplicates in range_partitions', count(*), table_id, partition_id,
minimum from sys.range_partitions group by table_id, partition_id, minimum
having count(*) > 1;
+select 'duplicates in range_partitions', count(*), table_id from
sys.range_partitions group by table_id having count(*) > 1;
select 'duplicates in value_partitions', count(*), table_id, partition_id,
"value" from sys.value_partitions group by table_id, partition_id, "value"
having count(*) > 1;
select 'duplicates in queue', count(*), tag from sys.queue group by tag having
count(*) > 1;
select 'duplicates in sessions', count(*), sessionid from sys.sessions group
by sessionid having count(*) > 1;
@@ -149,7 +149,6 @@ select 'duplicates in privilege_codes',
select 'duplicates in comments', count(*), id from sys.comments group by id
having count(*) > 1;
select 'duplicates in table_partitions WHERE column_id IS NOT NULL', count(*),
table_id, column_id from sys.table_partitions WHERE column_id IS NOT NULL group
by table_id, column_id having count(*) > 1;
select 'duplicates in table_partitions WHERE expression IS NOT NULL',
count(*), table_id, "expression" from sys.table_partitions WHERE "expression"
IS NOT NULL group by table_id, "expression" having count(*) > 1;
-select 'duplicates in range_partitions', count(*), table_id, partition_id,
"maximum" from sys.range_partitions group by table_id, partition_id, "maximum"
having count(*) > 1;
select 'duplicates in fkey_actions', count(*), action_name from
sys.fkey_actions group by action_name having count(*) > 1;
select 'duplicates in fkeys', count(*), table_id, name from sys.fkeys group by
table_id, name having count(*) > 1;
select 'missing reference in schemas authorization', authorization, * from
sys.schemas where (authorization) not in (select id from sys.auths);
@@ -5925,10 +5924,10 @@ select 'null in fkeys.delete_action', de
% %2, %1, id # name
% varchar, bigint, int # type
% 0, 1, 1 # length
-% .%2, sys.%1, sys.range_partitions, sys.range_partitions,
sys.range_partitions # table_name
-% %2, %1, table_id, partition_id, minimum # name
-% varchar, bigint, int, int, varchar # type
-% 0, 1, 1, 1, 0 # length
+% .%2, sys.%1, sys.range_partitions # table_name
+% %2, %1, table_id # name
+% varchar, bigint, int # type
+% 0, 1, 1 # length
% .%2, sys.%1, sys.value_partitions, sys.value_partitions,
sys.value_partitions # table_name
% %2, %1, table_id, partition_id, value # name
% varchar, bigint, int, int, varchar # type
@@ -6065,10 +6064,6 @@ select 'null in fkeys.delete_action', de
% %2, %1, table_id, expression # name
% varchar, bigint, int, varchar # type
% 0, 1, 1, 0 # length
-% .%2, sys.%1, sys.range_partitions, sys.range_partitions,
sys.range_partitions # table_name
-% %2, %1, table_id, partition_id, maximum # name
-% varchar, bigint, int, int, varchar # type
-% 0, 1, 1, 1, 0 # length
% .%2, sys.%1, sys.fkey_actions # table_name
% %2, %1, action_name # name
% varchar, bigint, varchar # type
diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -1311,6 +1311,7 @@ def PerformDir(env, testdir, testlist, t
finally:
if pSrvr is not None:
pSrvr.sendusr1()
+ pSrvr.checkkeys()
pSrvr.terminate()
pSrvr = None
if produce_html:
@@ -2552,6 +2553,198 @@ def killProc(proc, outfile=None, cmd=Non
else:
killchildren(proc.pid)
+sys_pkeys = [
+ ('schemas', 'id'),
+ ('_tables', 'id'),
+ ('tables', 'id'),
+ ('_columns', 'id'),
+ ('columns', 'id'),
+ ('functions', 'id'),
+ ('args', 'id'),
+ ('types', 'id'),
+ ('objects', 'id, nr'),
+ ('keys', 'id'),
+ ('idxs', 'id'),
+ ('triggers', 'id'),
+ ('sequences', 'id'),
+ ('dependency_types', 'dependency_type_id'),
+ ('dependencies', 'id, depend_id'),
+ ('auths', 'id'),
+ ('users', 'name'),
+ ('user_role', 'login_id, role_id'),
+ ('privileges', 'obj_id, auth_id, privileges'),
+ ('querylog_catalog', 'id'),
+ ('querylog_calls', 'id'),
+ ('querylog_history', 'id'),
+ ('optimizers', 'name'),
+ ('environment', 'name'),
+ ('db_user_info', 'name'),
+ ('statistics', 'column_id'),
+ ('"storage"()', 'schema, "table", "column"'),
+ ('storagemodelinput', 'schema, "table", "column"'),
+
+ ('rejects', 'rowid'),
+
+ ('keywords', 'keyword'),
+ ('table_types', 'table_type_id'),
+
+ ('function_languages', 'language_id'),
+ ('function_types', 'function_type_id'),
+ ('index_types', 'index_type_id'),
+ ('key_types', 'key_type_id'),
+ ('privilege_codes', 'privilege_code_id'),
+
+ ('comments', 'id'),
+ ('ids', 'id'),
+ ('var_values', 'var_name'),
+
+ ('table_partitions', 'id'),
+ ('range_partitions', 'table_id'),
+ ('value_partitions', 'table_id, partition_id, "value"'),
+
+ ('queue', 'tag'),
+ ('sessions', 'sessionid'),
+
+ ('fkey_actions', 'action_id'),
+ ('fkeys', 'id'),
+]
+
+sys_akeys = [
+ ('schemas', 'name'),
+ ('_tables', 'schema_id, name'),
+ ('tables', 'schema_id, name'),
+ ('_columns', 'table_id, name'),
+ ('columns', 'table_id, name'),
+ ('_columns', 'table_id, number'),
+ ('columns', 'table_id, number'),
+
+ ('(SELECT id FROM sys.schemas UNION ALL SELECT id FROM sys._tables UNION
ALL SELECT id FROM sys._columns UNION ALL SELECT id FROM sys.functions) as T',
'T.id'),
+ ('(SELECT id FROM sys.schemas UNION ALL SELECT id FROM sys.tables UNION
ALL SELECT id FROM sys.columns UNION ALL SELECT id FROM sys.functions) as T',
'T.id'),
+
+ ('functions f join sys.args a on f.id=a.func_id', 'schema_id, f.name,
func, mod, language, f.type, side_effect, varres, vararg, a.id'),
+ ('args', 'func_id, name, inout'),
+ ('types', 'schema_id, systemname, sqlname'),
+ ('objects', 'id, name'),
+ ('keys', 'table_id, name'),
+ ('idxs', 'table_id, name'),
+ ('triggers', 'table_id, name'),
+ ('sequences', 'schema_id, name'),
+ ('dependency_types', 'dependency_type_name'),
+ ('auths', 'name'),
+ ('optimizers', 'def'),
+
+ ('table_types', 'table_type_name'),
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]