mirror of
https://github.com/FirebirdSQL/firebird-qa.git
synced 2025-01-22 21:43:06 +01:00
76 lines
2.2 KiB
Python
76 lines
2.2 KiB
Python
#coding:utf-8
|
|
#
|
|
# id: bugs.core_4061
|
|
# title: isql does not insert boolean values correctly, always shown as False
|
|
# decription:
|
|
# tracker_id: CORE-4061
|
|
# min_versions: ['3.0']
|
|
# versions: 3.0
|
|
# qmid: None
|
|
|
|
import pytest
|
|
from firebird.qa import db_factory, isql_act, Action
|
|
|
|
# version: 3.0
|
|
# resources: None
|
|
|
|
substitutions_1 = []
|
|
|
|
init_script_1 = """"""
|
|
|
|
db_1 = db_factory(page_size=4096, sql_dialect=3, init=init_script_1)
|
|
|
|
test_script_1 = """
|
|
create table x(
|
|
id smallint generated by default as identity,
|
|
a varchar(10),
|
|
b boolean,
|
|
c boolean,
|
|
primary key(id)
|
|
);
|
|
commit;
|
|
insert into x(a,b,c) values ('f1',true, false);
|
|
insert into x(a,b,c) values ('f2',1=1, null is null);
|
|
insert into x(a,b,c) values ('f3', null is not null, null = null);
|
|
insert into x(a,b,c) values ('f4', null is not distinct from null, null and null and not null);
|
|
insert into x(a,b,c) values ('f5', true is not distinct from not false, not false is not distinct from not not true );
|
|
set list on;
|
|
select * from x;
|
|
"""
|
|
|
|
act_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)
|
|
|
|
expected_stdout_1 = """
|
|
ID 1
|
|
A f1
|
|
B <true>
|
|
C <false>
|
|
|
|
ID 2
|
|
A f2
|
|
B <true>
|
|
C <true>
|
|
|
|
ID 3
|
|
A f3
|
|
B <false>
|
|
C <null>
|
|
|
|
ID 4
|
|
A f4
|
|
B <true>
|
|
C <null>
|
|
|
|
ID 5
|
|
A f5
|
|
B <true>
|
|
C <true>
|
|
"""
|
|
|
|
@pytest.mark.version('>=3.0')
|
|
def test_1(act_1: Action):
|
|
act_1.expected_stdout = expected_stdout_1
|
|
act_1.execute()
|
|
assert act_1.clean_stdout == act_1.clean_expected_stdout
|
|
|