Subject Re: [firebird-support] Error while granting privileges to user with '.' in name
Author Helen Borrie
At 06:59 AM 28/03/2008, you wrote:
>I've created Firebird user in security database. The user name
>contains '.' character for example: kevin.smith
>
>When I try to grant privileges to that user I've got error:
>SQL> grant select on table to kevin.smith;
>Statement failed, SQLCODE = -104
>Dynamic SQL Error
>-SQL error code = -104
>-Token unknown - line 1, column 33
>-.

The engine therefore correctly picks up that "." is an illegal character in an unquoted identifier.

However, gsec should have spanked you when you tried to add that user in the security database. It's possible therefore that the interface you used to add the kevin.smith user correctly intercepted the string and double-quoted it. A user name of "kevin.smith" (including the double quotes) would be legal. Of course, any subsequent references to and usages of "kevin.smith" would be case-sensitive and require the double-quotes.

If you were able to add kevin.smith through the command-line or via gsec then Houston We Might Have a Problem. Try it again, but "in the raw" and if you can reproduce it, then please report it in the Tracker.

>When I run query against user without '.' it works fine

1) Do you ever login as kevin.smith? If not, would you try, first without double quotes and then with them. The permissions don't need to exist for you to log in. You just won't have access to any user objects, but you will be able to query the system tables.

2) Show us the exact query, including what database you are querying, and explain what you mean by "works fine".

You might or might not be aware that the users in the security database and entries in the SQL permissions in your user database are not linked in any way. You can define permissions for any user name as long as the user name is a legal identifier. No validation is done as to whether the user being operated on by the GRANT/REVOKE statement actually exists on the server.

>Tested on:
>ISQL Version: LI-V2.0.3.12981 Firebird 2.0
>Server version:
>Firebird/linux Intel (access method), version "LI-V2.0.3.12981
>Firebird 2.0"
>on disk structure version 11.0

./heLen