Changeset: b56c85418573 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/b56c85418573 Branch: default Log Message:
Merged with Jul2021 diffs (93 lines): diff --git a/sql/server/rel_dump.c b/sql/server/rel_dump.c --- a/sql/server/rel_dump.c +++ b/sql/server/rel_dump.c @@ -952,7 +952,7 @@ parse_atom(mvc *sql, char *r, int *pos, lng value = a->data.val.lval; const lng one = 1; #endif - int bits = (int) digits2bits(strlen(st)), obits = bits; + int bits = (int) digits2bits((unsigned) strlen(st)), obits = bits; while (bits > 0 && (bits == sizeof(value) * 8 || (one << (bits - 1)) > value)) bits--; diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c --- a/sql/server/rel_select.c +++ b/sql/server/rel_select.c @@ -565,7 +565,7 @@ find_table_function(mvc *sql, char *snam node *nn = n->next; if (!execute_priv(sql, sf->func)) - list_remove_node(funcs, NULL, n); + list_remove_node(ff, NULL, n); n = nn; } } @@ -1758,7 +1758,7 @@ static sql_exp* node *nn = n->next; if (!execute_priv(sql, sf->func)) - list_remove_node(funcs, NULL, n); + list_remove_node(ff, NULL, n); n = nn; } } diff --git a/sql/test/SQLancer/Tests/All b/sql/test/SQLancer/Tests/All --- a/sql/test/SQLancer/Tests/All +++ b/sql/test/SQLancer/Tests/All @@ -16,4 +16,4 @@ sqlancer15 sqlancer16 sqlancer17 sqlancer18 -sqlancer19 +KNOWNFAIL?sqlancer19 diff --git a/sql/test/SQLancer/Tests/sqlancer19.SQL.py b/sql/test/SQLancer/Tests/sqlancer19.SQL.py --- a/sql/test/SQLancer/Tests/sqlancer19.SQL.py +++ b/sql/test/SQLancer/Tests/sqlancer19.SQL.py @@ -76,6 +76,14 @@ with SQLTestCase() as cli: .assertSucceeded().assertDataResultMatch([(Decimal('3.571'),)]) cli.execute("SELECT 3 / 0.84 FROM rt3 where rt3.c0 = 1;") \ .assertSucceeded().assertDataResultMatch([(Decimal('3.571'),)]) + cli.execute("SELECT greatest('69', splitpart('', '191', 2)) FROM t3 where t3.c0 = 1;") \ + .assertSucceeded().assertDataResultMatch([('69',)]) + cli.execute("SELECT greatest('69', splitpart('', '191', 2)) FROM rt3 where rt3.c0 = 1;") \ + .assertSucceeded().assertDataResultMatch([('69',)]) + cli.execute("SELECT 1 FROM t3 WHERE (t3.c0 BETWEEN t3.c0 AND t3.c0) IS NULL;") \ + .assertSucceeded().assertDataResultMatch([]) + cli.execute("SELECT 2 FROM rt3 WHERE (rt3.c0 BETWEEN rt3.c0 AND rt3.c0) IS NULL;") \ + .assertSucceeded().assertDataResultMatch([]) cli.execute("ROLLBACK;") cli.execute(""" diff --git a/sql/test/Users/Tests/function_privs.SQL.py b/sql/test/Users/Tests/function_privs.SQL.py --- a/sql/test/Users/Tests/function_privs.SQL.py +++ b/sql/test/Users/Tests/function_privs.SQL.py @@ -18,6 +18,15 @@ with SQLTestCase() as mdb: mdb.execute("CREATE SCHEMA my_schema AUTHORIZATION my_role;").assertSucceeded() mdb.execute("CREATE USER my_user WITH PASSWORD 'p1' NAME 'my_user' SCHEMA sys;").assertSucceeded() mdb.execute("CREATE USER my_user2 WITH PASSWORD 'p2' NAME 'my_user2' SCHEMA sys;").assertSucceeded() + + mdb.execute(""" + create procedure dontcallme(a int, b int, c int) + begin + create table x(x int, y int, z int); + insert into x values (a,b,c); + end; + """).assertSucceeded() + mdb.execute("SET SCHEMA my_schema;").assertSucceeded() mdb.execute("CREATE TABLE version (name VARCHAR(10), i INT);").assertSucceeded() mdb.execute("INSERT INTO version VALUES ('test1', 1);").assertRowCount(1) @@ -151,6 +160,7 @@ with SQLTestCase() as mdb: # my_user2 can only indirectly SEL/INS/UPD/DEL the table through the functions tc.connect(username="my_user2", password="p2") + tc.execute("CALL dontcallme(1,2,3);").assertFailed(err_code="42000", err_message="SELECT: insufficient privileges for operator 'dontcallme'(tinyint, tinyint, tinyint)") tc.execute("SET SCHEMA my_schema;").assertSucceeded() tc.execute("INSERT INTO version (name, i) VALUES ('test2', 2);").assertFailed(err_code="42000", err_message="INSERT INTO: insufficient privileges for user 'my_user2' to insert into table 'version'") tc.execute("UPDATE version SET name = 'test22' WHERE i = 2;").assertFailed(err_code="42000", err_message="UPDATE: insufficient privileges for user 'my_user2' to update table 'version'") @@ -214,4 +224,5 @@ with SQLTestCase() as mdb: mdb.execute("DROP ROLE my_role;").assertSucceeded() mdb.execute("DROP SCHEMA my_schema;").assertSucceeded() mdb.execute("DROP SCHEMA your_schema;").assertSucceeded() + mdb.execute("DROP PROCEDURE dontcallme;").assertSucceeded() _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list