Issue Details (XML | Word | Printable)

Key: CORE-4301
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Adriano dos Santos Fernandes
Reporter: Simonov Denis
Votes: 0
Watchers: 2

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

Non-ASCII data in SEC$USERS is not read correctly

Created: 19/Dec/13 03:39 PM   Updated: 23/Sep/15 12:45 PM
Component/s: None
Affects Version/s: 3.0 Alpha 1, 3.0 Alpha 2
Fix Version/s: 3.0 Beta 1

Environment: windows 7 x86, isql
Issue Links:

QA Status: Done with caveats
Test Details:
For test content of COMMENTS field firebird.conf should contain: UserManager = Srp.
Currently it is not so on test-running host, so it was decided to check only content of FIRST_NAME field which is available on any value of `UserManager` parameter.
Test Specifics: Custom configuration required

 Description  « Hide
User comment distorts non-ASCII characters

c:\Program Files\Firebird\Firebird_3_0>chcp 1251
Текущая кодовая страница: 1251

c:\Program Files\Firebird\Firebird_3_0>isql
Use CONNECT or CREATE DATABASE to specify a database
SQL> set names win1251;
SQL> connect 'localhost/3051:test' user 'sysdba' password 'masterkey';
Database: 'localhost/3051:test', User: sysdba
SQL> create table T1(id integer);
SQL> commit;
SQL> comment on table T1 is 'Моя таблица';
SQL> commit;
SQL> select r.rdb$description as descr
CON> from rdb$relations r
CON> where r.rdb$relation_name = 'T1';

Моя таблица

SQL> create user user1 password '123';
SQL> commit;
SQL> comment on user user1 is 'Новый пользователь';
SQL> commit;
SQL> select u.sec$description as descr
CON> from sec$users u
CON> where u.sec$user_name = 'USER1';

?????????? ????????????????????????

SQL> alter user user1 set tags(tag1='привет');
SQL> commit;
SQL> select * from sec$user_attributes;


=============================== =============================== ========================================================
USER1 TAG1 ????????????

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Simonov Denis added a comment - 19/Dec/13 03:41 PM
Database create as

CREATE DATABASE 'localhost/3051:TEST'

Sean Leyne added a comment - 19/Dec/13 04:23 PM
I don't agree that should have a "Major" priority.

Simonov Denis added a comment - 27/Jan/14 08:42 AM
I agree.

Adriano dos Santos Fernandes added a comment - 29/Jan/14 03:29 PM
They are saved correctly. They are not read correctly.

Pavel Zotov added a comment - 26/Mar/15 07:13 PM
How can it be explained that if:

1) create new database:

$ /opt/fb30ss/bin/isql -q
SQL> set names utf8;
SQL> create database '' default character set utf8;
SQL> show version;
ISQL Version: LI-T3.0.0.31740 Firebird 3.0 Beta 2
Server version:
Firebird/Linux/AMD/Intel/x64 (access method), version "LI-T3.0.0.31740 Firebird 3.0 Beta 2"
Firebird/Linux/AMD/Intel/x64 (remote server), version "LI-T3.0.0.31740 Firebird 3.0 Beta 2/tcp (oel64)/P13"
Firebird/Linux/AMD/Intel/x64 (remote interface), version "LI-T3.0.0.31740 Firebird 3.0 Beta 2/tcp (oel64)/P13"
on disk structure version 12.0

2) and run script with only ASCII characters:

drop user tmp$c4301a;
drop user tmp$c4301b;
create user tmp$c4301a password '123';
create user tmp$c4301b password '123';
comment on user tmp$c4301a is 'This is user tmp$c4301a';
comment on user tmp$c4301b is 'This is user tmp$c4301b';
set blob all;
set list on;
select u.SEC$USER_NAME, u.sec$description as descr
from sec$users u
where upper(u.sec$user_name) starting with upper('tmp$c4301');

-- then result is NULLs in the sec$description:

DESCR <null>

DESCR <null>

-- ?

$ cat firebird.conf
AuthClient = Legacy_Auth,Srp,Win_Sspi
AuthServer = Legacy_Auth,Srp

DefaultDbCachePages = 8K

ExternalFileAccess = Restrict /var/db/fb30
FileSystemCacheThreshold = 65536K

LockMemSize = 64M
LockHashSlots = 22111

MaxUserTraceLogSize = 99999
RemoteServicePort = 3333
TempCacheLimit = 2147483647
TempDirectories = /dev/shm;/tmp
UserManager = Legacy_UserManager
WireCrypt = Disabled

Pavel Zotov added a comment - 26/Mar/15 07:51 PM
Sorry for my previous stupid post, the reason was obvious: usage of UserManager = Legacy_UserManager in config.

If run this test on standard firebird.conf than all OK:

$ /opt/fb30ss/bin/isql -q
SQL> set names utf8;
SQL> create database 'localhost/3333:/var/db/fb30/c4301.fdb' default character set utf8;
SQL> create user u30a password 'u30a'; commit;
SQL> create user u30b password 'u30b'; commit;
SQL> comment on user u30a is 'это кто-то из наших'; commit;
SQL> comment on user u30b is 'é alguém do Brasil'; commit;
SQL> select u.SEC$USER_NAME, u.sec$description as descr
CON> from sec$users u
CON> where upper(u.sec$user_name) starting with upper('u30');

=============================== =================
U30A 0:5
это кто-то из наших
U30B 0:8
é alguém do Brasil

Pavel Cisar added a comment - 23/Sep/15 12:45 PM
Test created.