2 @message |
assert
gbak: ERROR:violation of PRIMARY or UNIQUE KEY constraint "PK_A3" on table "A3"
gbak: ERROR: Problematic key value is ("ID" = 9)
+ gbak: ERROR:action cancelled by trigger (2) to preserve data integrity
+ gbak: ERROR: Cannot deactivate index used by an integrity constraint
- gbak: ERROR:violation of PRIMARY or UNIQUE KEY constraint "PK_A1" on table "A1"
- gbak: ERROR: Problematic key value is ("ID" = 5)
- gbak: ERROR:Cannot create foreign key constraint FK_A1. Partner index does not exist or is inactive.
- gbak: ERROR:violation of FOREIGN KEY constraint "FK_A2" on table "B2"
- gbak: ERROR: Foreign key reference target does not exist
- gbak: ERROR: Problematic key value is ("A2_ID" = 5)
- gbak: ERROR:Cannot create foreign key constraint FK_A3. Partner index does not exist or is inactive.
- gbak:finishing, closing, and going home
- gbak:adjusting the ONLINE and FORCED WRITES flags
- gbak: ERROR:Database is not online due to failure to activate one or more indices.
- gbak: ERROR: Run gfix -online to bring database online without active indices.
LOG DETAILS:
2024-11-18 11:11:22.533
2024-11-18 11:11:22.538 act = <firebird.qa.plugin.Action object at [hex]>
2024-11-18 11:11:22.543 tmp_fbk = PosixPath('/var/tmp/qa_2024/test_11524/gh_7269.tmp.fbk')
2024-11-18 11:11:22.548 tmp_fdb = PosixPath('/var/tmp/qa_2024/test_11524/gh_7269.tmp.fdb')
2024-11-18 11:11:22.553 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2024-11-18 11:11:22.559
2024-11-18 11:11:22.564 @pytest.mark.version('>=5.0.2')
2024-11-18 11:11:22.569 def test_1(act: Action, tmp_fbk: Path, tmp_fdb: Path, capsys):
2024-11-18 11:11:22.574 zipped_fbk_file = zipfile.Path(act.files_dir / 'gh_7269.zip', at = 'gh-7269-unrecoverable.fbk')
2024-11-18 11:11:22.579 tmp_fbk.write_bytes(zipped_fbk_file.read_bytes())
2024-11-18 11:11:22.585
2024-11-18 11:11:22.590 allowed_patterns = \
2024-11-18 11:11:22.596 (
2024-11-18 11:11:22.601 r'gbak:(\s+)?ERROR(:)?'
2024-11-18 11:11:22.607 ,r'gbak:(\s+)?finishing, closing, and going home'
2024-11-18 11:11:22.616 ,r'gbak:(\s+)?adjusting the ONLINE and FORCED WRITES flags'
2024-11-18 11:11:22.621 )
2024-11-18 11:11:22.627 allowed_patterns = [ re.compile(p, re.IGNORECASE) for p in allowed_patterns ]
2024-11-18 11:11:22.633
2024-11-18 11:11:22.639 act.gbak(switches = ['-rep', '-v', str(tmp_fbk), str(tmp_fdb)], combine_output = True, io_enc = locale.getpreferredencoding())
2024-11-18 11:11:22.644
2024-11-18 11:11:22.650 for line in act.stdout.splitlines():
2024-11-18 11:11:22.655 if act.match_any(line.strip(), allowed_patterns):
2024-11-18 11:11:22.661 print(line)
2024-11-18 11:11:22.668
2024-11-18 11:11:22.674 expected_stdout = """
2024-11-18 11:11:22.681 gbak: ERROR:violation of PRIMARY or UNIQUE KEY constraint "PK_A3" on table "A3"
2024-11-18 11:11:22.687 gbak: ERROR: Problematic key value is ("ID" = 9)
2024-11-18 11:11:22.693 gbak: ERROR:violation of PRIMARY or UNIQUE KEY constraint "PK_A1" on table "A1"
2024-11-18 11:11:22.699 gbak: ERROR: Problematic key value is ("ID" = 5)
2024-11-18 11:11:22.704 gbak: ERROR:Cannot create foreign key constraint FK_A1. Partner index does not exist or is inactive.
2024-11-18 11:11:22.710 gbak: ERROR:violation of FOREIGN KEY constraint "FK_A2" on table "B2"
2024-11-18 11:11:22.715 gbak: ERROR: Foreign key reference target does not exist
2024-11-18 11:11:22.721 gbak: ERROR: Problematic key value is ("A2_ID" = 5)
2024-11-18 11:11:22.726 gbak: ERROR:Cannot create foreign key constraint FK_A3. Partner index does not exist or is inactive.
2024-11-18 11:11:22.732 gbak:finishing, closing, and going home
2024-11-18 11:11:22.737 gbak:adjusting the ONLINE and FORCED WRITES flags
2024-11-18 11:11:22.742 gbak: ERROR:Database is not online due to failure to activate one or more indices.
2024-11-18 11:11:22.748 gbak: ERROR: Run gfix -online to bring database online without active indices.
2024-11-18 11:11:22.753 """
2024-11-18 11:11:22.758
2024-11-18 11:11:22.764 act.expected_stdout = expected_stdout
2024-11-18 11:11:22.769 act.stdout = capsys.readouterr().out
2024-11-18 11:11:22.778 > assert act.clean_stdout == act.clean_expected_stdout
2024-11-18 11:11:22.788 E assert
2024-11-18 11:11:22.794 E gbak: ERROR:violation of PRIMARY or UNIQUE KEY constraint "PK_A3" on table "A3"
2024-11-18 11:11:22.799 E gbak: ERROR: Problematic key value is ("ID" = 9)
2024-11-18 11:11:22.804 E + gbak: ERROR:action cancelled by trigger (2) to preserve data integrity
2024-11-18 11:11:22.809 E + gbak: ERROR: Cannot deactivate index used by an integrity constraint
2024-11-18 11:11:22.814 E - gbak: ERROR:violation of PRIMARY or UNIQUE KEY constraint "PK_A1" on table "A1"
2024-11-18 11:11:22.820 E - gbak: ERROR: Problematic key value is ("ID" = 5)
2024-11-18 11:11:22.826 E - gbak: ERROR:Cannot create foreign key constraint FK_A1. Partner index does not exist or is inactive.
2024-11-18 11:11:22.831 E - gbak: ERROR:violation of FOREIGN KEY constraint "FK_A2" on table "B2"
2024-11-18 11:11:22.836 E - gbak: ERROR: Foreign key reference target does not exist
2024-11-18 11:11:22.843 E - gbak: ERROR: Problematic key value is ("A2_ID" = 5)
2024-11-18 11:11:22.849 E - gbak: ERROR:Cannot create foreign key constraint FK_A3. Partner index does not exist or is inactive.
2024-11-18 11:11:22.854 E - gbak:finishing, closing, and going home
2024-11-18 11:11:22.859 E - gbak:adjusting the ONLINE and FORCED WRITES flags
2024-11-18 11:11:22.864 E - gbak: ERROR:Database is not online due to failure to activate one or more indices.
2024-11-18 11:11:22.869 E - gbak: ERROR: Run gfix -online to bring database online without active indices.
2024-11-18 11:11:22.875
2024-11-18 11:11:22.879 tests/bugs/gh_7269_test.py:68: AssertionError
2024-11-18 11:11:22.885 ---------------------------- Captured stdout setup -----------------------------
2024-11-18 11:11:22.891 Creating db: localhost:/var/tmp/qa_2024/test_11524/test.fdb [page_size=None, sql_dialect=None, charset='NONE', user=SYSDBA, password=masterkey]
|
3 #text |
act = <firebird.qa.plugin.Action pytest object at [hex]>
tmp_fbk = PosixPath('/var/tmp/qa_2024/test_11524/gh_7269.tmp.fbk')
tmp_fdb = PosixPath('/var/tmp/qa_2024/test_11524/gh_7269.tmp.fdb')
capsys = <_pytest.capture.CaptureFixture pytest object at [hex]>
@pytest.mark.version('>=5.0.2')
def test_1(act: Action, tmp_fbk: Path, tmp_fdb: Path, capsys):
zipped_fbk_file = zipfile.Path(act.files_dir / 'gh_7269.zip', at = 'gh-7269-unrecoverable.fbk')
tmp_fbk.write_bytes(zipped_fbk_file.read_bytes())
allowed_patterns = \
(
r'gbak:(\s+)?ERROR(:)?'
,r'gbak:(\s+)?finishing, closing, and going home'
,r'gbak:(\s+)?adjusting the ONLINE and FORCED WRITES flags'
)
allowed_patterns = [ re.compile(p, re.IGNORECASE) for p in allowed_patterns ]
act.gbak(switches = ['-rep', '-v', str(tmp_fbk), str(tmp_fdb)], combine_output = True, io_enc = locale.getpreferredencoding())
for line in act.stdout.splitlines():
if act.match_any(line.strip(), allowed_patterns):
print(line)
expected_stdout = """
gbak: ERROR:violation of PRIMARY or UNIQUE KEY constraint "PK_A3" on table "A3"
gbak: ERROR: Problematic key value is ("ID" = 9)
gbak: ERROR:violation of PRIMARY or UNIQUE KEY constraint "PK_A1" on table "A1"
gbak: ERROR: Problematic key value is ("ID" = 5)
gbak: ERROR:Cannot create foreign key constraint FK_A1. Partner index does not exist or is inactive.
gbak: ERROR:violation of FOREIGN KEY constraint "FK_A2" on table "B2"
gbak: ERROR: Foreign key reference target does not exist
gbak: ERROR: Problematic key value is ("A2_ID" = 5)
gbak: ERROR:Cannot create foreign key constraint FK_A3. Partner index does not exist or is inactive.
gbak:finishing, closing, and going home
gbak:adjusting the ONLINE and FORCED WRITES flags
gbak: ERROR:Database is not online due to failure to activate one or more indices.
gbak: ERROR: Run gfix -online to bring database online without active indices.
"""
act.expected_stdout = expected_stdout
act.stdout = capsys.readouterr().out
> assert act.clean_stdout == act.clean_expected_stdout
E assert
E gbak: ERROR:violation of PRIMARY or UNIQUE KEY constraint "PK_A3" on table "A3"
E gbak: ERROR: Problematic key value is ("ID" = 9)
E + gbak: ERROR:action cancelled by trigger (2) to preserve data integrity
E + gbak: ERROR: Cannot deactivate index used by an integrity constraint
E - gbak: ERROR:violation of PRIMARY or UNIQUE KEY constraint "PK_A1" on table "A1"
E - gbak: ERROR: Problematic key value is ("ID" = 5)
E - gbak: ERROR:Cannot create foreign key constraint FK_A1. Partner index does not exist or is inactive.
E - gbak: ERROR:violation of FOREIGN KEY constraint "FK_A2" on table "B2"
E - gbak: ERROR: Foreign key reference target does not exist
E - gbak: ERROR: Problematic key value is ("A2_ID" = 5)
E - gbak: ERROR:Cannot create foreign key constraint FK_A3. Partner index does not exist or is inactive.
E - gbak:finishing, closing, and going home
E - gbak:adjusting the ONLINE and FORCED WRITES flags
E - gbak: ERROR:Database is not online due to failure to activate one or more indices.
E - gbak: ERROR: Run gfix -online to bring database online without active indices.
tests/bugs/gh_7269_test.py:68: AssertionError
|