2021-04-26 20:07:00 +02:00
|
|
|
#coding:utf-8
|
|
|
|
|
2022-01-25 22:55:48 +01:00
|
|
|
"""
|
|
|
|
ID: issue-5640
|
|
|
|
ISSUE: 5640
|
|
|
|
TITLE: Regression: (boolean) parameters as search condition no longer allowed
|
|
|
|
DESCRIPTION:
|
|
|
|
JIRA: CORE-v
|
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-25 22:55:48 +01:00
|
|
|
import pytest
|
|
|
|
from firebird.qa import *
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-25 22:55:48 +01:00
|
|
|
init_script = """
|
2021-04-26 20:07:00 +02:00
|
|
|
recreate table test(id int,boo boolean);
|
2021-12-22 20:23:11 +01:00
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-25 22:55:48 +01:00
|
|
|
db = db_factory(init=init_script)
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-25 22:55:48 +01:00
|
|
|
test_script = """
|
2021-04-26 20:07:00 +02:00
|
|
|
set sqlda_display on;
|
|
|
|
set planonly;
|
|
|
|
select * from test where ?;
|
|
|
|
set planonly;
|
2021-12-22 20:23:11 +01:00
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-25 22:55:48 +01:00
|
|
|
act = isql_act('db', test_script)
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-25 22:55:48 +01:00
|
|
|
expected_stdout = """
|
2021-04-26 20:07:00 +02:00
|
|
|
INPUT message field count: 1
|
|
|
|
01: sqltype: 32764 BOOLEAN scale: 0 subtype: 0 len: 1
|
|
|
|
: name: alias:
|
|
|
|
: table: owner:
|
|
|
|
|
|
|
|
PLAN (TEST NATURAL)
|
|
|
|
|
|
|
|
OUTPUT message field count: 2
|
|
|
|
01: sqltype: 496 LONG Nullable scale: 0 subtype: 0 len: 4
|
|
|
|
: name: ID alias: ID
|
|
|
|
: table: TEST owner: SYSDBA
|
|
|
|
02: sqltype: 32764 BOOLEAN Nullable scale: 0 subtype: 0 len: 1
|
|
|
|
: name: BOO alias: BOO
|
|
|
|
: table: TEST owner: SYSDBA
|
2021-12-22 20:23:11 +01:00
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
|
|
|
@pytest.mark.version('>=3.0.2')
|
2022-01-25 22:55:48 +01:00
|
|
|
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
|
|
|
|