[
https://issues.redhat.com/browse/TEIID-5933?page=com.atlassian.jira.plugi...
]
Steven Hawkins resolved TEIID-5933.
-----------------------------------
Fix Version/s: 14.0
13.0.3
13.1.1
Resolution: Done
The check allowing the merging of the virtual layer under a left outer join was not
looking if a nested predicate can return true on null values and thus cannot have it's
position changed.
Nested left joins return wrong results
--------------------------------------
Key: TEIID-5933
URL:
https://issues.redhat.com/browse/TEIID-5933
Project: Teiid
Issue Type: Bug
Components: Query Engine
Affects Versions: 13.1
Reporter: Dmitrii Pogorelov
Assignee: Steven Hawkins
Priority: Blocker
Fix For: 14.0, 13.0.3, 13.1.1
Nested left joins in combination with a where x is null (on a left joined column) return
wrong results:
{code:sql}
-- wrong result
SELECT *
FROM test_dwh_pg.test_1 a
LEFT JOIN ( SELECT x.c1
FROM test_dwh_pg.test_2 x
LEFT JOIN (SELECT * FROM test_dwh_pg.test_3 WHERE c1 <>
'123') y ON x.c1 = y.c1 WHERE y.c1 IS NULL
) b ON a.c1 = b.c1
WHERE b.c1 IS NULL ;;
-- correct result
SELECT *
FROM test_dwh_pg.test_1 a
LEFT JOIN ( SELECT x.c1
FROM test_dwh_pg.test_2 x
LEFT JOIN (SELECT * FROM test_dwh_pg.test_3 WHERE c1 <>
'123') y ON x.c1 = y.c1 WHERE y.c1 IS NULL
LIMIT 1000000000
) b ON a.c1 = b.c1
WHERE b.c1 IS NULL ;;
{code}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)