mirror of
https://github.com/FirebirdSQL/firebird-qa.git
synced 2025-01-22 13:33:07 +01:00
New metadata + cleanup
This commit is contained in:
parent
decd3ba022
commit
91781e9231
47
files/gtcs-window-func.sql
Normal file
47
files/gtcs-window-func.sql
Normal file
@ -0,0 +1,47 @@
|
||||
recreate table persons (
|
||||
id integer generated by default as identity primary key,
|
||||
name varchar(15)
|
||||
);
|
||||
|
||||
recreate table entries (
|
||||
id integer generated by default as identity primary key,
|
||||
person integer references persons,
|
||||
dat date,
|
||||
val numeric(10,2)
|
||||
);
|
||||
|
||||
insert into persons (name) values ('Person 1');
|
||||
insert into persons (name) values ('Person 2');
|
||||
insert into persons (name) values ('Person 3');
|
||||
insert into persons (name) values ('Person 4');
|
||||
insert into persons (name) values ('Person 5');
|
||||
|
||||
insert into entries (person, dat, val) select id, date '2010-01-02' + id, id * 2 + 0.3 from persons;
|
||||
insert into entries (person, dat, val) select id, date '2010-02-01' + id, id * 3 + 0.4 from persons;
|
||||
insert into entries (person, dat, val) select id, date '2010-03-01' + id, id * 3 + 0.4 from persons;
|
||||
insert into entries (person, dat, val) values (1, null, null);
|
||||
commit;
|
||||
|
||||
-- select * from entries;
|
||||
|
||||
recreate view v1 (x1, x2, x3, x4, x5, x6, x7, x8) as
|
||||
select
|
||||
count(*) over (partition by p.id), count(e.val) over (partition by p.id),
|
||||
min(e.val) over (partition by p.id), max(e.val) over (partition by p.id),
|
||||
count(distinct e.val) over (partition by p.id), min(distinct e.val) over (partition by p.id),
|
||||
max(distinct e.val) over (partition by p.id),
|
||||
p.name
|
||||
from entries e
|
||||
join persons p
|
||||
on p.id = e.person;
|
||||
|
||||
recreate view v2 as
|
||||
select *
|
||||
from entries;
|
||||
|
||||
recreate view v3 as
|
||||
select v2.person, v2.val, p.name
|
||||
from v2
|
||||
join persons p
|
||||
on p.id = v2.person;
|
||||
commit;
|
@ -2,8 +2,10 @@
|
||||
|
||||
"""
|
||||
ID: dummy
|
||||
ISSUE:
|
||||
TITLE: Dummy test
|
||||
DESCRIPTION:
|
||||
JIRA:
|
||||
FBTEST: bugs.core_0000
|
||||
"""
|
||||
|
||||
|
@ -6,6 +6,11 @@ ISSUE: 5137
|
||||
TITLE: Make message about missing password being always displayed as reply on attempt
|
||||
to issue CREATE new login without PASSWORD clause
|
||||
DESCRIPTION:
|
||||
NOTES:
|
||||
[04.02.2022] pcisar
|
||||
Test fails with 3.0.8, because command
|
||||
create or alter user u01 tags (password = 'foo');
|
||||
does not produce any error.
|
||||
JIRA: CORE-4841
|
||||
FBTEST: bugs.core_4841
|
||||
"""
|
||||
@ -29,8 +34,6 @@ test_script = """
|
||||
|
||||
act = isql_act('db', test_script, substitutions=[('[-]?Password', 'Password')])
|
||||
|
||||
# version: 3.0.8
|
||||
|
||||
expected_stderr = """
|
||||
Statement failed, SQLSTATE = 42000
|
||||
unsuccessful metadata update
|
||||
@ -66,6 +69,7 @@ unsuccessful metadata update
|
||||
-Password must be specified when creating user
|
||||
"""
|
||||
|
||||
@pytest.mark.skip("FIXME: see notes")
|
||||
@pytest.mark.version('>=3.0.8')
|
||||
def test_1(act: Action):
|
||||
act.expected_stderr = expected_stderr
|
||||
|
@ -5,6 +5,11 @@ ID: issue-5508
|
||||
ISSUE: 5508
|
||||
TITLE: Allow to enforce IPv4 or IPv6 in URL-like connection strings
|
||||
DESCRIPTION:
|
||||
NOTES:
|
||||
[04.02.2022] pcisar
|
||||
Test may fail with IPv6.
|
||||
For example it fails on my Linux OpenSuSE Tumbleweed with regular setup (IPv6 should not be disabled).
|
||||
Test should IMHO check IPv4/IPv6 availability on test host before runs inet6:// check.
|
||||
JIRA: CORE-5229
|
||||
FBTEST: bugs.core_5229
|
||||
"""
|
||||
@ -24,6 +29,7 @@ expected_stdout = """
|
||||
PROTOCOL_WHEN_CONNECT_BY_ES_EDS TCPv6
|
||||
"""
|
||||
|
||||
@pytest.mark.skip("FIXME: see notes")
|
||||
@pytest.mark.version('>=3.0.1')
|
||||
def test_1(act: Action):
|
||||
sql_chk = f"""
|
||||
|
@ -4,6 +4,7 @@
|
||||
ID: derived-table-01
|
||||
TITLE: Simple derived table
|
||||
DESCRIPTION:
|
||||
FBTEST: functional.arno.derived_tables.01
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -4,6 +4,7 @@
|
||||
ID: derived-table-02
|
||||
TITLE: Unnamed (no relation alias) derived table
|
||||
DESCRIPTION:
|
||||
FBTEST: functional.arno.derived_tables.02
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -4,6 +4,7 @@
|
||||
ID: derived-table-03
|
||||
TITLE: Explicit column names for derived table
|
||||
DESCRIPTION:
|
||||
FBTEST: functional.arno.derived_tables.03
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -4,6 +4,7 @@
|
||||
ID: derived-table-04
|
||||
TITLE: Derived table column names must be unique
|
||||
DESCRIPTION:
|
||||
FBTEST: functional.arno.derived_tables.04
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -4,6 +4,7 @@
|
||||
ID: derived-table-05
|
||||
TITLE: Derived table column names must be unique
|
||||
DESCRIPTION:
|
||||
FBTEST: functional.arno.derived_tables.05
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -4,6 +4,7 @@
|
||||
ID: derived-table-06
|
||||
TITLE: Outer reference inside derived table to other relations in from clause is not allowed
|
||||
DESCRIPTION:
|
||||
FBTEST: functional.arno.derived_tables.06
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -4,6 +4,7 @@
|
||||
ID: derived-table-07
|
||||
TITLE: Outer reference inside derived table to other relations in from clause is not allowed
|
||||
DESCRIPTION:
|
||||
FBTEST: functional.arno.derived_tables.07
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -4,6 +4,7 @@
|
||||
ID: derived-table-08
|
||||
TITLE: Outer reference inside derived table to other relations in from clause is not allowed
|
||||
DESCRIPTION:
|
||||
FBTEST: functional.arno.derived_tables.08
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -4,6 +4,7 @@
|
||||
ID: derived-table-09
|
||||
TITLE: Outer reference inside derived table to other relations in from clause is not allowed
|
||||
DESCRIPTION:
|
||||
FBTEST: functional.arno.derived_tables.09
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -4,6 +4,7 @@
|
||||
ID: derived-table-10
|
||||
TITLE: Outer reference to upper scope-level is allowed
|
||||
DESCRIPTION: Such as fields inside derived table part of sub-query.
|
||||
FBTEST: functional.arno.derived_tables.10
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -4,6 +4,7 @@
|
||||
ID: derived-table-11
|
||||
TITLE: Outer reference to upper scope-level is allowed
|
||||
DESCRIPTION: Such as fields inside derived table part of sub-query (IN-predicate).
|
||||
FBTEST: functional.arno.derived_tables.11
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -4,6 +4,7 @@
|
||||
ID: derived-table-12
|
||||
TITLE: Outer reference to upper scope-level is allowed
|
||||
DESCRIPTION: Such as fields inside derived table part of sub-query (EXISTS).
|
||||
FBTEST: functional.arno.derived_tables.12
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -4,6 +4,7 @@
|
||||
ID: derived-table-13
|
||||
TITLE: DISTINCT inside derived table
|
||||
DESCRIPTION:
|
||||
FBTEST: functional.arno.derived_tables.13
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -4,6 +4,7 @@
|
||||
ID: derived-table-14
|
||||
TITLE: FIRST / SKIP inside derived table
|
||||
DESCRIPTION:
|
||||
FBTEST: functional.arno.derived_tables.14
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -4,6 +4,7 @@
|
||||
ID: derived-table-15
|
||||
TITLE: UNION inside derived table
|
||||
DESCRIPTION:
|
||||
FBTEST: functional.arno.derived_tables.15
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -4,6 +4,7 @@
|
||||
ID: derived-table-16
|
||||
TITLE: Simple derived table with aggregate inside
|
||||
DESCRIPTION:
|
||||
FBTEST: functional.arno.derived_tables.16
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -4,6 +4,7 @@
|
||||
ID: derived-table-17
|
||||
TITLE: Aggregate inside derived table
|
||||
DESCRIPTION:
|
||||
FBTEST: functional.arno.derived_tables.17
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -4,6 +4,7 @@
|
||||
ID: derived-table-18
|
||||
TITLE: Aggregate inside derived table
|
||||
DESCRIPTION:
|
||||
FBTEST: functional.arno.derived_tables.18
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -4,6 +4,7 @@
|
||||
ID: derived-table-19
|
||||
TITLE: Sub-select inside derived table
|
||||
DESCRIPTION:
|
||||
FBTEST: functional.arno.derived_tables.19
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -4,6 +4,7 @@
|
||||
ID: derived-table-20
|
||||
TITLE: Sub-select inside derived table
|
||||
DESCRIPTION:
|
||||
FBTEST: functional.arno.derived_tables.20
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -6,6 +6,7 @@ TITLE: Implicit derived table by IN predicate
|
||||
DESCRIPTION:
|
||||
IN predicate uses derived table internally and should ignore column-name checks
|
||||
(Aggregate functions are unnamed by default).
|
||||
FBTEST: functional.arno.derived_tables.21
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -4,6 +4,7 @@
|
||||
ID: derived-table-22
|
||||
TITLE: Derived table outer reference (triggers)
|
||||
DESCRIPTION: NEW/OLD context variables should be available inside the derived table.
|
||||
FBTEST: functional.arno.derived_tables.22
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -7,6 +7,7 @@ DESCRIPTION:
|
||||
Check if all 5 values are fetched with "equals" operator over first segment and
|
||||
"greater than or equal" operator on second segment. 2 values are bound to the upper
|
||||
segments and 1 value is bound to the lower segment.
|
||||
FBTEST: functional.arno.indices.lower_bound_asc_02_segments_01
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -7,6 +7,7 @@ DESCRIPTION:
|
||||
Check if all 5 values are fetched with "equals" operator over first segment and
|
||||
"lower than or equal" operator on second segment. 2 values are bound to the lower
|
||||
segments and 1 value is bound to the upper segment.
|
||||
FBTEST: functional.arno.indices.lower_bound_desc_02_segments_01
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -4,6 +4,7 @@
|
||||
ID: index.starting-with-01
|
||||
TITLE: STARTING WITH charset NONE
|
||||
DESCRIPTION: STARTING WITH - Select from table with 2 entries
|
||||
FBTEST: functional.arno.indices.starting_with_01
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -4,6 +4,7 @@
|
||||
ID: index.starting-with-02
|
||||
TITLE: STARTING WITH charset ISO8859_1
|
||||
DESCRIPTION: STARTING WITH - Select from table with 2 entries
|
||||
FBTEST: functional.arno.indices.starting_with_02
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -6,6 +6,7 @@ TITLE: TIMESTAMP in index with values below julian date
|
||||
DESCRIPTION:
|
||||
Datetime values below the julian date (firebird base date '1858-11-17') should be stored
|
||||
in correct order.
|
||||
FBTEST: functional.arno.indices.timestamps_01
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -1,17 +1,10 @@
|
||||
#coding:utf-8
|
||||
#
|
||||
# id: functional.arno.indices.upper_bound_asc_01_segments_01
|
||||
# title: ASC single index upper bound
|
||||
# decription: Check if all 15 values are fetched with "lower than or equal" operator.
|
||||
# tracker_id:
|
||||
# min_versions: []
|
||||
# versions: 1.5
|
||||
# qmid: functional.arno.indexes.upper_bound_asc_01_segments_01
|
||||
|
||||
"""
|
||||
ID: index.upper-bound-asc-1-segment-01
|
||||
TITLE: ASC single segment index upper bound
|
||||
DESCRIPTION: Check if all 15 values are fetched with "lower than or equal" operator.
|
||||
FBTEST: functional.arno.indices.upper_bound_asc_01_segments_01
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -4,6 +4,7 @@
|
||||
ID: index.upper-bound-asc-1-segment-02
|
||||
TITLE: ASC single segment index upper bound
|
||||
DESCRIPTION: Check if all 32 values are fetched with "lower than" operator.
|
||||
FBTEST: functional.arno.indices.upper_bound_asc_01_segments_02
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -4,6 +4,7 @@
|
||||
ID: index.upper-bound-asc-1-segment-03
|
||||
TITLE: ASC single segment index upper bound
|
||||
DESCRIPTION: Check if all 5 values are fetched with "lower than or equal" operator.
|
||||
FBTEST: functional.arno.indices.upper_bound_asc_01_segments_03
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -4,6 +4,7 @@
|
||||
ID: index.upper-bound-asc-1-segment-04
|
||||
TITLE: ASC single segment index upper bound
|
||||
DESCRIPTION: Check if all 5 values are fetched with "lower than or equal" operator.
|
||||
FBTEST: functional.arno.indices.upper_bound_asc_01_segments_04
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -7,6 +7,7 @@ DESCRIPTION:
|
||||
Check if all 5 values are fetched with "equals" operator over first segment and
|
||||
"lower than or equal" operator on second segment. 2 values are bound to the upper
|
||||
segments and 1 value is bound to the lower segments.
|
||||
FBTEST: functional.arno.indices.upper_bound_asc_02_segments_01
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -4,6 +4,7 @@
|
||||
ID: index.upper-bound-desc-1-segment-01
|
||||
TITLE: DESC single segment index upper bound
|
||||
DESCRIPTION: Check if all 15 values are fetched with "greater than or equal" operator.
|
||||
FBTEST: functional.arno.indices.upper_bound_desc_01_segments_01
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -4,6 +4,7 @@
|
||||
ID: index.upper-bound-desc-1-segment-02
|
||||
TITLE: DESC single segment index upper bound
|
||||
DESCRIPTION: Check if all 15 values are fetched with "greater than" operator.
|
||||
FBTEST: functional.arno.indices.upper_bound_desc_01_segments_02
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -7,6 +7,7 @@ DESCRIPTION:
|
||||
Check if all 5 values are fetched with "equals" operator over first segment and
|
||||
"greater than or equal" operator on second segment. 2 values are bound to the upper
|
||||
segments and 1 value is bound to the lower segment.
|
||||
FBTEST: functional.arno.indices.upper_bound_desc_02_segments_01
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -5,6 +5,7 @@ ID: index.upper-lower-bounds-01
|
||||
TITLE: Upper and lower bounds
|
||||
DESCRIPTION: Equal comparison should be prefered.
|
||||
Lower and Upper bounds are bound by the same value.
|
||||
FBTEST: functional.arno.indices.upper_lower_bounds_01
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -1,12 +1,4 @@
|
||||
#coding:utf-8
|
||||
#
|
||||
# id: functional.arno.indices.upper_lower_bounds_02
|
||||
# title: upper and lower bounds
|
||||
# decription: "Less or equal than" should be prefered above "less than" and "greater or equal than" above "greater than".
|
||||
# tracker_id:
|
||||
# min_versions: []
|
||||
# versions: 3.0
|
||||
# qmid: functional.arno.indexes.upper_lower_bounds_02
|
||||
|
||||
"""
|
||||
ID: index.upper-lower-bounds-02
|
||||
@ -14,6 +6,7 @@ TITLE: Upper and lower bounds
|
||||
DESCRIPTION:
|
||||
"Less or equal than" should be prefered above "less than" and "greater or equal than"
|
||||
above "greater than".
|
||||
FBTEST: functional.arno.indices.upper_lower_bounds_02
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -1,12 +1,4 @@
|
||||
#coding:utf-8
|
||||
#
|
||||
# id: functional.arno.optimizer.opt_aggregate_distribution_01
|
||||
# title: Try to deliver HAVING CLAUSE conjunctions to the WHERE clause
|
||||
# decription: Comparisons which doesn't contain (anywhere hiding in the expression) aggregate-functions should be delivered to the where clause. The underlying aggregate stream could possible use it for a index and speed it up.
|
||||
# tracker_id:
|
||||
# min_versions: []
|
||||
# versions: 3.0
|
||||
# qmid: functional.arno.optimizer.opt_aggregate_distribution_01
|
||||
|
||||
"""
|
||||
ID: optimizer.aggregate-distribution-01
|
||||
@ -15,6 +7,7 @@ DESCRIPTION:
|
||||
Comparisons which doesn't contain (anywhere hiding in the expression) aggregate-functions
|
||||
should be delivered to the where clause. The underlying aggregate stream could possible
|
||||
use it for a index and speed it up.
|
||||
FBTEST: functional.arno.optimizer.opt_aggregate_distribution_01
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -7,6 +7,7 @@ DESCRIPTION:
|
||||
Comparisons which doesn't contain (anywhere hiding in the expression) aggregate-functions
|
||||
should be delivered to the where clause. The underlying aggregate stream could possible
|
||||
use it for a index and speed it up.
|
||||
FBTEST: functional.arno.optimizer.opt_aggregate_distribution_02
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -7,6 +7,7 @@ DESCRIPTION:
|
||||
Comparisons which doesn't contain (anywhere hiding in the expression) aggregate-functions
|
||||
should be delivered to the where clause. The underlying aggregate stream could possible
|
||||
use it for a index and speed it up.
|
||||
FBTEST: functional.arno.optimizer.opt_aggregate_distribution_03
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -7,6 +7,7 @@ DESCRIPTION:
|
||||
Comparisons which doesn't contain (anywhere hiding in the expression) aggregate-functions
|
||||
should be delivered to the where clause. The underlying aggregate stream could possible
|
||||
use it for a index and speed it up.
|
||||
FBTEST: functional.arno.optimizer.opt_aggregate_distribution_04
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -8,6 +8,7 @@ DESCRIPTION:
|
||||
should be delivered to the where clause. The underlying aggregate stream could possible
|
||||
use it for a index and speed it up. VIEWs that contain aggregate queries always (as expected)
|
||||
add WHERE clause (on that VIEW) inside the HAVING clause from the aggregate.
|
||||
FBTEST: functional.arno.optimizer.opt_aggregate_distribution_05
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -8,6 +8,7 @@ DESCRIPTION:
|
||||
should be delivered to the where clause. The underlying aggregate stream could possible
|
||||
use it for a index and speed it up. VIEWs that contain aggregate queries always (as expected)
|
||||
add WHERE clause (on that VIEW) inside the HAVING clause from the aggregate.
|
||||
FBTEST: functional.arno.optimizer.opt_aggregate_distribution_06
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -7,6 +7,7 @@ DESCRIPTION:
|
||||
Comparisons which doesn't contain (anywhere hiding in the expression) aggregate-functions
|
||||
should be delivered to the where clause. The underlying aggregate stream could possible
|
||||
use it for a index and speed it up.
|
||||
FBTEST: functional.arno.optimizer.opt_aggregate_distribution_07
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -7,6 +7,7 @@ DESCRIPTION:
|
||||
Comparisons which doesn't contain (anywhere hiding in the expression) aggregate-functions
|
||||
should be delivered to the where clause. The underlying aggregate stream could possible
|
||||
use it for a index and speed it up.
|
||||
FBTEST: functional.arno.optimizer.opt_aggregate_distribution_08
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -7,6 +7,7 @@ DESCRIPTION:
|
||||
Comparisons which doesn't contain (anywhere hiding in the expression) aggregate-functions
|
||||
should be delivered to the where clause. The underlying aggregate stream could possible
|
||||
use it for a index and speed it up.
|
||||
FBTEST: functional.arno.optimizer.opt_aggregate_distribution_09
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -7,6 +7,7 @@ DESCRIPTION:
|
||||
Comparisons which doesn't contain (anywhere hiding in the expression) aggregate-functions
|
||||
should be delivered to the where clause. The underlying aggregate stream could possible
|
||||
use it for a index and speed it up.
|
||||
FBTEST: functional.arno.optimizer.opt_aggregate_distribution_10
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -7,6 +7,7 @@ DESCRIPTION:
|
||||
Comparisons which doesn't contain (anywhere hiding in the expression) aggregate-functions
|
||||
should be delivered to the where clause. The underlying aggregate stream could possible
|
||||
use it for a index and speed it up.
|
||||
FBTEST: functional.arno.optimizer.opt_aggregate_distribution_11
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -7,6 +7,7 @@ DESCRIPTION:
|
||||
Comparisons which doesn't contain (anywhere hiding in the expression) aggregate-functions
|
||||
should be delivered to the where clause. The underlying aggregate stream could possible
|
||||
use it for a index and speed it up.
|
||||
FBTEST: functional.arno.optimizer.opt_aggregate_distribution_12
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -1,12 +1,4 @@
|
||||
#coding:utf-8
|
||||
#
|
||||
# id: functional.arno.optimizer.opt_aggregate_distribution_13
|
||||
# title: Try to deliver HAVING CLAUSE conjunctions to the WHERE clause
|
||||
# decription: Comparisons which doesn't contain (anywhere hiding in the expression) aggregate-functions should be delivered to the where clause. The underlying aggregate stream could possible use it for a index and speed it up.
|
||||
# tracker_id:
|
||||
# min_versions: []
|
||||
# versions: 3.0
|
||||
# qmid: functional.arno.optimizer.opt_aggregate_distribution_13
|
||||
|
||||
"""
|
||||
ID: optimizer.aggregate-distribution-13
|
||||
@ -15,6 +7,7 @@ DESCRIPTION:
|
||||
Comparisons which doesn't contain (anywhere hiding in the expression) aggregate-functions
|
||||
should be delivered to the where clause. The underlying aggregate stream could possible
|
||||
use it for a index and speed it up.
|
||||
FBTEST: functional.arno.optimizer.opt_aggregate_distribution_13
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -9,6 +9,7 @@ DESCRIPTION:
|
||||
should be delivered to the where clause. The underlying aggregate stream could possible
|
||||
use it for a index and speed it up.
|
||||
JIRA: CORE-2417
|
||||
FBTEST: functional.arno.optimizer.opt_aggregate_distribution_14
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -8,6 +8,7 @@ DESCRIPTION:
|
||||
Samples here are from #3431.
|
||||
Confirmed usage 'PLAN INDEX ...' in FB 2.0.0.12724
|
||||
JIRA: CORE-3051
|
||||
FBTEST: functional.arno.optimizer.opt_avoid_index_usage
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -7,6 +7,7 @@ DESCRIPTION:
|
||||
TableX FULL OUTER JOIN TableY with relation in the ON clause.
|
||||
Three tables are used, where 1 table (RC) holds references to the two other tables (R and C).
|
||||
The two tables R and C contain both 1 value that isn't inside RC.
|
||||
FBTEST: functional.arno.optimizer.opt_full_join_01
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -12,6 +12,7 @@ NOTES:
|
||||
added 'rc.categoryid' to 'order by' list in order to have always stable sort result.
|
||||
Mismatch with expected result due to different position of records with the same 'rc.relationid'
|
||||
occured on 4.0.0.2298. CHecked on 4.0.0.2303.
|
||||
FBTEST: functional.arno.optimizer.opt_full_join_02
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -7,6 +7,7 @@ DESCRIPTION:
|
||||
TableX FULL OUTER JOIN TableY with relation in the ON clause.
|
||||
Three tables are used, where 1 table (RC) holds references to the two other tables (R and C).
|
||||
The two tables R and C contain both 1 value that isn't inside RC.
|
||||
FBTEST: functional.arno.optimizer.opt_full_join_03
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -9,6 +9,7 @@ DESCRIPTION:
|
||||
The two tables R and C contain both 1 value that isn't inside RC.
|
||||
=====
|
||||
NB: 'UNION ALL' is used here, so PLAN for 2.5 will be of TWO separate rows.
|
||||
FBTEST: functional.arno.optimizer.opt_full_join_04
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -6,6 +6,7 @@ TITLE: INNER JOIN join order
|
||||
DESCRIPTION:
|
||||
With a INNER JOIN the table with the smallest expected result should be the first one in
|
||||
process order.
|
||||
FBTEST: functional.arno.optimizer.opt_inner_join_01
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -9,6 +9,7 @@ DESCRIPTION:
|
||||
should be the second smallest. Note that calculation is based on page-size. Thus for tables
|
||||
which use the same nr. of data-pages, but have in reality different nr. of records
|
||||
the table N could be bigger as table N+1 in the order.
|
||||
FBTEST: functional.arno.optimizer.opt_inner_join_02
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -9,6 +9,7 @@ DESCRIPTION:
|
||||
result based on previous relation and do on till last relation.
|
||||
|
||||
Before 2.0, Firebird did stop checking order possibilties above 7 relations.
|
||||
FBTEST: functional.arno.optimizer.opt_inner_join_03
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -4,6 +4,7 @@
|
||||
ID: optimizer.inner-join-04
|
||||
TITLE: INNER JOIN join order LIKE and IS NULL
|
||||
DESCRIPTION: IS NULL should also be used for determing join order.
|
||||
FBTEST: functional.arno.optimizer.opt_inner_join_04
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -4,6 +4,7 @@
|
||||
ID: optimizer.inner-join-05
|
||||
TITLE: INNER JOIN join order LIKE and STARTING WITH
|
||||
DESCRIPTION: LIKE and STARTING WITH should also be used for determing join order.
|
||||
FBTEST: functional.arno.optimizer.opt_inner_join_05
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -8,6 +8,7 @@ DESCRIPTION:
|
||||
process order. All inner joins are combined to 1 inner join, because then a order can be
|
||||
decided between them. Relations from a VIEW can also be "merged" to the 1 inner join
|
||||
(of course not with outer joins/unions/etc..)
|
||||
FBTEST: functional.arno.optimizer.opt_inner_join_06
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -8,6 +8,7 @@ DESCRIPTION:
|
||||
in process order. The next relation should be the next relation with expected smallest
|
||||
result based on previous relation and do on till last relation.
|
||||
Old/Current limitation in Firebird does stop checking order possibilties above 7 relations.
|
||||
FBTEST: functional.arno.optimizer.opt_inner_join_07
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -4,6 +4,7 @@
|
||||
ID: optimizer.inner-join-08
|
||||
TITLE: INNER JOIN join order and VIEW
|
||||
DESCRIPTION: Try to merge the top INNER JOINs of VIEWS/TABLES together to 1 inner join.
|
||||
FBTEST: functional.arno.optimizer.opt_inner_join_08
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -9,6 +9,7 @@ DESCRIPTION:
|
||||
result based on previous relation and do on till last relation.
|
||||
|
||||
Distribution is tested if it's conjunctions are distributed from WHERE clause.
|
||||
FBTEST: functional.arno.optimizer.opt_inner_join_09
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -10,6 +10,7 @@ DESCRIPTION:
|
||||
|
||||
It is expected that a unique index gives fewer results then non-unique index.
|
||||
Thus non-unique indexes will be at the end by determing join order.
|
||||
FBTEST: functional.arno.optimizer.opt_inner_join_10
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -7,6 +7,7 @@ DESCRIPTION:
|
||||
X JOIN Y ON (X.Field = Y.Field)
|
||||
When no index can be used on a INNER JOIN and there's a relation setup between X and Y
|
||||
then a MERGE should be performed.
|
||||
FBTEST: functional.arno.optimizer.opt_inner_join_merge_01
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -7,6 +7,7 @@ DESCRIPTION:
|
||||
X JOIN Y ON (X.Field = Y.Field)
|
||||
When no index can be used on a INNER JOIN and there's a relation setup between X and Y
|
||||
then a MERGE should be performed.
|
||||
FBTEST: functional.arno.optimizer.opt_inner_join_merge_02
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -7,6 +7,7 @@ DESCRIPTION:
|
||||
X JOIN Y ON (X.Field + (10 * 2) = Y.Field + 20)
|
||||
When no index can be used on a INNER JOIN and there's a relation setup between X and Y
|
||||
then a MERGE should be performed. Also when expressions are used.
|
||||
FBTEST: functional.arno.optimizer.opt_inner_join_merge_03
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -7,6 +7,7 @@ DESCRIPTION:
|
||||
X JOIN Y ON (X.Field = Y.Field)
|
||||
When no index can be used on a INNER JOIN and there's a relation setup between X and Y
|
||||
then a MERGE should be performed. An equality between NULLs should not be seen as true.
|
||||
FBTEST: functional.arno.optimizer.opt_inner_join_merge_04
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -7,6 +7,7 @@ DESCRIPTION:
|
||||
X JOIN Y ON (X.Field = Y.Field)
|
||||
When no index can be used on a INNER JOIN and there's a relation setup between X and Y
|
||||
then a MERGE should be performed. Of course also when a VIEW is used.
|
||||
FBTEST: functional.arno.optimizer.opt_inner_join_merge_05
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -7,6 +7,7 @@ DESCRIPTION:
|
||||
X JOIN Y ON (X.Field = Y.Field)
|
||||
When no index can be used on a INNER JOIN and there's a relation setup between X and Y
|
||||
then a MERGE should be performed. Test with selectable Stored Procedure.
|
||||
FBTEST: functional.arno.optimizer.opt_inner_join_merge_06
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -6,6 +6,7 @@ TITLE: LEFT OUTER JOIN with no match at all
|
||||
DESCRIPTION:
|
||||
TableX LEFT OUTER JOIN TableY with no match, thus result should contain all NULLs for
|
||||
TableY references.
|
||||
FBTEST: functional.arno.optimizer.opt_left_join_01
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -7,6 +7,7 @@ DESCRIPTION:
|
||||
TableX LEFT OUTER JOIN TableY with no match, thus result should contain all NULLs for TableY
|
||||
references. WHERE clause contains IS NULL on a field which is also in a single segment index.
|
||||
The WHERE clause shouldn't be distributed to the joined table..
|
||||
FBTEST: functional.arno.optimizer.opt_left_join_02
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -7,6 +7,7 @@ DESCRIPTION:
|
||||
TableX LEFT OUTER JOIN TableY with full match.
|
||||
ON clause contains (1 = 1) and WHERE clause contains relation between TableX and TableY.
|
||||
The WHERE comparison should be distributed to TableY. Thus TableY should use the index.
|
||||
FBTEST: functional.arno.optimizer.opt_left_join_03
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -7,6 +7,7 @@ DESCRIPTION:
|
||||
TableX LEFT OUTER JOIN TableY with full match. Every reference from TableY should have a value.
|
||||
|
||||
This test also tests if not the ON clause is distributed to the outer context TableX.
|
||||
FBTEST: functional.arno.optimizer.opt_left_join_04
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -10,6 +10,7 @@ DESCRIPTION:
|
||||
This test also tests if not the ON clause is distributed to the outer context TableX.
|
||||
Also if not the extra created nodes (comparisons) from a equality node and a A # B
|
||||
node (# =, <, <=, >=, >) are distributed to the outer context.
|
||||
FBTEST: functional.arno.optimizer.opt_left_join_05
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -10,6 +10,7 @@ DESCRIPTION:
|
||||
This test also tests if not the ON clause is distributed to the outer context TableX.
|
||||
Also if not the extra created nodes (comparisons) from a equality node and a A # B
|
||||
node (# =, <, <=, >=, >) are distributed to the outer context.
|
||||
FBTEST: functional.arno.optimizer.opt_left_join_06
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -6,6 +6,7 @@ TITLE: 4 JOINed tables with 1 LEFT OUTER JOIN
|
||||
DESCRIPTION:
|
||||
A INNER JOINed TableD to a LEFT JOINed TableC should be able to access the outer TableB
|
||||
of TableC. Also TableB is INNER JOINed to TableA. Three indexes can and should be used here.
|
||||
FBTEST: functional.arno.optimizer.opt_left_join_07
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -7,6 +7,7 @@ DESCRIPTION:
|
||||
TableX LEFT OUTER JOIN TableY with full match, but TableY results limited in ON clause.
|
||||
Which should result in partial NULL results for TableY. Due the WHERE clause a index for
|
||||
TableX should be used.
|
||||
FBTEST: functional.arno.optimizer.opt_left_join_08
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -7,6 +7,7 @@ DESCRIPTION:
|
||||
TableX LEFT OUTER JOIN TableY with full match, but TableY results limited in ON clause.
|
||||
Which should result in partial NULL results for TableY, but these are not visible because
|
||||
they are filtered in the WHERE clause by "greater or equal than" operator.
|
||||
FBTEST: functional.arno.optimizer.opt_left_join_09
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -7,6 +7,7 @@ DESCRIPTION:
|
||||
TableX LEFT OUTER JOIN TableY with no match, thus result should contain all NULLs for TableY
|
||||
references. WHERE clause contains IS NULL on a field which is also in a single segment index.
|
||||
The WHERE clause shouldn't be distributed to the joined table.
|
||||
FBTEST: functional.arno.optimizer.opt_left_join_10
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -7,6 +7,7 @@ DESCRIPTION:
|
||||
TableX LEFT OUTER JOIN TableY with no match, thus result should contain all NULLs for
|
||||
TableY references. WHERE clause contains STARTING WITH on a field which is also in
|
||||
a single segment index. The WHERE clause should be distributed to the joined table.
|
||||
FBTEST: functional.arno.optimizer.opt_left_join_11
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -6,6 +6,7 @@ TITLE: LEFT OUTER JOIN with distribution CASE
|
||||
DESCRIPTION:
|
||||
TableX LEFT OUTER JOIN TableY with partial match. WHERE clause contains CASE expression
|
||||
based on TableY. The WHERE clause should not be distributed to the joined table.
|
||||
FBTEST: functional.arno.optimizer.opt_left_join_12
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -5,6 +5,7 @@ ID: optimizer.left-join-13
|
||||
TITLE: LEFT OUTER JOIN VIEW with full match
|
||||
DESCRIPTION:
|
||||
TableX LEFT OUTER JOIN ViewY with full match. Every reference from ViewY should have a value.
|
||||
FBTEST: functional.arno.optimizer.opt_left_join_13
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -5,6 +5,7 @@ ID: optimizer.mixed-joins-01
|
||||
TITLE: Mixed JOINS
|
||||
DESCRIPTION:
|
||||
Tables without indexes should be merged (when inner join) and those who can use a index, should use it.
|
||||
FBTEST: functional.arno.optimizer.opt_mixed_joins_01
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -5,6 +5,7 @@ ID: optimizer.mixed-joins-02
|
||||
TITLE: Mixed JOINS
|
||||
DESCRIPTION:
|
||||
Tables without indexes should be merged (when inner join) and those who can use a index, should use it.
|
||||
FBTEST: functional.arno.optimizer.opt_mixed_joins_02
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -5,6 +5,7 @@ ID: optimizer.mixed-joins-03
|
||||
TITLE: Mixed JOINS
|
||||
DESCRIPTION:
|
||||
Tables without indexes should be merged (when inner join) and those who can use a index, should use it.
|
||||
FBTEST: functional.arno.optimizer.opt_mixed_joins_03
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -5,6 +5,7 @@ ID: optimizer.mixed-joins-04
|
||||
TITLE: Mixed JOINS
|
||||
DESCRIPTION:
|
||||
Tables without indexes should be merged (when inner join) and those who can use a index, should use it.
|
||||
FBTEST: functional.arno.optimizer.opt_mixed_joins_04
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -5,6 +5,7 @@ ID: optimizer.mixed-joins-05
|
||||
TITLE: Mixed JOINS
|
||||
DESCRIPTION:
|
||||
Tables without indexes should be merged (when inner join) and those who can use a index, should use it.
|
||||
FBTEST: functional.arno.optimizer.opt_mixed_joins_05
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -5,6 +5,7 @@ ID: optimizer.mixed-joins-06
|
||||
TITLE: Mixed JOINS
|
||||
DESCRIPTION:
|
||||
Tables without indexes should be merged (when inner join) and those who can use a index, should use it.
|
||||
FBTEST: functional.arno.optimizer.opt_mixed_joins_06
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -7,6 +7,7 @@ DESCRIPTION:
|
||||
Check if it will select only the index with the unique index when equal operator is
|
||||
performed on all segments in index. Also prefer ASC index above DESC unique index.
|
||||
Unique index together with equals operator will always be the best index to choose.
|
||||
FBTEST: functional.arno.optimizer.opt_multi_index_selection_01
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -7,6 +7,7 @@ DESCRIPTION:
|
||||
Check if it will select the indexes which can be used.
|
||||
(Indexes with selectivity more than 10x the best are ignored)
|
||||
See SELECTIVITY_THRESHOLD_FACTOR in opt.cpp
|
||||
FBTEST: functional.arno.optimizer.opt_multi_index_selection_02
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -8,6 +8,7 @@ DESCRIPTION:
|
||||
Full-segment-matched indexes have higher priority as partial matched indexes.
|
||||
(Indexes with selectivity more than 10x the best are ignored)
|
||||
See SELECTIVITY_THRESHOLD_FACTOR in opt.cpp
|
||||
FBTEST: functional.arno.optimizer.opt_multi_index_selection_03
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -9,6 +9,7 @@ DESCRIPTION:
|
||||
(up to two segments and only ASC) is made. The best here is using 2 indexes, except if
|
||||
the index for the "greater or equal" operator is much worser as the index used for
|
||||
the other two operators.
|
||||
FBTEST: functional.arno.optimizer.opt_multi_index_selection_04
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
@ -7,6 +7,7 @@ DESCRIPTION:
|
||||
Check if it will select the index with the best selectivity and with the biggest segment
|
||||
match. 2 equals operators and 1 greater or equal operator and every index combination is
|
||||
made (only ASC). The best here is using 1 index (F2_F3_F1 or F3_F2_F1).
|
||||
FBTEST: functional.arno.optimizer.opt_multi_index_selection_05
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user