2021-04-26 20:07:00 +02:00
|
|
|
#coding:utf-8
|
|
|
|
|
2022-01-22 21:59:15 +01:00
|
|
|
"""
|
|
|
|
ID: issue-3719
|
|
|
|
ISSUE: 3719
|
|
|
|
TITLE: Predicate (blob_field LIKE ?) describes the parameter as VARCHAR(30) rather than as BLOB
|
|
|
|
DESCRIPTION:
|
|
|
|
JIRA: CORE-3353
|
2022-02-02 15:46:19 +01:00
|
|
|
FBTEST: bugs.core_3353
|
2022-01-22 21:59:15 +01:00
|
|
|
"""
|
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 = """
|
2021-04-26 20:07:00 +02:00
|
|
|
set sqlda_display on;
|
|
|
|
set planonly;
|
|
|
|
select rdb$procedure_source from rdb$procedures where rdb$procedure_source like ?;
|
|
|
|
-- NB: output in 3.0 will contain values of sqltype with ZERO in bit_0,
|
|
|
|
-- so it will be: 520 instead of previous 521.
|
|
|
|
-- (see also: core_4156.fbt)
|
2021-12-22 20:23:11 +01:00
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-22 21:59:15 +01:00
|
|
|
act = isql_act('db', test_script, substitutions=[('^((?!sqltype).)*$', ''), ('[ ]+', ' '), ('[\t]*', ' ')])
|
|
|
|
|
|
|
|
# version: 3.0
|
2021-04-26 20:07:00 +02:00
|
|
|
|
|
|
|
expected_stdout_1 = """
|
2021-08-03 23:29:08 +02:00
|
|
|
01: sqltype: 520 BLOB Nullable scale: 0 subtype: 1 len: 8 charset: 4 UTF8
|
|
|
|
01: sqltype: 520 BLOB Nullable scale: 0 subtype: 1 len: 8 charset: 4 UTF8
|
2021-12-22 20:23:11 +01:00
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
|
|
|
@pytest.mark.version('>=3.0,<4.0')
|
2022-01-22 21:59:15 +01:00
|
|
|
def test_1(act: Action):
|
|
|
|
act.expected_stdout = expected_stdout_1
|
|
|
|
act.execute(charset='utf8')
|
|
|
|
assert act.clean_stdout == act.clean_expected_stdout
|
2021-04-26 20:07:00 +02:00
|
|
|
|
|
|
|
# version: 4.0
|
|
|
|
|
|
|
|
expected_stdout_2 = """
|
|
|
|
01: sqltype: 520 BLOB Nullable scale: 0 subtype: 1 len: 8 charset: 4 UTF8
|
|
|
|
01: sqltype: 520 BLOB Nullable scale: 0 subtype: 1 len: 8 charset: 4 UTF8
|
2021-12-22 20:23:11 +01:00
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
|
|
|
@pytest.mark.version('>=4.0')
|
2022-01-22 21:59:15 +01:00
|
|
|
def test_2(act: Action):
|
|
|
|
act.expected_stdout = expected_stdout_2
|
|
|
|
act.execute()
|
|
|
|
assert act.clean_stdout == act.clean_expected_stdout
|
2021-04-26 20:07:00 +02:00
|
|
|
|