mirror of
https://github.com/FirebirdSQL/firebird-qa.git
synced 2025-01-22 13:33:07 +01:00
Added/Updated tests\bugs\core_4321_test.py: Added forgotten semicolon after 'SET LIST ON'.
This commit is contained in:
parent
ba2fe0f292
commit
35aedb2690
@ -6,7 +6,12 @@ ISSUE: 4644
|
|||||||
TITLE: Regression: ISQL does not destroy the SQL statement
|
TITLE: Regression: ISQL does not destroy the SQL statement
|
||||||
DESCRIPTION:
|
DESCRIPTION:
|
||||||
JIRA: CORE-4321
|
JIRA: CORE-4321
|
||||||
FBTEST: bugs.core_4321
|
NOTES:
|
||||||
|
[31.12.2024] pzotov
|
||||||
|
Added forgotten semicolon after 'SET LIST ON'.
|
||||||
|
Parsing problem appeared on 6.0.0.0.570 after d6ad19aa07deeaac8107a25a9243c5699a3c4ea1
|
||||||
|
("Refactor ISQL creating FrontendParser class").
|
||||||
|
It looks weird how it could work w/o 'token unknown / list' all this time in all major FB versions :-)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
@ -16,54 +21,55 @@ db = db_factory()
|
|||||||
|
|
||||||
test_script = """
|
test_script = """
|
||||||
-- NB: 2.1.7 FAILED, output contains '4' for select count(*) ...
|
-- NB: 2.1.7 FAILED, output contains '4' for select count(*) ...
|
||||||
set list on
|
set list on;
|
||||||
select 1 x from rdb$database;
|
select /* tag_for_watch */ 1 point_a from rdb$database;
|
||||||
select 1 x from rdb$database;
|
select /* tag_for_watch */ 1 point_a from rdb$database;
|
||||||
select 1 x from rdb$database;
|
select /* tag_for_watch */ 1 point_a from rdb$database;
|
||||||
select 1 x from rdb$database;
|
select /* tag_for_watch */ 1 point_a from rdb$database;
|
||||||
|
|
||||||
select count(*) c from mon$statements s
|
select count(*) count_after_point_a from mon$statements s
|
||||||
where s.mon$sql_text containing 'select 1 x' -- 08-may-2017: need for 4.0 Classic! Currently there is also query with RDB$AUTH_MAPPING data in mon$statements
|
where s.mon$sql_text containing '/* tag_for_watch */'
|
||||||
;
|
;
|
||||||
commit;
|
commit;
|
||||||
select count(*) c from mon$statements s
|
select count(*) count_after_commit_a from mon$statements s
|
||||||
where s.mon$sql_text containing 'select 1 x'
|
where s.mon$sql_text containing '/* tag_for_watch */'
|
||||||
;
|
;
|
||||||
|
|
||||||
select 1 x from rdb$database;
|
select /* tag_for_watch */ 1 point_b from rdb$database;
|
||||||
select 1 x from rdb$database;
|
select /* tag_for_watch */ 1 point_b from rdb$database;
|
||||||
select 1 x from rdb$database;
|
select /* tag_for_watch */ 1 point_b from rdb$database;
|
||||||
select 1 x from rdb$database;
|
select /* tag_for_watch */ 1 point_b from rdb$database;
|
||||||
|
|
||||||
select count(*) c from mon$statements s
|
select count(*) count_after_point_b from mon$statements s
|
||||||
where s.mon$sql_text containing 'select 1 x'
|
where s.mon$sql_text containing '/* tag_for_watch */'
|
||||||
;
|
;
|
||||||
commit;
|
commit;
|
||||||
|
|
||||||
select count(*) c from mon$statements s
|
select count(*) count_after_commit_b from mon$statements s
|
||||||
where s.mon$sql_text containing 'select 1 x'
|
where s.mon$sql_text containing '/* tag_for_watch */'
|
||||||
;
|
;
|
||||||
"""
|
"""
|
||||||
|
|
||||||
act = isql_act('db', test_script)
|
act = isql_act('db', test_script, substitutions=[('[ \t]+', ' ')] )
|
||||||
|
|
||||||
expected_stdout = """
|
expected_stdout = """
|
||||||
X 1
|
POINT_A 1
|
||||||
X 1
|
POINT_A 1
|
||||||
X 1
|
POINT_A 1
|
||||||
C 1
|
POINT_A 1
|
||||||
C 1
|
COUNT_AFTER_POINT_A 1
|
||||||
X 1
|
COUNT_AFTER_COMMIT_A 1
|
||||||
X 1
|
POINT_B 1
|
||||||
X 1
|
POINT_B 1
|
||||||
X 1
|
POINT_B 1
|
||||||
C 1
|
POINT_B 1
|
||||||
C 1
|
COUNT_AFTER_POINT_B 1
|
||||||
|
COUNT_AFTER_COMMIT_B 1
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@pytest.mark.version('>=3')
|
@pytest.mark.version('>=3')
|
||||||
def test_1(act: Action):
|
def test_1(act: Action):
|
||||||
act.expected_stdout = expected_stdout
|
act.expected_stdout = expected_stdout
|
||||||
act.execute()
|
act.execute(combine_output = True)
|
||||||
assert act.clean_stdout == act.clean_expected_stdout
|
assert act.clean_stdout == act.clean_expected_stdout
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user