New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
System function RDB$ROLE_IN_USE cannot take long role names [CORE5593] #5859
Comments
Modified by: @AlexPeshkoffassignee: Alexander Peshkov [ alexpeshkoff ] |
Commented by: @dyemanov I don't see this issue in the code. All built-in functions don't have declared parameter types/lengths, they accept whatever is passed. The problem is whether the argument can be converted to the expected datatype. RDB$ROLE_IN_USE expects a string of arbitrary length, I don't see any limit implied there. |
Commented by: @AlexPeshkoff When long role name is used RDB$ROLE_IN_USE incorrectly returns false even in a case RDB$ROLE_IN_USE(current_role) |
Commented by: @AlexPeshkoff There were 2 issues - first, varchar(32) in documentation, which was obviously wrong limit, Dmitry is right, built-in functions accept whatever is passed. But there was one more issue - case sensitivity. I've blindly uppercased role name what is definitely wrong - we may have roles with lower case letters, moreover, we may have SOMEROLE and SomeRole, and that will be 2 different roles. The small problem with this function is that we can't use double quotes to mark names of case-sensitive roles - we should be able to accept strings returned by CURRENT_ROLE, values in RDB$ROLE_NAME field, and they all do not contain double quotes. Therefore the only working solution is to always enter role name case sensitive. |
Modified by: @AlexPeshkoffstatus: Open [ 1 ] => Resolved [ 5 ] resolution: Fixed [ 1 ] Fix Version: 4.0 Beta 1 [ 10750 ] |
Modified by: @pavel-zotovstatus: Resolved [ 5 ] => Resolved [ 5 ] QA Status: No test => Done with caveats Test Details: We also have to check cases when role contains NON-ASCII characters but currently this is impossible.
|
Submitted by: @helebor
Function RDB$ROLE_IN_USE takes a varchar(32), which is meant to be a role name. Varchar(32) won't be long enough to take
a longer role name.
Commits: 61b4bf0
====== Test Details ======
We also have to check cases when role contains NON-ASCII characters but currently this is impossible.
Exception like:
===
- is raised when non-ascii role contains only ~40 *characters* and connection charset = UTF8.
Sent letter to Alex, 23.06.2018 09:21, waiting for reply.
The text was updated successfully, but these errors were encountered: