2 @message |
assert
- Total unique BLOB_ID values: 1
+ UNEXPECTED: number of unique BLOB_ID values is different from 1:
+ BLOB_ID_MON_STATEMENTS 0:3
+ BLOB_ID_MON_COMPILED_S 0:1
LOG DETAILS:
2025-04-18 13:46:15.294
2025-04-18 13:46:15.308 act = <firebird.qa.plugin.Action object at [hex]>
2025-04-18 13:46:15.323 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2025-04-18 13:46:15.335
2025-04-18 13:46:15.344 @pytest.mark.version('>=5.0.3')
2025-04-18 13:46:15.359 def test_1(act: Action, capsys):
2025-04-18 13:46:15.370 test_sql = f"""
2025-04-18 13:46:15.378 set list on;
2025-04-18 13:46:15.387 set blob all;
2025-04-18 13:46:15.396 select
2025-04-18 13:46:15.403 s.mon$sql_text as blob_id_mon_statements
2025-04-18 13:46:15.413 ,c.mon$sql_text as blob_id_mon_compiled_s
2025-04-18 13:46:15.426 from mon$statements s
2025-04-18 13:46:15.442 join mon$compiled_statements c using(mon$compiled_statement_id)
2025-04-18 13:46:15.454 where mon$attachment_id = current_connection and s.mon$sql_text is not null
2025-04-18 13:46:15.464 ;
2025-04-18 13:46:15.471 """
2025-04-18 13:46:15.478
2025-04-18 13:46:15.486 act.isql(switches = ['-q'], input = test_sql, combine_output = True)
2025-04-18 13:46:15.498
2025-04-18 13:46:15.509 blob_id_pattern = re.compile('^blob_id_mon_', re.IGNORECASE);
2025-04-18 13:46:15.521
2025-04-18 13:46:15.535 blob_ids_map = {}
2025-04-18 13:46:15.544 if act.return_code == 0:
2025-04-18 13:46:15.557 # Print only interesting lines from ISQl output tail:
2025-04-18 13:46:15.573 for line in act.clean_stdout.splitlines():
2025-04-18 13:46:15.588 if (blob_id_pattern.search(line)):
2025-04-18 13:46:15.602 blob_ids_map[ line.split()[0] ] = line.split()[1]
2025-04-18 13:46:15.614 if len(set(blob_ids_map.values())) == 1:
2025-04-18 13:46:15.626 print(f'{msg_prefix} {len(set(blob_ids_map.values()))}')
2025-04-18 13:46:15.639 else:
2025-04-18 13:46:15.650 print('UNEXPECTED: number of unique BLOB_ID values is different from 1:')
2025-04-18 13:46:15.660 for k,v in blob_ids_map.items():
2025-04-18 13:46:15.674 print(k,v)
2025-04-18 13:46:15.683 else:
2025-04-18 13:46:15.693 # If retcode !=0 then we can print the whole output of failed gbak:
2025-04-18 13:46:15.706 print('ISQL failed, check output:')
2025-04-18 13:46:15.720 for line in act.clean_stdout.splitlines():
2025-04-18 13:46:15.730 print(line)
2025-04-18 13:46:15.737 act.reset()
2025-04-18 13:46:15.743
2025-04-18 13:46:15.749 expected_stdout = f"""
2025-04-18 13:46:15.756 {msg_prefix} 1
2025-04-18 13:46:15.763 """
2025-04-18 13:46:15.770
2025-04-18 13:46:15.784 act.expected_stdout = expected_stdout
2025-04-18 13:46:15.793 act.stdout = capsys.readouterr().out
2025-04-18 13:46:15.801 > assert act.clean_stdout == act.clean_expected_stdout
2025-04-18 13:46:15.808 E assert
2025-04-18 13:46:15.817 E - Total unique BLOB_ID values: 1
2025-04-18 13:46:15.825 E + UNEXPECTED: number of unique BLOB_ID values is different from 1:
2025-04-18 13:46:15.832 E + BLOB_ID_MON_STATEMENTS 0:3
2025-04-18 13:46:15.840 E + BLOB_ID_MON_COMPILED_S 0:1
2025-04-18 13:46:15.848
2025-04-18 13:46:15.856 tests/bugs/gh_8513_test.py:75: AssertionError
2025-04-18 13:46:15.864 ---------------------------- Captured stdout setup -----------------------------
2025-04-18 13:46:15.872 Creating db: localhost:/var/tmp/qa_2024/test_11694/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]>
capsys = <_pytest.capture.CaptureFixture pytest object at [hex]>
@pytest.mark.version('>=5.0.3')
def test_1(act: Action, capsys):
test_sql = f"""
set list on;
set blob all;
select
s.mon$sql_text as blob_id_mon_statements
,c.mon$sql_text as blob_id_mon_compiled_s
from mon$statements s
join mon$compiled_statements c using(mon$compiled_statement_id)
where mon$attachment_id = current_connection and s.mon$sql_text is not null
;
"""
act.isql(switches = ['-q'], input = test_sql, combine_output = True)
blob_id_pattern = re.compile('^blob_id_mon_', re.IGNORECASE);
blob_ids_map = {}
if act.return_code == 0:
# Print only interesting lines from ISQl output tail:
for line in act.clean_stdout.splitlines():
if (blob_id_pattern.search(line)):
blob_ids_map[ line.split()[0] ] = line.split()[1]
if len(set(blob_ids_map.values())) == 1:
print(f'{msg_prefix} {len(set(blob_ids_map.values()))}')
else:
print('UNEXPECTED: number of unique BLOB_ID values is different from 1:')
for k,v in blob_ids_map.items():
print(k,v)
else:
# If retcode !=0 then we can print the whole output of failed gbak:
print('ISQL failed, check output:')
for line in act.clean_stdout.splitlines():
print(line)
act.reset()
expected_stdout = f"""
{msg_prefix} 1
"""
act.expected_stdout = expected_stdout
act.stdout = capsys.readouterr().out
> assert act.clean_stdout == act.clean_expected_stdout
E assert
E - Total unique BLOB_ID values: 1
E + UNEXPECTED: number of unique BLOB_ID values is different from 1:
E + BLOB_ID_MON_STATEMENTS 0:3
E + BLOB_ID_MON_COMPILED_S 0:1
tests/bugs/gh_8513_test.py:75: AssertionError
|