Steps to reproduce:
- check current console code page
firebird>chcp
Active code page: 866
- connect with charset corresponding to the console code page
firebird>isql employee -ch dos866
Database: employee, User: SYSDBA
- create mapping using non-ASCII group name
SQL> create mapping m1 using any plugin from group группа to role role1;
Statement failed, SQLSTATE = 42000
Dynamic SQL Error
-SQL error code = -104
-Token unknown - line 1, column 47
-г
this is expected as literal группа is not quoted
- check with single and double quotes, local and global mappings
SQL> create mapping m1 using any plugin from group 'группа' to role role1;
SQL> create mapping m2 using any plugin from group "группа" to role role1;
SQL> create global mapping m3 using any plugin from group 'группа' to role role1;
SQL> create global mapping m4 using any plugin from group "группа" to role role1;
no errors, as expected
- check created mappings
SQL> show mapping;
M1 USING ANY PLUGIN FROM GROUP группа TO ROLE ROLE1
M2 USING ANY PLUGIN FROM GROUP ╨│╤А╤Г╨┐╨┐╨░ TO ROLE ROLE1
*** Global mapping ***
M3 USING ANY PLUGIN FROM GROUP ???????????? TO ROLE ROLE1
M4 USING ANY PLUGIN FROM GROUP ?????????????????????????????????? TO ROLE ROLE1
I see two issues here:
- when using double quotes, literal is not encoded correctly by parser before put into database
- when creating global mapping, strings is not not encoded correctly when passed into security.db connection
Also, it is not clear why double quotes is allowed at all. I don't think that name of the mapped object (for ex. OS user or group name) should follow rules of SQL-identifier.
Steps to reproduce:
this is expected as literal группа is not quoted
no errors, as expected
I see two issues here:
Also, it is not clear why double quotes is allowed at all. I don't think that name of the mapped object (for ex. OS user or group name) should follow rules of SQL-identifier.