6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-22 13:33:07 +01:00
firebird-qa/tests/bugs/core_5695_test.py

53 lines
1.2 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#coding:utf-8
"""
ID: issue-5961
ISSUE: 5961
TITLE: Position function does not consider the collation for blob
DESCRIPTION:
JIRA: CORE-5695
FBTEST: bugs.core_5695
"""
import pytest
from firebird.qa import *
db = db_factory()
test_script = """
set list on;
set blob all;
set term ^;
execute block returns (res smallint) as
declare blb blob sub_type 1 segment size 80 collate unicode_ci;
declare txt varchar(255) collate unicode_ci;
begin
-- pure ASCII strings:
blb = 'A';
txt = 'a';
res = position(txt, blb);
suspend;
-- strings with NON-ascii characters:
blb= 'ŁÁTÉÇØΙΚΌΛΑΟΣ';
txt = 'Łátéçøικόλαος';
res = position(txt, blb);
suspend;
end
^
set term ;^
"""
act = isql_act('db', test_script)
expected_stdout = """
RES 1
RES 1
"""
@pytest.mark.intl
@pytest.mark.version('>=3.0.3')
def test_1(act: Action):
act.expected_stdout = expected_stdout
act.execute(charset='utf8')
assert act.clean_stdout == act.clean_expected_stdout