1 @message |
assert
Select Expression
....-> Singularity Check
........-> Aggregate
............-> Nested Loop Join (inner)
................-> Filter
- ....................-> Table "RDB$DEPENDENCIES" as "DEP" Access By ID
- ........................-> Bitmap
- ............................-> Index "RDB$INDEX_nn" Range Scan (full match)
- ................-> Filter
....................-> Table "RDB$PROCEDURES" as "PRC" Access By ID
........................-> Bitmap
+ ............................-> Index "RDB$INDEX_nn" Range Scan (partial match: 1/2)
+ ................-> Filter
+ ....................-> Table "RDB$DEPENDENCIES" as "DEP" Access By ID
+ ........................-> Bitmap And
+ ............................-> Bitmap
- ............................-> Index "RDB$INDEX_nn" Unique Scan
+ ................................-> Index "RDB$INDEX_nn" Range Scan (full match)
+ ............................-> Bitmap
+ ................................-> Index "RDB$INDEX_nn" Range Scan (full match)
Select Expression
....-> Filter
........-> Table "RDB$RELATION_FIELDS" as "X" Access By ID
............-> Bitmap
................-> Index "RDB$INDEX_nn" Range Scan (full match)
LOG DETAILS:
2024-08-09 15:25:07.314
2024-08-09 15:25:07.314 act = <firebird.qa.plugin.Action object at [hex]>
2024-08-09 15:25:07.314 tmp_fbk = WindowsPath('H:/QA/temp/qa2024.tmp/fbqa/test_11341/gh_8161.tmp.fbk')
2024-08-09 15:25:07.314 capsys = <_pytest.capture.CaptureFixture object at [hex]>
2024-08-09 15:25:07.314
2024-08-09 15:25:07.314 @pytest.mark.version('>=3.0.12')
2024-08-09 15:25:07.314 def test_1(act: Action, tmp_fbk: Path, capsys):
2024-08-09 15:25:07.314 zipped_fbk_file = zipfile.Path(act.files_dir / 'gh_8161.zip', at = 'gh_8161.fbk')
2024-08-09 15:25:07.315 tmp_fbk.write_bytes(zipped_fbk_file.read_bytes())
2024-08-09 15:25:07.315
2024-08-09 15:25:07.315 act.gbak(switches = ['-rep', str(tmp_fbk), act.db.db_path], combine_output = True, io_enc = locale.getpreferredencoding())
2024-08-09 15:25:07.315 print(act.stdout) # must be empty
2024-08-09 15:25:07.315
2024-08-09 15:25:07.315 test_sql = """
2024-08-09 15:25:07.315 execute block as
2024-08-09 15:25:07.315 declare relname varchar(32);
2024-08-09 15:25:07.315 declare cnt int;
2024-08-09 15:25:07.315 begin
2024-08-09 15:25:07.315 for select X.RDB$RELATION_NAME
2024-08-09 15:25:07.315 from RDB$RELATION_FIELDS X
2024-08-09 15:25:07.315 where X.RDB$FIELD_SOURCE = 'BOOL_EMUL'
2024-08-09 15:25:07.315 into :relname
2024-08-09 15:25:07.315 do begin
2024-08-09 15:25:07.315 select count(*)
2024-08-09 15:25:07.315 from RDB$DEPENDENCIES DEP, RDB$PROCEDURES PRC
2024-08-09 15:25:07.315 where DEP.RDB$DEPENDED_ON_NAME = :relname
2024-08-09 15:25:07.315 AND DEP.RDB$FIELD_NAME = :relname
2024-08-09 15:25:07.315 AND DEP.RDB$DEPENDED_ON_TYPE = 0 /* obj_relation */
2024-08-09 15:25:07.316 AND DEP.RDB$DEPENDENT_TYPE = 5 /* obj_procedure */
2024-08-09 15:25:07.316 AND DEP.RDB$DEPENDENT_NAME = PRC.RDB$PROCEDURE_NAME
2024-08-09 15:25:07.316 AND PRC.RDB$PACKAGE_NAME IS NULL
2024-08-09 15:25:07.316 into :cnt;
2024-08-09 15:25:07.316 end
2024-08-09 15:25:07.316 end
2024-08-09 15:25:07.316 """
2024-08-09 15:25:07.316
2024-08-09 15:25:07.316 with act.db.connect() as con:
2024-08-09 15:25:07.316 cur = con.cursor()
2024-08-09 15:25:07.316 ps = cur.prepare(test_sql)
2024-08-09 15:25:07.316 print( '\n'.join([replace_leading(s) for s in ps.detailed_plan.split('\n')]) )
2024-08-09 15:25:07.316
2024-08-09 15:25:07.316 expected_stdout = """
2024-08-09 15:25:07.316 Select Expression
2024-08-09 15:25:07.316 ....-> Singularity Check
2024-08-09 15:25:07.316 ........-> Aggregate
2024-08-09 15:25:07.316 ............-> Nested Loop Join (inner)
2024-08-09 15:25:07.317 ................-> Filter
2024-08-09 15:25:07.317 ....................-> Table "RDB$DEPENDENCIES" as "DEP" Access By ID
2024-08-09 15:25:07.317 ........................-> Bitmap
2024-08-09 15:25:07.317 ............................-> Index "RDB$INDEX_28" Range Scan (full match)
2024-08-09 15:25:07.317 ................-> Filter
2024-08-09 15:25:07.317 ....................-> Table "RDB$PROCEDURES" as "PRC" Access By ID
2024-08-09 15:25:07.317 ........................-> Bitmap
2024-08-09 15:25:07.317 ............................-> Index "RDB$INDEX_21" Unique Scan
2024-08-09 15:25:07.317 Select Expression
2024-08-09 15:25:07.317 ....-> Filter
2024-08-09 15:25:07.317 ........-> Table "RDB$RELATION_FIELDS" as "X" Access By ID
2024-08-09 15:25:07.317 ............-> Bitmap
2024-08-09 15:25:07.317 ................-> Index "RDB$INDEX_3" Range Scan (full match)
2024-08-09 15:25:07.317 """
2024-08-09 15:25:07.317 act.expected_stdout = expected_stdout
2024-08-09 15:25:07.317 act.stdout = capsys.readouterr().out
2024-08-09 15:25:07.317 > assert act.clean_stdout == act.clean_expected_stdout
2024-08-09 15:25:07.317 E assert
2024-08-09 15:25:07.317 E Select Expression
2024-08-09 15:25:07.317 E ....-> Singularity Check
2024-08-09 15:25:07.318 E ........-> Aggregate
2024-08-09 15:25:07.318 E ............-> Nested Loop Join (inner)
2024-08-09 15:25:07.318 E ................-> Filter
2024-08-09 15:25:07.318 E - ....................-> Table "RDB$DEPENDENCIES" as "DEP" Access By ID
2024-08-09 15:25:07.318 E - ........................-> Bitmap
2024-08-09 15:25:07.318 E - ............................-> Index "RDB$INDEX_nn" Range Scan (full match)
2024-08-09 15:25:07.318 E - ................-> Filter
2024-08-09 15:25:07.318 E ....................-> Table "RDB$PROCEDURES" as "PRC" Access By ID
2024-08-09 15:25:07.318 E ........................-> Bitmap
2024-08-09 15:25:07.318 E + ............................-> Index "RDB$INDEX_nn" Range Scan (partial match: 1/2)
2024-08-09 15:25:07.318 E + ................-> Filter
2024-08-09 15:25:07.318 E + ....................-> Table "RDB$DEPENDENCIES" as "DEP" Access By ID
2024-08-09 15:25:07.318 E + ........................-> Bitmap And
2024-08-09 15:25:07.318 E + ............................-> Bitmap
2024-08-09 15:25:07.318 E - ............................-> Index "RDB$INDEX_nn" Unique Scan
2024-08-09 15:25:07.318 E + ................................-> Index "RDB$INDEX_nn" Range Scan (full match)
2024-08-09 15:25:07.318 E + ............................-> Bitmap
2024-08-09 15:25:07.318 E + ................................-> Index "RDB$INDEX_nn" Range Scan (full match)
2024-08-09 15:25:07.319 E Select Expression
2024-08-09 15:25:07.319 E ....-> Filter
2024-08-09 15:25:07.319 E ........-> Table "RDB$RELATION_FIELDS" as "X" Access By ID
2024-08-09 15:25:07.319 E ............-> Bitmap
2024-08-09 15:25:07.319 E ................-> Index "RDB$INDEX_nn" Range Scan (full match)
2024-08-09 15:25:07.319
2024-08-09 15:25:07.319 tests\bugs\gh_8161_test.py:103: AssertionError
2024-08-09 15:25:07.319 ---------------------------- Captured stdout setup ----------------------------
2024-08-09 15:25:07.319 Creating db: localhost:H:\QA\temp\qa2024.tmp\fbqa\test_11341\test.fdb [page_size=None, sql_dialect=None, charset='NONE', user=SYSDBA, password=masterkey]
|
2 #text |
act = <firebird.qa.plugin.Action pytest object at [hex]>
tmp_fbk = WindowsPath('H:/QA/temp/qa2024.tmp/fbqa/test_11341/gh_8161.tmp.fbk')
capsys = <_pytest.capture.CaptureFixture pytest object at [hex]>
@pytest.mark.version('>=3.0.12')
def test_1(act: Action, tmp_fbk: Path, capsys):
zipped_fbk_file = zipfile.Path(act.files_dir / 'gh_8161.zip', at = 'gh_8161.fbk')
tmp_fbk.write_bytes(zipped_fbk_file.read_bytes())
act.gbak(switches = ['-rep', str(tmp_fbk), act.db.db_path], combine_output = True, io_enc = locale.getpreferredencoding())
print(act.stdout) # must be empty
test_sql = """
execute block as
declare relname varchar(32);
declare cnt int;
begin
for select X.RDB$RELATION_NAME
from RDB$RELATION_FIELDS X
where X.RDB$FIELD_SOURCE = 'BOOL_EMUL'
into :relname
do begin
select count(*)
from RDB$DEPENDENCIES DEP, RDB$PROCEDURES PRC
where DEP.RDB$DEPENDED_ON_NAME = :relname
AND DEP.RDB$FIELD_NAME = :relname
AND DEP.RDB$DEPENDED_ON_TYPE = 0 /* obj_relation */
AND DEP.RDB$DEPENDENT_TYPE = 5 /* obj_procedure */
AND DEP.RDB$DEPENDENT_NAME = PRC.RDB$PROCEDURE_NAME
AND PRC.RDB$PACKAGE_NAME IS NULL
into :cnt;
end
end
"""
with act.db.connect() as con:
cur = con.cursor()
ps = cur.prepare(test_sql)
print( '\n'.join([replace_leading(s) for s in ps.detailed_plan.split('\n')]) )
expected_stdout = """
Select Expression
....-> Singularity Check
........-> Aggregate
............-> Nested Loop Join (inner)
................-> Filter
....................-> Table "RDB$DEPENDENCIES" as "DEP" Access By ID
........................-> Bitmap
............................-> Index "RDB$INDEX_28" Range Scan (full match)
................-> Filter
....................-> Table "RDB$PROCEDURES" as "PRC" Access By ID
........................-> Bitmap
............................-> Index "RDB$INDEX_21" Unique Scan
Select Expression
....-> Filter
........-> Table "RDB$RELATION_FIELDS" as "X" Access By ID
............-> Bitmap
................-> Index "RDB$INDEX_3" Range Scan (full match)
"""
act.expected_stdout = expected_stdout
act.stdout = capsys.readouterr().out
> assert act.clean_stdout == act.clean_expected_stdout
E assert
E Select Expression
E ....-> Singularity Check
E ........-> Aggregate
E ............-> Nested Loop Join (inner)
E ................-> Filter
E - ....................-> Table "RDB$DEPENDENCIES" as "DEP" Access By ID
E - ........................-> Bitmap
E - ............................-> Index "RDB$INDEX_nn" Range Scan (full match)
E - ................-> Filter
E ....................-> Table "RDB$PROCEDURES" as "PRC" Access By ID
E ........................-> Bitmap
E + ............................-> Index "RDB$INDEX_nn" Range Scan (partial match: 1/2)
E + ................-> Filter
E + ....................-> Table "RDB$DEPENDENCIES" as "DEP" Access By ID
E + ........................-> Bitmap And
E + ............................-> Bitmap
E - ............................-> Index "RDB$INDEX_nn" Unique Scan
E + ................................-> Index "RDB$INDEX_nn" Range Scan (full match)
E + ............................-> Bitmap
E + ................................-> Index "RDB$INDEX_nn" Range Scan (full match)
E Select Expression
E ....-> Filter
E ........-> Table "RDB$RELATION_FIELDS" as "X" Access By ID
E ............-> Bitmap
E ................-> Index "RDB$INDEX_nn" Range Scan (full match)
tests\bugs\gh_8161_test.py:103: AssertionError
|