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

43 lines
912 B
Python
Raw Permalink Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-22 21:59:15 +01:00
"""
ID: issue-1397
ISSUE: 1397
TITLE: IS NOT DISTINCT FROM NULL doesn't use index
DESCRIPTION:
JIRA: CORE-3722
FBTEST: bugs.core_3722
2022-01-22 21:59:15 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-22 21:59:15 +01:00
import pytest
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-22 21:59:15 +01:00
init_script = """create table t (a varchar(5));
2021-04-26 20:07:00 +02:00
create index t_a on t (a);
"""
2022-01-22 21:59:15 +01:00
db = db_factory(init=init_script)
2021-04-26 20:07:00 +02:00
2022-01-22 21:59:15 +01:00
test_script = """SET PLAN ON;
2021-04-26 20:07:00 +02:00
select * from t where a is null;
select * from t where a is not distinct from null;
select * from t where a is not distinct from null PLAN (T INDEX (T_A));
select * from t where a is not distinct from nullif('', '');
"""
2022-01-22 21:59:15 +01:00
act = isql_act('db', test_script)
2021-04-26 20:07:00 +02:00
2022-01-22 21:59:15 +01:00
expected_stdout = """
2021-04-26 20:07:00 +02:00
PLAN (T INDEX (T_A))
PLAN (T INDEX (T_A))
PLAN (T INDEX (T_A))
PLAN (T INDEX (T_A))
2022-01-22 21:59:15 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-22 21:59:15 +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