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_4731_test.py: Separated code for FB-6x because it became differ after implemented GH-8202

This commit is contained in:
pavel-zotov 2024-08-08 10:40:41 +03:00
parent 986f83d3a7
commit 3db2709f83

View File

@ -44,7 +44,11 @@ NOTES:
[04.03.2023] pzotov
Separated code for FB-4x because it allows now statement 'delete from RDB$BACKUP_HISTORY ...'
Checked on 5.0.0.970, 4.0.3.2904, 3.0.11.33665.
[08.08.2024] pzotov
Separated code for FB-6x because it became differ after implemented GH-8202
https://github.com/FirebirdSQL/firebird/commit/0cc8de396a3c2bbe13b161ecbfffa8055e7b4929
(05-aug-2024 13:45, "Regenerate system triggers improving formatting and constant names")
Checked on 6.0.0.419-3505a5e
JIRA: CORE-4731
FBTEST: bugs.core_4731
"""
@ -129,6 +133,30 @@ fb4x_expected_out = """
-- gdscode list for blocked: 335544926
"""
fb6x_expected_out = """
-- Executed with role: NONE. Expressions that passes WITHOUT errors:
-- count_of_passed: 0
-- gdscode list for blocked: 335544926
-- Executed with role: RDB$ADMIN. Expressions that passes WITHOUT errors:
-- count_of_passed: 14
VULNERABLE_EXPR delete from RDB$BACKUP_HISTORY t rows 1 returning t.rdb$db_key; -- length of returned rdb$dbkey=8
VULNERABLE_EXPR insert into RDB$BACKUP_HISTORY(RDB$BACKUP_ID , RDB$TIMESTAMP , RDB$BACKUP_LEVEL , RDB$GUID , RDB$SCN , RDB$FILE_NAME) values(null, null, null, null, null, null) returning rdb$db_key; -- length of returned rdb$dbkey=8
VULNERABLE_EXPR delete from RDB$DB_CREATORS t rows 1 returning t.rdb$db_key; -- length of returned rdb$dbkey=8
VULNERABLE_EXPR insert into RDB$DB_CREATORS(RDB$USER , RDB$USER_TYPE) values(null, null) returning rdb$db_key; -- length of returned rdb$dbkey=8
VULNERABLE_EXPR update RDB$DB_CREATORS t set t.RDB$USER = 'C' rows 1 returning t.rdb$db_key; -- length of returned rdb$dbkey=8
VULNERABLE_EXPR update RDB$DB_CREATORS t set t.RDB$USER = null rows 1 returning t.rdb$db_key; -- length of returned rdb$dbkey=8
VULNERABLE_EXPR update RDB$DB_CREATORS t set t.RDB$USER_TYPE = 32767 rows 1 returning t.rdb$db_key; -- length of returned rdb$dbkey=8
VULNERABLE_EXPR update RDB$DB_CREATORS t set t.RDB$USER_TYPE = null rows 1 returning t.rdb$db_key; -- length of returned rdb$dbkey=8
VULNERABLE_EXPR update RDB$FUNCTIONS t set t.RDB$FUNCTION_SOURCE = null where coalesce(rdb$system_flag,0)=0 rows 1 returning t.rdb$db_key; -- length of returned rdb$dbkey=8
VULNERABLE_EXPR update RDB$PACKAGES t set t.RDB$PACKAGE_BODY_SOURCE = null where coalesce(rdb$system_flag,0)=0 rows 1 returning t.rdb$db_key; -- length of returned rdb$dbkey=8
VULNERABLE_EXPR update RDB$PACKAGES t set t.RDB$PACKAGE_HEADER_SOURCE = null where coalesce(rdb$system_flag,0)=0 rows 1 returning t.rdb$db_key; -- length of returned rdb$dbkey=8
VULNERABLE_EXPR update RDB$PROCEDURES t set t.RDB$PROCEDURE_SOURCE = null where coalesce(rdb$system_flag,0)=0 rows 1 returning t.rdb$db_key; -- length of returned rdb$dbkey=8
VULNERABLE_EXPR update RDB$RELATIONS t set t.RDB$VIEW_SOURCE = null where coalesce(rdb$system_flag,0)=0 rows 1 returning t.rdb$db_key; -- length of returned rdb$dbkey=8
VULNERABLE_EXPR update RDB$TRIGGERS t set t.RDB$TRIGGER_SOURCE = null where coalesce(rdb$system_flag,0)=0 rows 1 returning t.rdb$db_key; -- length of returned rdb$dbkey=8
-- gdscode list for blocked: 335544926
"""
@pytest.mark.version('>=3.0')
def test_1(act: Action, dba_privileged_user: User, non_privileged_user: User, capsys):
# Run prepare script
@ -225,6 +253,6 @@ def test_1(act: Action, dba_privileged_user: User, non_privileged_user: User, ca
commit;
"""
act.expected_stdout = fb3x_expected_out if act.is_version('<4') else fb4x_expected_out
act.expected_stdout = fb3x_expected_out if act.is_version('<4') else fb4x_expected_out if act.is_version('<6') else fb6x_expected_out
act.isql(switches=['-q'], input=test_script, combine_output = True)
assert act.clean_stdout == act.clean_expected_stdout