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:5
+ BLOB_ID_MON_COMPILED_S 0:1
LOG DETAILS:
2025-04-18 10:06:12.433
2025-04-18 10:06:12.433 act = <firebird.qa.plugin.Action object at [hex]>
2025-04-18 10:06:12.433 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2025-04-18 10:06:12.433
2025-04-18 10:06:12.433 @pytest.mark.version('>=5.0.3')
2025-04-18 10:06:12.433 def test_1(act: Action, capsys):
2025-04-18 10:06:12.433 test_sql = f"""
2025-04-18 10:06:12.433 set list on;
2025-04-18 10:06:12.433 set blob all;
2025-04-18 10:06:12.433 select
2025-04-18 10:06:12.433 s.mon$sql_text as blob_id_mon_statements
2025-04-18 10:06:12.433 ,c.mon$sql_text as blob_id_mon_compiled_s
2025-04-18 10:06:12.433 from mon$statements s
2025-04-18 10:06:12.433 join mon$compiled_statements c using(mon$compiled_statement_id)
2025-04-18 10:06:12.433 where mon$attachment_id = current_connection and s.mon$sql_text is not null
2025-04-18 10:06:12.434 ;
2025-04-18 10:06:12.434 """
2025-04-18 10:06:12.434
2025-04-18 10:06:12.434 act.isql(switches = ['-q'], input = test_sql, combine_output = True)
2025-04-18 10:06:12.434
2025-04-18 10:06:12.434 blob_id_pattern = re.compile('^blob_id_mon_', re.IGNORECASE);
2025-04-18 10:06:12.434
2025-04-18 10:06:12.434 blob_ids_map = {}
2025-04-18 10:06:12.434 if act.return_code == 0:
2025-04-18 10:06:12.434 # Print only interesting lines from ISQl output tail:
2025-04-18 10:06:12.434 for line in act.clean_stdout.splitlines():
2025-04-18 10:06:12.434 if (blob_id_pattern.search(line)):
2025-04-18 10:06:12.434 blob_ids_map[ line.split()[0] ] = line.split()[1]
2025-04-18 10:06:12.434 if len(set(blob_ids_map.values())) == 1:
2025-04-18 10:06:12.434 print(f'{msg_prefix} {len(set(blob_ids_map.values()))}')
2025-04-18 10:06:12.434 else:
2025-04-18 10:06:12.434 print('UNEXPECTED: number of unique BLOB_ID values is different from 1:')
2025-04-18 10:06:12.434 for k,v in blob_ids_map.items():
2025-04-18 10:06:12.434 print(k,v)
2025-04-18 10:06:12.434 else:
2025-04-18 10:06:12.434 # If retcode !=0 then we can print the whole output of failed gbak:
2025-04-18 10:06:12.435 print('ISQL failed, check output:')
2025-04-18 10:06:12.435 for line in act.clean_stdout.splitlines():
2025-04-18 10:06:12.435 print(line)
2025-04-18 10:06:12.435 act.reset()
2025-04-18 10:06:12.435
2025-04-18 10:06:12.435 expected_stdout = f"""
2025-04-18 10:06:12.435 {msg_prefix} 1
2025-04-18 10:06:12.435 """
2025-04-18 10:06:12.435
2025-04-18 10:06:12.435 act.expected_stdout = expected_stdout
2025-04-18 10:06:12.435 act.stdout = capsys.readouterr().out
2025-04-18 10:06:12.435 > assert act.clean_stdout == act.clean_expected_stdout
2025-04-18 10:06:12.435 E assert
2025-04-18 10:06:12.435 E - Total unique BLOB_ID values: 1
2025-04-18 10:06:12.435 E + UNEXPECTED: number of unique BLOB_ID values is different from 1:
2025-04-18 10:06:12.435 E + BLOB_ID_MON_STATEMENTS 0:5
2025-04-18 10:06:12.435 E + BLOB_ID_MON_COMPILED_S 0:1
2025-04-18 10:06:12.435
2025-04-18 10:06:12.435 tests\bugs\gh_8513_test.py:75: AssertionError
2025-04-18 10:06:12.435 ---------------------------- Captured stdout setup ----------------------------
2025-04-18 10:06:12.435 Creating db: localhost:H:\QA\temp\qa2024.tmp\fbqa\test_11716\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:5
E + BLOB_ID_MON_COMPILED_S 0:1
tests\bugs\gh_8513_test.py:75: AssertionError
|