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_6108_test.py

79 lines
1.8 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
#
# id: bugs.core_6108
# title: Regression: FB3 throws "Datatypes are not comparable in expression" in procedure parameters
2021-12-10 19:50:31 +01:00
# decription:
2021-04-26 20:07:00 +02:00
# Confirmed bug on 4.0.0.1567; 3.0.5.33160.
# Works fine on 4.0.0.1573; 3.0.x is still affected
2021-12-10 19:50:31 +01:00
#
2021-04-26 20:07:00 +02:00
# tracker_id: CORE-6108
# min_versions: ['2.5']
# versions: 2.5
# qmid: None
import pytest
2021-12-10 19:50:31 +01:00
from firebird.qa import db_factory, python_act, Action
2021-04-26 20:07:00 +02:00
# version: 2.5
# resources: None
substitutions_1 = []
init_script_1 = """"""
db_1 = db_factory(sql_dialect=3, init=init_script_1)
# test_script_1
#---
2021-12-10 19:50:31 +01:00
#
2021-04-26 20:07:00 +02:00
# proc_ddl='''
# create or alter procedure test_proc ( a_dts timestamp) returns ( o_dts timestamp) as
# begin
# o_dts = a_dts;
# suspend;
# end
# '''
2021-12-10 19:50:31 +01:00
#
2021-04-26 20:07:00 +02:00
# db_conn.execute_immediate( proc_ddl )
# db_conn.commit()
2021-12-10 19:50:31 +01:00
#
2021-04-26 20:07:00 +02:00
# cur=db_conn.cursor()
2021-12-10 19:50:31 +01:00
#
2021-04-26 20:07:00 +02:00
# sttm="select o_dts from test_proc('2019-'|| COALESCE( ?, 1) ||'-01' )"
# cur.execute( sttm, ( 3, ) )
# for r in cur:
# print(r[0])
# cur.close()
2021-12-10 19:50:31 +01:00
#
#
2021-04-26 20:07:00 +02:00
#---
2021-12-10 19:50:31 +01:00
act_1 = python_act('db_1', substitutions=substitutions_1)
2021-04-26 20:07:00 +02:00
expected_stdout_1 = """
2019-03-01 00:00:00
2021-12-10 19:50:31 +01:00
"""
proc_ddl = """
create or alter procedure test_proc ( a_dts timestamp) returns ( o_dts timestamp) as
begin
o_dts = a_dts;
suspend;
end
"""
2021-04-26 20:07:00 +02:00
@pytest.mark.version('>=2.5')
2021-12-10 19:50:31 +01:00
def test_1(act_1: Action, capsys):
with act_1.db.connect() as con:
con.execute_immediate(proc_ddl)
con.commit()
c = con.cursor()
for row in c.execute("select o_dts from test_proc('2019-'|| COALESCE( ?, 1) ||'-01' )", [3]):
print(row[0])
#
act_1.expected_stdout = expected_stdout_1
act_1.stdout = capsys.readouterr().out
assert act_1.clean_stdout == act_1.clean_expected_stdout
2021-04-26 20:07:00 +02:00