From 05e60132e6287cd77769daf77153d75d3a0db913 Mon Sep 17 00:00:00 2001 From: pavel-zotov Date: Wed, 22 Feb 2023 22:21:59 +0300 Subject: [PATCH] Added/Updated tests\bugs\gh_7237_test.py: Cheched on 5.0.0.958; 4.0.3.2903; 3.0.11.33664 - all fine. --- tests/bugs/gh_7237_test.py | 52 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 tests/bugs/gh_7237_test.py diff --git a/tests/bugs/gh_7237_test.py b/tests/bugs/gh_7237_test.py new file mode 100644 index 00000000..4c484adc --- /dev/null +++ b/tests/bugs/gh_7237_test.py @@ -0,0 +1,52 @@ +#coding:utf-8 + +""" +ID: issue-7237 +ISSUE: 7237 +TITLE: Starting operator become unstable on indexed varchar fields +NOTES: + [22.02.2023] pzotov + Confirmed bug on 3.0.10.33601 + Cheched on 5.0.0.958; 4.0.3.2903; 3.0.11.33664 - all fine. +""" + +import pytest +from firebird.qa import * + +db = db_factory(charset = 'utf8') + +test_script = """ + set list on; + create table test(id int, str_field varchar(10) character set utf8 collate unicode_ci); + create index test_idx1 on test (str_field); + insert into test(id, str_field) values(1, 'ПАПА'); + + -- Tests + set count on; + select id from test where str_field starting 'П'; -- Found + select id from test where str_field starting 'ПА'; -- Not found + select id from test where str_field starting 'ПАП'; -- Found + select id from test where str_field starting 'ПАПА'; -- Not found +""" + +expected_stdout = """ + ID 1 + Records affected: 1 + + ID 1 + Records affected: 1 + + ID 1 + Records affected: 1 + + ID 1 + Records affected: 1 +""" + +act = isql_act('db', test_script) + +@pytest.mark.version('>=3.0.10') +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