2021-04-26 20:07:00 +02:00
|
|
|
#coding:utf-8
|
|
|
|
|
2022-01-20 17:32:14 +01:00
|
|
|
"""
|
|
|
|
ID: issue-1750
|
|
|
|
ISSUE: 1750
|
|
|
|
TITLE: Charset transliterations don't work with EXECUTE STATEMENT
|
|
|
|
DESCRIPTION:
|
|
|
|
JIRA: CORE-1331
|
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-20 17:32:14 +01:00
|
|
|
import pytest
|
|
|
|
from firebird.qa import *
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-20 17:32:14 +01:00
|
|
|
db = db_factory(from_backup='core1331-25.fbk', charset='utf8')
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-20 17:32:14 +01:00
|
|
|
test_script = """
|
2021-04-26 20:07:00 +02:00
|
|
|
set list on;
|
|
|
|
select opis as direct_select from T1;
|
|
|
|
set term ^ ;
|
|
|
|
execute block returns ( execute_block_select varchar(100) ) as
|
|
|
|
BEGIN
|
|
|
|
for select opis from t1
|
|
|
|
into :execute_block_select
|
|
|
|
do
|
|
|
|
SUSPEND;
|
|
|
|
END^
|
|
|
|
|
|
|
|
execute block returns ( execute_sttm_select varchar(100) ) as
|
|
|
|
BEGIN
|
|
|
|
for execute statement 'select opis from t1'
|
|
|
|
into :execute_sttm_select
|
|
|
|
do
|
|
|
|
SUSPEND;
|
|
|
|
END ^
|
|
|
|
|
|
|
|
set term ;^
|
|
|
|
"""
|
|
|
|
|
2022-01-20 17:32:14 +01:00
|
|
|
act = isql_act('db', test_script)
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-20 17:32:14 +01:00
|
|
|
expected_stdout = """
|
2021-04-26 20:07:00 +02:00
|
|
|
DIRECT_SELECT ASCII
|
|
|
|
DIRECT_SELECT милан
|
|
|
|
EXECUTE_BLOCK_SELECT ASCII
|
|
|
|
EXECUTE_BLOCK_SELECT милан
|
|
|
|
EXECUTE_STTM_SELECT ASCII
|
|
|
|
EXECUTE_STTM_SELECT милан
|
2021-12-22 20:23:11 +01:00
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
|
|
|
@pytest.mark.version('>=3.0')
|
2022-01-20 17:32:14 +01:00
|
|
|
def test_1(act: Action):
|
|
|
|
act.expected_stdout = expected_stdout
|
|
|
|
act.execute()
|
|
|
|
assert act.clean_stdout == act.clean_expected_stdout
|
2021-04-26 20:07:00 +02:00
|
|
|
|