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

Added/Updated tests\bugs\gh_7243_test.py: Cheched on 5.0.0.958; 4.0.3.2903 - all fine.

This commit is contained in:
pavel-zotov 2023-02-22 22:10:45 +03:00
parent 52159debd4
commit beec9beb53

View File

@ -0,0 +1,50 @@
#coding:utf-8
"""
ID: issue-7243
ISSUE: 7243
TITLE: Some UNICODE characters can lead to wrong CONTAINING evaluation when lower/upper uses different number of bytes in its encoding
NOTES:
[22.02.2023] pzotov
Confirmed bug on 5.0.0.523, got exception
Statement failed, SQLSTATE = 22001
arithmetic exception, numeric overflow, or string truncation
-string right truncation
-expected length 2, actual 2
Cheched on 5.0.0.958; 4.0.3.2903 - all fine.
"""
import pytest
from firebird.qa import *
db = db_factory(charset = 'utf8')
test_script = """
set list on;
set blob all;
create table tmp_test(id integer, note blob sub_type 1 segment size 80 character set utf8 collate unicode);
insert into tmp_test(id, note) values (1,'ɬ');
commit;
set count on;
select a.id,a.note as note_blob_id
from tmp_test a
where a.note containing 'ɬ';
"""
expected_stdout = """
ID 1
NOTE_BLOB_ID 80:0
ɬ
Records affected: 1
"""
substitutions = [ ('NOTE_BLOB_ID .*', ''), ('[ \t]+', ' ') ]
act = isql_act('db', test_script, substitutions = substitutions)
@pytest.mark.version('>=4.0.3')
def test_1(act: Action):
act.expected_stdout = expected_stdout
act.execute(combine_output = True, charset = 'utf8' )
assert act.clean_stdout == act.clean_expected_stdout