wrong result of WHERE predicat when it contains NULL IS NOT DISTINCT FROM (select min(NULL) from ...) -----------------------------------------------------------------------------------------------------
Key: CORE-4366 URL: http://tracker.firebirdsql.org/browse/CORE-4366 Project: Firebird Core Issue Type: Bug Components: Engine Affects Versions: 3.0 Alpha 2 Reporter: Pavel Zotov 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 -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://tracker.firebirdsql.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira ------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel