2021-04-26 20:07:00 +02:00
|
|
|
#coding:utf-8
|
2022-01-20 17:32:14 +01:00
|
|
|
|
|
|
|
"""
|
|
|
|
ID: issue-1766
|
|
|
|
ISSUE: 1766
|
|
|
|
TITLE: Unexpected "cannot transliterate" error
|
|
|
|
DESCRIPTION:
|
|
|
|
JIRA: CORE-1347
|
2022-02-02 15:46:19 +01:00
|
|
|
FBTEST: bugs.core_1347
|
2022-01-20 17:32:14 +01:00
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
|
|
|
import pytest
|
2022-01-20 17:32:14 +01:00
|
|
|
from firebird.qa import *
|
2021-11-11 18:01:08 +01:00
|
|
|
from pathlib import Path
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-20 17:32:14 +01:00
|
|
|
db = db_factory(charset='WIN1251')
|
2021-11-11 18:01:08 +01:00
|
|
|
|
2022-01-20 17:32:14 +01:00
|
|
|
act = python_act('db')
|
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
|
|
|
RDB$PROCEDURE_NAME SP_TEST
|
2021-11-11 18:01:08 +01:00
|
|
|
Records affected: 1
|
2021-12-22 20:23:11 +01:00
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-20 17:32:14 +01:00
|
|
|
tmp_file = temp_file('non_ascii_ddl.sql')
|
2021-11-11 18:01:08 +01:00
|
|
|
|
|
|
|
sql_txt = '''set bail on;
|
|
|
|
|
|
|
|
set term ^ ;
|
|
|
|
create procedure sp_test (
|
|
|
|
p_tablename varchar(30) ,
|
|
|
|
p_idname varchar(30) ,
|
|
|
|
p_seqname varchar(30) ,
|
|
|
|
p_isusefunc smallint
|
|
|
|
)
|
|
|
|
returns (
|
|
|
|
column_value bigint
|
|
|
|
)
|
|
|
|
as
|
|
|
|
declare variable l_maxid bigint;
|
|
|
|
begin
|
|
|
|
/*
|
|
|
|
-- Находим разрыв в значениях ПК таблицы
|
|
|
|
-- если разрыв отсутствует то дергаем секвенс
|
|
|
|
-- p_IsUseFunc=1 - дергать секвенс ч/з ф-цию GetSeqValue
|
|
|
|
*/
|
|
|
|
end ^
|
|
|
|
set term ;^
|
|
|
|
commit;
|
|
|
|
|
|
|
|
set list on;
|
|
|
|
set count on;
|
|
|
|
|
|
|
|
select pr.rdb$procedure_name
|
|
|
|
from rdb$procedures pr
|
|
|
|
where pr.rdb$procedure_source containing '1'
|
|
|
|
and pr.rdb$procedure_name = upper('sp_test');
|
|
|
|
'''
|
|
|
|
|
2024-10-31 11:32:10 +01:00
|
|
|
@pytest.mark.intl
|
2022-01-20 17:32:14 +01:00
|
|
|
@pytest.mark.version('>=3')
|
|
|
|
def test_1(act: Action, tmp_file: Path):
|
|
|
|
tmp_file.write_bytes(sql_txt.encode('cp1251'))
|
|
|
|
act.expected_stdout = expected_stdout
|
|
|
|
act.isql(switches=['-q'], input_file=tmp_file, charset='win1251', io_enc='cp1251')
|
|
|
|
assert act.clean_stdout == act.clean_expected_stdout
|
2021-04-26 20:07:00 +02:00
|
|
|
|
|
|
|
|