2021-04-26 20:07:00 +02:00
|
|
|
#coding:utf-8
|
|
|
|
|
2022-01-22 21:59:15 +01:00
|
|
|
"""
|
|
|
|
ID: issue-3880
|
|
|
|
ISSUE: 3880
|
|
|
|
TITLE: SIMILAR TO: False matches on descending ranges
|
|
|
|
DESCRIPTION:
|
|
|
|
JIRA: CORE-3523
|
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-22 21:59:15 +01:00
|
|
|
import pytest
|
|
|
|
from firebird.qa import *
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-22 21:59:15 +01:00
|
|
|
db = db_factory()
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-22 21:59:15 +01:00
|
|
|
test_script = """select 1 from rdb$database where 'm' similar to '[p-k]'
|
2021-04-26 20:07:00 +02:00
|
|
|
union
|
|
|
|
select 2 from rdb$database where 'z' similar to '[p-k]'
|
|
|
|
union
|
|
|
|
select 3 from rdb$database where 'm' not similar to '[p-k]'
|
|
|
|
union
|
|
|
|
select 4 from rdb$database where 'z' not similar to '[p-k]';
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
2022-01-22 21:59:15 +01:00
|
|
|
act = isql_act('db', test_script)
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-22 21:59:15 +01:00
|
|
|
expected_stdout = """
|
2021-04-26 20:07:00 +02:00
|
|
|
CONSTANT
|
|
|
|
============
|
|
|
|
3
|
|
|
|
4
|
2022-01-22 21:59:15 +01:00
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-22 21:59:15 +01:00
|
|
|
@pytest.mark.version('>=3')
|
|
|
|
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
|
|
|
|