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-03 12:53:31.322
2024-11-03 12:53:31.327 act = <firebird.qa.plugin.Action object at [hex]>
2024-11-03 12:53:31.332 tmp_fbk = PosixPath('/var/tmp/qa_2024/test_11488/gh_7269.tmp.fbk')
2024-11-03 12:53:31.337 tmp_fdb = PosixPath('/var/tmp/qa_2024/test_11488/gh_7269.tmp.fdb')
2024-11-03 12:53:31.341 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2024-11-03 12:53:31.346
2024-11-03 12:53:31.351 @pytest.mark.version('>=4.0.0')
2024-11-03 12:53:31.355 def test_1(act: Action, tmp_fbk: Path, tmp_fdb: Path, capsys):
2024-11-03 12:53:31.360 zipped_fbk_file = zipfile.Path(act.files_dir / 'gh_7269.zip', at = 'gh-7269-unrecoverable.fbk')
2024-11-03 12:53:31.365 tmp_fbk.write_bytes(zipped_fbk_file.read_bytes())
2024-11-03 12:53:31.369
2024-11-03 12:53:31.374 allowed_patterns = \
2024-11-03 12:53:31.378 (
2024-11-03 12:53:31.383 r'gbak:(\s+)?ERROR(:)?'
2024-11-03 12:53:31.387 ,r'gbak:(\s+)?finishing, closing, and going home'
2024-11-03 12:53:31.392 ,r'gbak:(\s+)?adjusting the ONLINE and FORCED WRITES flags'
2024-11-03 12:53:31.397 )
2024-11-03 12:53:31.401 allowed_patterns = [ re.compile(p, re.IGNORECASE) for p in allowed_patterns ]
2024-11-03 12:53:31.406
2024-11-03 12:53:31.411 act.gbak(switches = ['-rep', '-v', str(tmp_fbk), str(tmp_fdb)], combine_output = True, io_enc = locale.getpreferredencoding())
2024-11-03 12:53:31.416
2024-11-03 12:53:31.421 for line in act.stdout.splitlines():
2024-11-03 12:53:31.426 if act.match_any(line.strip(), allowed_patterns):
2024-11-03 12:53:31.431 print(line)
2024-11-03 12:53:31.436
2024-11-03 12:53:31.440 expected_stdout = """
2024-11-03 12:53:31.445 gbak: ERROR:violation of PRIMARY or UNIQUE KEY constraint "PK_A3" on table "A3"
2024-11-03 12:53:31.450 gbak: ERROR: Problematic key value is ("ID" = 9)
2024-11-03 12:53:31.455 gbak: ERROR:violation of PRIMARY or UNIQUE KEY constraint "PK_A1" on table "A1"
2024-11-03 12:53:31.461 gbak: ERROR: Problematic key value is ("ID" = 5)
2024-11-03 12:53:31.466 gbak: ERROR:Cannot create foreign key constraint FK_A1. Partner index does not exist or is inactive.
2024-11-03 12:53:31.471 gbak: ERROR:violation of FOREIGN KEY constraint "FK_A2" on table "B2"
2024-11-03 12:53:31.477 gbak: ERROR: Foreign key reference target does not exist
2024-11-03 12:53:31.482 gbak: ERROR: Problematic key value is ("A2_ID" = 5)
2024-11-03 12:53:31.488 gbak: ERROR:Cannot create foreign key constraint FK_A3. Partner index does not exist or is inactive.
2024-11-03 12:53:31.493 gbak:finishing, closing, and going home
2024-11-03 12:53:31.499 gbak:adjusting the ONLINE and FORCED WRITES flags
2024-11-03 12:53:31.505 gbak: ERROR:Database is not online due to failure to activate one or more indices.
2024-11-03 12:53:31.511 gbak: ERROR: Run gfix -online to bring database online without active indices.
2024-11-03 12:53:31.517 """
2024-11-03 12:53:31.523
2024-11-03 12:53:31.530 act.expected_stdout = expected_stdout
2024-11-03 12:53:31.536 act.stdout = capsys.readouterr().out
2024-11-03 12:53:31.542 > assert act.clean_stdout == act.clean_expected_stdout
2024-11-03 12:53:31.553 E assert
2024-11-03 12:53:31.561 E gbak: ERROR:violation of PRIMARY or UNIQUE KEY constraint "PK_A3" on table "A3"
2024-11-03 12:53:31.568 E gbak: ERROR: Problematic key value is ("ID" = 9)
2024-11-03 12:53:31.573 E + gbak: ERROR:action cancelled by trigger (2) to preserve data integrity
2024-11-03 12:53:31.578 E + gbak: ERROR: Cannot deactivate index used by an integrity constraint
2024-11-03 12:53:31.584 E - gbak: ERROR:violation of PRIMARY or UNIQUE KEY constraint "PK_A1" on table "A1"
2024-11-03 12:53:31.589 E - gbak: ERROR: Problematic key value is ("ID" = 5)
2024-11-03 12:53:31.594 E - gbak: ERROR:Cannot create foreign key constraint FK_A1. Partner index does not exist or is inactive.
2024-11-03 12:53:31.600 E - gbak: ERROR:violation of FOREIGN KEY constraint "FK_A2" on table "B2"
2024-11-03 12:53:31.605 E - gbak: ERROR: Foreign key reference target does not exist
2024-11-03 12:53:31.610 E - gbak: ERROR: Problematic key value is ("A2_ID" = 5)
2024-11-03 12:53:31.615 E - gbak: ERROR:Cannot create foreign key constraint FK_A3. Partner index does not exist or is inactive.
2024-11-03 12:53:31.621 E - gbak:finishing, closing, and going home
2024-11-03 12:53:31.626 E - gbak:adjusting the ONLINE and FORCED WRITES flags
2024-11-03 12:53:31.632 E - gbak: ERROR:Database is not online due to failure to activate one or more indices.
2024-11-03 12:53:31.638 E - gbak: ERROR: Run gfix -online to bring database online without active indices.
2024-11-03 12:53:31.645
2024-11-03 12:53:31.651 tests/bugs/gh_7269_test.py:68: AssertionError
2024-11-03 12:53:31.656 ---------------------------- Captured stdout setup -----------------------------
2024-11-03 12:53:31.662 Creating db: localhost:/var/tmp/qa_2024/test_11488/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_11488/gh_7269.tmp.fbk')
tmp_fdb = PosixPath('/var/tmp/qa_2024/test_11488/gh_7269.tmp.fdb')
capsys = <_pytest.capture.CaptureFixture pytest object at [hex]>
@pytest.mark.version('>=4.0.0')
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
|