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_5630_test.py: splitted expected output for 6.x since some columns in rdb$files now have NULLS instead of zeroes - see notes.

This commit is contained in:
pavel-zotov 2024-12-30 12:02:31 +03:00
parent 4af274b8e8
commit eb019319e5

View File

@ -4,10 +4,15 @@
ID: issue-5896 ID: issue-5896
ISSUE: 5896 ISSUE: 5896
TITLE: Can't create the shadow file TITLE: Can't create the shadow file
DESCRIPTION: DESCRIPTION: Shadow file can not be created during restore when '-use_all_space' option is used
Shadow file is can not be created during restore when -use_all_space option is used
JIRA: CORE-5630 JIRA: CORE-5630
FBTEST: bugs.core_5630 NOTES:
[30.12.2024] pzotov
Splitted expected out for FB 6.x because columns rdb$file_sequence, rdb$file_start and rdb$file_length
have NULLs instead of zeroes, see:
https://github.com/FirebirdSQL/firebird/commit/f0740d2a3282ed92a87b8e0547139ba8efe61173
("Wipe out multi-file database support (#8047)")
Checked on 6.0.0.565
""" """
import locale import locale
@ -17,24 +22,24 @@ from firebird.qa import *
db = db_factory() db = db_factory()
act = python_act('db', substitutions=[('Commit current transaction \\(y/n\\)\\?', '')]) act = python_act('db', substitutions=[('[ \t]+', ' ')])
expected_stdout_a = """ expected_stdout_5x = """
RDB$FILE_SEQUENCE 0 RDB$FILE_SEQUENCE 0
RDB$FILE_START 0 RDB$FILE_START 0
RDB$FILE_LENGTH 0 RDB$FILE_LENGTH 0
RDB$FILE_FLAGS 1 RDB$FILE_FLAGS 1
RDB$SHADOW_NUMBER 1 RDB$SHADOW_NUMBER 1
S_HASH_BEFORE 1499836372373901520 S_HASH 1499836372373901520
""" """
expected_stdout_b = """ expected_stdout_6x = """
RDB$FILE_SEQUENCE 0 RDB$FILE_SEQUENCE <null>
RDB$FILE_START 0 RDB$FILE_START <null>
RDB$FILE_LENGTH 0 RDB$FILE_LENGTH <null>
RDB$FILE_FLAGS 1 RDB$FILE_FLAGS 1
RDB$SHADOW_NUMBER 1 RDB$SHADOW_NUMBER 1
S_HASH_AFTER 1499836372373901520 S_HASH 1499836372373901520
""" """
fdb_file = temp_file('core_5630.fdb') fdb_file = temp_file('core_5630.fdb')
@ -70,11 +75,11 @@ def test_1(act: Action, fdb_file: Path, fbk_file: Path, shd_file: Path):
commit; commit;
set list on; set list on;
select * from v_shadow_info; select * from v_shadow_info;
select hash( list(s) ) as s_hash_before from test; select hash( list(s) ) as s_hash from test;
quit; quit;
""" """
act.expected_stdout = expected_stdout_a act.expected_stdout = expected_stdout_5x if act.is_version('<6') else expected_stdout_6x
act.isql(switches=['-q'], input = init_ddl, connect_db=False, combine_output = True, io_enc = locale.getpreferredencoding()) act.isql(switches=['-q'], input = init_ddl, connect_db=False, combine_output = True, io_enc = locale.getpreferredencoding())
assert act.clean_stdout == act.clean_expected_stdout assert act.clean_stdout == act.clean_expected_stdout
# #
@ -94,12 +99,12 @@ def test_1(act: Action, fdb_file: Path, fbk_file: Path, shd_file: Path):
sql_text = """ sql_text = """
set list on; set list on;
select * from v_shadow_info; select * from v_shadow_info;
select hash( list(s) ) as s_hash_after from test; select hash( list(s) ) as s_hash from test;
""" """
act.reset() act.reset()
#----------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------
act.expected_stdout = expected_stdout_b act.expected_stdout = expected_stdout_5x if act.is_version('<6') else expected_stdout_6x
act.isql(switches=['-q', act.get_dsn(fdb_file)], input=sql_text, connect_db=False, combine_output = True, io_enc = locale.getpreferredencoding()) act.isql(switches=['-q', act.get_dsn(fdb_file)], input=sql_text, connect_db=False, combine_output = True, io_enc = locale.getpreferredencoding())
assert act.clean_stdout == act.clean_expected_stdout assert act.clean_stdout == act.clean_expected_stdout