6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-22 21:43:06 +01:00
firebird-qa/tests/bugs/core_1828_test.py

43 lines
915 B
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-20 17:32:14 +01:00
"""
ID: issue-2257
ISSUE: 2257
TITLE: Error with ABS in dialect 1
DESCRIPTION:
JIRA: CORE-1828
FBTEST: bugs.core_1828
2022-01-20 17:32:14 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-20 17:32:14 +01:00
import pytest
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-20 17:32:14 +01:00
init_script = """CREATE TABLE TEST (MYNUM INTEGER);
2021-04-26 20:07:00 +02:00
COMMIT;
INSERT INTO TEST (MYNUM) VALUES (1);
INSERT INTO TEST (MYNUM) VALUES (-1);
INSERT INTO TEST (MYNUM) VALUES (2147483647);
INSERT INTO TEST (MYNUM) VALUES (-2147483648);
COMMIT;
"""
2022-01-20 17:32:14 +01:00
db = db_factory(charset='UTF8', sql_dialect=1, init=init_script)
2021-04-26 20:07:00 +02:00
2022-01-20 17:32:14 +01:00
act = isql_act('db', "SELECT ABS(MYNUM) FROM TEST;")
2021-04-26 20:07:00 +02:00
2022-01-20 17:32:14 +01:00
expected_stdout = """
2021-10-21 19:29:23 +02:00
ABS
=======================
1.000000000000000
1.000000000000000
2147483647.000000
2147483648.000000
2021-04-26 20:07:00 +02:00
"""
2022-01-20 17:32:14 +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