6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-22 13:33:07 +01:00

Added/Updated tests\bugs\core_4301_test.py: Added 'using plugin Srp' into 'CREATE USER' statements, in order to check 'COMMENT ON USER' with non-ascii text.

This commit is contained in:
pavel-zotov 2024-09-04 11:59:41 +03:00
parent fbb6793e76
commit e8ccc02275

View File

@ -7,6 +7,9 @@ TITLE: Non-ASCII data in SEC$USERS is not read correctly
DESCRIPTION:
JIRA: CORE-4301
FBTEST: bugs.core_4301
NOTES:
[04.09.2024] pzotov
Added 'using plugin Srp' into 'CREATE USER' statements, in order to check 'COMMENT ON USER' with non-ascii text.
"""
import pytest
@ -20,29 +23,43 @@ user_a = user_factory('db', name='u30a', password='u30a', do_not_create=True)
user_b = user_factory('db', name='u30b', password='u30b', do_not_create=True)
test_script = """
-- Note: this test differs from ticket: instead of add COMMENTS to users
-- it only defines their `firstname` attribute, because sec$users.sec$description
-- can be displayed only when plugin UserManager = Srp.
-- Field `firstname` is defined as:
-- VARCHAR(32) CHARACTER SET UNICODE_FSS COLLATE UNICODE_FSS
-- we can put in it max 16 non-ascii characters
create or alter user u30a password 'u30a' firstname 'Полиграф Шариков';
create or alter user u30b password 'u30b' firstname 'Léopold Frédéric';
create or alter user u30a password 'u30a' firstname 'Полиграф Шариков' using plugin Srp;
create or alter user u30b password 'u30b' firstname 'Léopold Frédéric' using plugin Srp;
commit;
comment on user u30a is 'это кто-то из наших';
comment on user u30b is 'é alguém do Brasil';
commit;
/*
show domain rdb$user;
show domain SEC$NAME_PART;
show table sec$users;
*/
set list on;
select u.sec$user_name, u.sec$first_name
select
-- 3.x: CHAR(31) CHARACTER SET UNICODE_FSS Nullable
-- 4.x, 5.x: (RDB$USER) CHAR(63) Nullable
-- FB 6.x: (RDB$USER) CHAR(63) CHARACTER SET UTF8 Nullable
u.sec$user_name
,u.sec$first_name -- (SEC$NAME_PART) VARCHAR(32) Nullable
,u.sec$description as descr_blob_id -- (RDB$DESCRIPTION) BLOB segment 80, subtype TEXT Nullable
from sec$users u
where upper(u.sec$user_name) in (upper('u30a'), upper('u30b'));
commit;
"""
act = isql_act('db', test_script)
act = isql_act('db', test_script, substitutions = [ ('DESCR_BLOB_ID.*',''),('[ \t]+',' ') ] )
expected_stdout = """
SEC$USER_NAME U30A
SEC$FIRST_NAME Полиграф Шариков
это кто-то из наших
SEC$USER_NAME U30B
SEC$FIRST_NAME Léopold Frédéric
é alguém do Brasil
"""
@pytest.mark.version('>=3.0')