Issue Details (XML | Word | Printable)

Key: CORE-4366
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Dmitry Yemanov
Reporter: Pavel Zotov
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Wrong result of WHERE predicate when it contains NULL IS NOT DISTINCT FROM (select min(NULL) from ...)

Created: 15/Mar/14 06:20 PM   Updated: 23/Sep/15 12:39 PM
Component/s: Engine
Affects Version/s: 3.0 Alpha 2
Fix Version/s: 3.0 Beta 1

Issue Links:
Relate
 

QA Status: Done successfully


 Description  « Hide
LI-T3.0.0.30967 Firebird 3.0 Alpha 2

This is the content of first 10 rows in my RDB$FIELDS table, select only field "rdb$field_name":
SQL> select rdb$field_name from rdb$fields where null is NOT distinct from null rows 10;

RDB$FIELD_NAME
===============================================================================
RDB$VIEW_CONTEXT
RDB$CONTEXT_NAME
RDB$DESCRIPTION
RDB$EDIT_STRING
RDB$FIELD_ID
RDB$FIELD_NAME
RDB$SYSTEM_FLAG
RDB$SYSTEM_NULLFLAG
RDB$INDEX_ID
RDB$INDEX_NAME

When I try to add the following WHERE condition result becames wrong, no matter of what table is inside subquery that aggregates MIN(null):

SQL> select rdb$field_name from rdb$fields where null is NOT distinct from (select min(null) from rdb$fields) rows 10;

RDB$FIELD_NAME
===============================================================================
RDB$VIEW_CONTEXT

SQL> select rdb$field_name from rdb$fields where null is NOT distinct from (select min(null) from rdb$types) rows 10;

RDB$FIELD_NAME
===============================================================================
RDB$VIEW_CONTEXT

PS. Compare with LI-V2.5.3.26744 Firebird 2.5: both variants select 10 rows, which is OK:

SQL> select rdb$field_name from rdb$fields where null is NOT distinct from null rows 10;

RDB$FIELD_NAME
===============================================================================
RDB$VIEW_CONTEXT
RDB$CONTEXT_NAME
RDB$DESCRIPTION
RDB$EDIT_STRING
RDB$FIELD_ID
RDB$FIELD_NAME
RDB$SYSTEM_FLAG
RDB$INDEX_ID
RDB$INDEX_NAME
RDB$FIELD_LENGTH

SQL> select rdb$field_name from rdb$fields where null is NOT distinct from (select min(null) from rdb$fields) rows 10;

RDB$FIELD_NAME
===============================================================================
RDB$VIEW_CONTEXT
RDB$CONTEXT_NAME
RDB$DESCRIPTION
RDB$EDIT_STRING
RDB$FIELD_ID
RDB$FIELD_NAME
RDB$SYSTEM_FLAG
RDB$INDEX_ID
RDB$INDEX_NAME
RDB$FIELD_LENGTH


 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
There are no subversion log entries for this issue yet.