[
https://issues.apache.org/jira/browse/CASSANDRA-17848?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17631210#comment-17631210
]
Yifan Cai commented on CASSANDRA-17848:
---------------------------------------
The issue is on listing the permissions only. It either parses the stored
function name incorrectly or fails to parse. Invoking/using those functions are
allowed.
For example, the below SELECT statement runs just fine (and returns 42 as
defined in the function body).
{code:java}
SELECT a, b,
cql_test_keyspace."admin_created_udf[org.apache.cassandra.db.marshal.LongType]"(a,
b) FROM cql_test_keyspace.tbl WHERE a = 1;
{code}
If Cassandra no longer permits creating function with the disallowed
characters, the existing function should not be affected. They can still be
used like the above example. However, it does not fix the broken output form
listing permissions.
So, as Sam said, we need to do both #1 and #2.
bq. perhaps we can localise a custom parsing implementation to
`ListPermissionsStatement`, leave `FunctionResource#fromName` as it is and
tighten up the naming rules going forward?
I think `FunctionResource#fromName` is the right place to have the parsing
logic. Maybe I am missing something?
> LIST PERMISSION can display incorrect resource name
> ---------------------------------------------------
>
> Key: CASSANDRA-17848
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17848
> Project: Cassandra
> Issue Type: Bug
> Components: CQL/Interpreter
> Reporter: Yifan Cai
> Assignee: Yifan Cai
> Priority: Normal
>
> When producing the resource name, it seems to assume that the content in the
> `[]` is the function's input type, where it could also be part of the
> function name, as long as it is quoted. Here is an example to reproduce. In
> cqlsh,
> {code:java}
> > CREATE FUNCTION
> > test."admin_created_udf[org.apache.cassandra.db.marshal.LongType]"(input
> > int) RETURNS NULL ON NULL INPUT RETURNS int LANGUAGE java AS 'return 42;';
> > LIST EXECUTE OF user;
> role | username | resource | permission
> -------+----------+-----------------------------------------+------------
> user | user | <function test.admin_created_udf(long)> | EXECUTE
> (1 rows)
> {code}
> The input should be "int", but in the output, it says "long".
> If the content enclosed by "[]" is not a valid class, the LIST PERMISSION
> request always fails for the user with "ConfigurationException: Unable to
> find abstract-type class".
> The bug is discovered by Piotr Sarna.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]