6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-22 13:33:07 +01:00

Added/Updated tests\bugs\gh_7675_test.py: Removed output of concrete data for checked query. It is enough only to display content of SQLDA (lines with 'sqltype:' and 'name:') and SQLSTATE (if some error occurs).

This commit is contained in:
pavel-zotov 2024-11-17 13:29:48 +03:00
parent aabe3479b7
commit 57e95fd7f9

View File

@ -10,7 +10,13 @@ DESCRIPTION:
NOTES:
[02.10.2023] pzotov
Checked on 6.0.0.65.
[17.11.2024] pzotov
Removed output of concrete data for checked query.
It is enough only to display content of SQLDA (lines with 'sqltype:' and 'name:') and SQLSTATE (if some error occurs).
Checked on 6.0.0.532.
"""
import os
import pytest
from firebird.qa import *
@ -35,119 +41,51 @@ init_sql = """
db = db_factory(init = init_sql)
test_script = """
set list on;
select *
from rdb$sql.explain(
q'{
select m2.id, count(*)
from tmain m2
join tdetl d using(id)
where m2.x > 0
group by 1
}'
) p
order by p.plan_line;
set sqlda_display on;
select p.*
from rdb$sql.explain('select 1 from rdb$database') as p
rows 0
;
"""
act = isql_act('db', test_script)
act = isql_act('db', test_script, substitutions=[('^((?!SQLSTATE|sqltype:|name:).)*$',''),('[ \t]+',' ')])
expected_stdout = """
PLAN_LINE 1
RECORD_SOURCE_ID 7
PARENT_RECORD_SOURCE_ID <null>
LEVEL 0
OBJECT_TYPE <null>
PACKAGE_NAME <null>
OBJECT_NAME <null>
ALIAS <null>
CARDINALITY <null>
RECORD_LENGTH <null>
KEY_LENGTH <null>
ACCESS_PATH 0:4
Select Expression
PLAN_LINE 2
RECORD_SOURCE_ID 6
PARENT_RECORD_SOURCE_ID 7
LEVEL 1
OBJECT_TYPE <null>
PACKAGE_NAME <null>
OBJECT_NAME <null>
ALIAS <null>
CARDINALITY 0.1000000000000000
RECORD_LENGTH <null>
KEY_LENGTH <null>
ACCESS_PATH 0:5
-> Aggregate
PLAN_LINE 3
RECORD_SOURCE_ID 5
PARENT_RECORD_SOURCE_ID 6
LEVEL 2
OBJECT_TYPE <null>
PACKAGE_NAME <null>
OBJECT_NAME <null>
ALIAS <null>
CARDINALITY 100.0000000000000
RECORD_LENGTH <null>
KEY_LENGTH <null>
ACCESS_PATH 0:6
-> Nested Loop Join (inner)
PLAN_LINE 4
RECORD_SOURCE_ID 2
PARENT_RECORD_SOURCE_ID 5
LEVEL 3
OBJECT_TYPE <null>
PACKAGE_NAME <null>
OBJECT_NAME <null>
ALIAS <null>
CARDINALITY 100.0000000000000
RECORD_LENGTH <null>
KEY_LENGTH <null>
ACCESS_PATH 0:7
-> Filter
PLAN_LINE 5
RECORD_SOURCE_ID 1
PARENT_RECORD_SOURCE_ID 2
LEVEL 4
OBJECT_TYPE 0
PACKAGE_NAME <null>
OBJECT_NAME TMAIN
ALIAS M2
CARDINALITY 100.0000000000000
RECORD_LENGTH <null>
KEY_LENGTH <null>
ACCESS_PATH 0:8
-> Table "TMAIN" as "M2" Access By ID
-> Index "TMAIN_PK" Full Scan
-> Bitmap
-> Index "TMAIN_X" Range Scan (lower bound: 1/1)
PLAN_LINE 6
RECORD_SOURCE_ID 4
PARENT_RECORD_SOURCE_ID 5
LEVEL 3
OBJECT_TYPE <null>
PACKAGE_NAME <null>
OBJECT_NAME <null>
ALIAS <null>
CARDINALITY 1.000000000000000
RECORD_LENGTH <null>
KEY_LENGTH <null>
ACCESS_PATH 0:9
-> Filter
PLAN_LINE 7
RECORD_SOURCE_ID 3
PARENT_RECORD_SOURCE_ID 4
LEVEL 4
OBJECT_TYPE 0
PACKAGE_NAME <null>
OBJECT_NAME TDETL
ALIAS D
CARDINALITY 0.9999999999999999
RECORD_LENGTH <null>
KEY_LENGTH <null>
ACCESS_PATH 0:a
-> Table "TDETL" as "D" Access By ID
-> Bitmap
-> Index "TDETL_PK" Unique Scan
01: sqltype: 496 LONG scale: 0 subtype: 0 len: 4
: name: PLAN_LINE alias: PLAN_LINE
02: sqltype: 580 INT64 scale: 0 subtype: 0 len: 8
: name: RECORD_SOURCE_ID alias: RECORD_SOURCE_ID
03: sqltype: 580 INT64 Nullable scale: 0 subtype: 0 len: 8
: name: PARENT_RECORD_SOURCE_ID alias: PARENT_RECORD_SOURCE_ID
04: sqltype: 496 LONG scale: 0 subtype: 0 len: 4
: name: LEVEL alias: LEVEL
05: sqltype: 500 SHORT Nullable scale: 0 subtype: 0 len: 2
: name: OBJECT_TYPE alias: OBJECT_TYPE
06: sqltype: 452 TEXT Nullable scale: 0 subtype: 0 len: 252 charset: 4 UTF8
: name: PACKAGE_NAME alias: PACKAGE_NAME
07: sqltype: 452 TEXT Nullable scale: 0 subtype: 0 len: 252 charset: 4 UTF8
: name: OBJECT_NAME alias: OBJECT_NAME
08: sqltype: 452 TEXT Nullable scale: 0 subtype: 0 len: 252 charset: 4 UTF8
: name: ALIAS alias: ALIAS
09: sqltype: 480 DOUBLE Nullable scale: 0 subtype: 0 len: 8
: name: CARDINALITY alias: CARDINALITY
10: sqltype: 496 LONG Nullable scale: 0 subtype: 0 len: 4
: name: RECORD_LENGTH alias: RECORD_LENGTH
11: sqltype: 496 LONG Nullable scale: 0 subtype: 0 len: 4
: name: KEY_LENGTH alias: KEY_LENGTH
12: sqltype: 520 BLOB scale: 0 subtype: 1 len: 8 charset: 4 UTF8
: name: ACCESS_PATH alias: ACCESS_PATH
"""
@pytest.mark.version('>=6.0')