Issue Details (XML | Word | Printable)

Key: CORE-3511
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Adriano dos Santos Fernandes
Reporter: Adriano dos Santos Fernandes
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Unquoted role names with non-ASCII characters passed in DPB are upper-cased wrongly

Created: 03/Jun/11 01:48 PM   Updated: Tuesday 05:02 PM
Component/s: Charsets/Collation, Engine
Affects Version/s: 2.5.0
Fix Version/s: 2.5.1, 3.0 Alpha 1

QA Status: Deferred
Test Details:
Waiting for reply on letter 14-mar-2016 21:06 (sent dimitr): it seems that test can be implemented only for run under POSIX.


 Description  « Hide
The problem is different in Windows and others OSes.

In Windows, the utf-8 encoded string is upper-cased as a Windows ANSI string hence mangling non-ASCII characters.

In others, only ASCII characters are upper-cased, leaving others as was.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Pavel Zotov added a comment - 24/May/16 05:02 PM
On Windows non-ascii role can not be passed within connection statement (i.e. connect ... role <some-non-ascii-text> )
Is it possible to solve ?

Sample:
#######

drop user tmp$c3511;
commit;
create user tmp$c3511 password '123';
commit;

set bail on;
set wng off;

create or alter view v_whoami as
select current_user as cur_user,mon$role as mon_role,current_role as cur_role
from mon$attachments
where mon$attachment_id=current_connection;

revoke all on all from tmp$c3511;
commit;
create role "Gros";
create role "Groß";
create role "Groſ";
create role "οµικρον";
create role "αβγδε";

grant "Gros" to tmp$c3511;
grant "Groß" to tmp$c3511;
grant "Groſ" to tmp$c3511;
grant "οµικρον" to tmp$c3511;
grant "αβγδε" to tmp$c3511;
commit;

grant select on v_whoami to tmp$c3511;
commit;

show roles;
show grants;

set list on;
set echo on;

connect '/:e30' user tmp$c3511 password '123' role "Gros"; select * from v_whoami;
commit;

connect '/:e30' user tmp$c3511 password '123' role "αβγδε"; select * from v_whoami;
commit;

connect '/:e30' user tmp$c3511 password '123' role "Groß"; select * from v_whoami;
commit;


Output (see also attached screen):
######

C:\MIX\firebird\QA\fbt-repo\tmp>chcp
Текущая кодовая страница: 65001 --------------- this is somewhat like 'utf8 codepage' in MS Win

C:\MIX\firebird\QA\fbt-repo\tmp>copy /y e30.fd0 *.fdb 1>nul 2>&1 & C:\MIX\firebird\fb30\isql /:e30 -i c3511-30.sql
       Gros Groß
       Groſ αβγδε
       οµικρον

/* Grant permissions for this database */
GRANT SELECT ON V_WHOAMI TO USER TMP$C3511
GRANT Gros TO TMP$C3511
GRANT Groß TO TMP$C3511
GRANT Groſ TO TMP$C3511
GRANT αβγδε TO TMP$C3511
GRANT οµικρον TO TMP$C3511

connect '/:e30' user tmp$c3511 password '123' role "Gros"; select * from v_whoami;

CUR_USER TMP$C3511
MON_ROLE Gros
CUR_ROLE Gros

commit;

connect '/:e30' user tmp$c3511 password '123' role "αβγδε"; select * from v_whoami;

CUR_USER TMP$C3511
MON_ROLE NONE
CUR_ROLE NONE

commit;

connect '/:e30' user tmp$c3511 password '123' role "Groß"; select * from v_whoami;

CUR_USER TMP$C3511
MON_ROLE NONE
CUR_ROLE NONE

commit;