6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-22 13:33:07 +01:00
firebird-qa/tests/bugs/core_1619_test.py

52 lines
1.4 KiB
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-2040
ISSUE: 2040
TITLE: Some aggregate functions does NOT support NULL-constant in 3-d dialect
DESCRIPTION:
JIRA: CORE-1619
FBTEST: bugs.core_1619
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
db = db_factory(sql_dialect=3)
2021-04-26 20:07:00 +02:00
2022-01-20 17:32:14 +01:00
test_script = """
2021-04-26 20:07:00 +02:00
set list on;
2022-01-20 17:32:14 +01:00
select
2021-04-26 20:07:00 +02:00
avg(null) as avg_for_null
,sum(null) as sum_for_null
,var_samp(null) as var_samp_for_null
,var_pop(null) as var_pop_for_null
,stddev_samp(null) as stddev_samp_for_null
,stddev_pop(null) as stddev_pop_for_null
,covar_samp(null, null) as covar_samp_for_nulls
,covar_pop(null, null) as covar_pop_for_nulls
,corr(null, null) as corr_for_nulls
from rdb$relations;
2021-12-22 20:23:11 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-20 17:32:14 +01:00
act = isql_act('db', test_script)
2021-04-26 20:07:00 +02:00
2022-01-20 17:32:14 +01:00
expected_stdout = """
2021-04-26 20:07:00 +02:00
AVG_FOR_NULL <null>
SUM_FOR_NULL <null>
VAR_SAMP_FOR_NULL <null>
VAR_POP_FOR_NULL <null>
STDDEV_SAMP_FOR_NULL <null>
STDDEV_POP_FOR_NULL <null>
COVAR_SAMP_FOR_NULLS <null>
COVAR_POP_FOR_NULLS <null>
CORR_FOR_NULLS <null>
2021-12-22 20:23:11 +01:00
"""
2021-04-26 20:07:00 +02:00
@pytest.mark.version('>=3.0')
2022-01-20 17:32:14 +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