mirror of
https://github.com/FirebirdSQL/firebird-qa.git
synced 2025-01-22 13:33:07 +01:00
70 lines
1.9 KiB
Python
70 lines
1.9 KiB
Python
#coding:utf-8
|
|
|
|
"""
|
|
ID: issue-4389
|
|
ISSUE: 4389
|
|
TITLE: isql does not insert boolean values correctly, always shown as False
|
|
DESCRIPTION:
|
|
JIRA: CORE-4061
|
|
FBTEST: bugs.core_4061
|
|
"""
|
|
|
|
import pytest
|
|
from firebird.qa import *
|
|
|
|
db = db_factory()
|
|
|
|
test_script = """
|
|
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 = isql_act('db', test_script)
|
|
|
|
expected_stdout = """
|
|
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: Action):
|
|
act.expected_stdout = expected_stdout
|
|
act.execute()
|
|
assert act.clean_stdout == act.clean_expected_stdout
|
|
|