mirror of
https://github.com/FirebirdSQL/firebird-qa.git
synced 2025-01-22 13:33:07 +01:00
Added/Updated tests\bugs\core_5118_test.py: Replaced test query so that it does not use index navigation ('plan order') but still checks indexed access. Requested by dimitr, letters with subj 'core_5118_test', since 11.09.2024 17:26. Checked on 6.0.0.452, 5.0.2.1493, 4.0.5.3136, 3.0.13.33789
This commit is contained in:
parent
9afb73b053
commit
1e08690886
@ -7,6 +7,17 @@ TITLE: Indices on computed fields are broken after restore (all keys are N
|
|||||||
DESCRIPTION:
|
DESCRIPTION:
|
||||||
JIRA: CORE-5118
|
JIRA: CORE-5118
|
||||||
FBTEST: bugs.core_5118
|
FBTEST: bugs.core_5118
|
||||||
|
NOTES:
|
||||||
|
[12.09.2024] pzotov
|
||||||
|
Replaced test query so that it does not use index navigation ('plan order') but still checks indexed access.
|
||||||
|
Three separate queries with 'PLAN ... INDEX' are used instead of one with 'where <comp_field> IN <literals_list>'.
|
||||||
|
This is because of optimizer changed in 5.x and issues plan with only *one* occurrence of 'INDEX' for such cases.
|
||||||
|
See: https://github.com/FirebirdSQL/firebird/pull/7707 - "Better processing and optimization if IN <list>".
|
||||||
|
Commit: https://github.com/FirebirdSQL/firebird/commit/0493422c9f729e27be0112ab60f77e753fabcb5b, 04-sep-2023.
|
||||||
|
|
||||||
|
Requested by dimitr, letters with subj 'core_5118_test', since 11.09.2024 17:26.
|
||||||
|
|
||||||
|
Checked on 6.0.0.452, 5.0.2.1493, 4.0.5.3136, 3.0.13.33789
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
@ -32,40 +43,40 @@ init_script = """
|
|||||||
commit;
|
commit;
|
||||||
"""
|
"""
|
||||||
|
|
||||||
db = db_factory(init=init_script)
|
db = db_factory(init = init_script)
|
||||||
|
|
||||||
act = python_act('db')
|
act = python_act('db', substitutions = [ ('[ \t]+',' ') ])
|
||||||
|
|
||||||
expected_stdout = """
|
expected_stdout = """
|
||||||
PLAN (TEST ORDER TEST_CONCAT_TEXT)
|
PLAN (TEST INDEX (TEST_CONCAT_TEXT))
|
||||||
|
CONCAT_TEXT nom1 prenom1
|
||||||
|
Records affected: 1
|
||||||
|
|
||||||
ID 1
|
PLAN (TEST INDEX (TEST_CONCAT_TEXT))
|
||||||
X nom1
|
CONCAT_TEXT nom2 prenom2
|
||||||
Y prenom1
|
Records affected: 1
|
||||||
CONCAT_TEXT nom1 prenom1
|
|
||||||
|
|
||||||
ID 2
|
PLAN (TEST INDEX (TEST_CONCAT_TEXT))
|
||||||
X nom2
|
CONCAT_TEXT nom3 prenom3
|
||||||
Y prenom2
|
Records affected: 1
|
||||||
CONCAT_TEXT nom2 prenom2
|
"""
|
||||||
|
|
||||||
ID 3
|
test_sql = """
|
||||||
X nom3
|
set list on;
|
||||||
Y prenom3
|
set plan on;
|
||||||
CONCAT_TEXT nom3 prenom3
|
set count on;
|
||||||
|
select concat_text from test where concat_text = 'nom1 prenom1';
|
||||||
Records affected: 3
|
select concat_text from test where concat_text = 'nom2 prenom2';
|
||||||
|
select concat_text from test where concat_text = 'nom3 prenom3';
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@pytest.mark.version('>=3.0')
|
@pytest.mark.version('>=3.0')
|
||||||
def test_1(act: Action):
|
def test_1(act: Action):
|
||||||
with act.connect_server() as srv:
|
with act.connect_server() as srv:
|
||||||
backup = BytesIO()
|
backup = BytesIO()
|
||||||
srv.database.local_backup(database=act.db.db_path, backup_stream=backup)
|
srv.database.local_backup(database = act.db.db_path, backup_stream = backup)
|
||||||
backup.seek(0)
|
backup.seek(0)
|
||||||
srv.database.local_restore(database=act.db.db_path, backup_stream=backup,
|
srv.database.local_restore(database = act.db.db_path, backup_stream=backup, flags = SrvRestoreFlag.REPLACE)
|
||||||
flags=SrvRestoreFlag.REPLACE)
|
|
||||||
act.expected_stdout = expected_stdout
|
act.expected_stdout = expected_stdout
|
||||||
act.isql(switches=['-q'],
|
act.isql(switches=['-q'], input = test_sql, combine_output = True)
|
||||||
input='set list on; set plan on; set count on; select * from test order by concat_text;')
|
|
||||||
assert act.clean_stdout == act.clean_expected_stdout
|
assert act.clean_stdout == act.clean_expected_stdout
|
||||||
|
Loading…
Reference in New Issue
Block a user