Symptom
User Query will use the LEFT OUTER JOIN and the constant value.
In this case, returns the result of SAP IQ is unexpected.
This problem was confirmed to be reproduced in all later versions of Sybase IQ 12.4.3.
Query1: Query should be NULL as val2, but val2 is returned as '2'
--------------------------------------------------------------
(DBA)> select main.val1,sub.val2 from (select 1 as val1 from iq_dummy where 0=0) main left outer join ( select 2 as val2 from iq_dummy where 1=0 ) sub on 0=0;
val1 val2
-------------
1 2 <---- Correct Value is NULL
(1 rows)
Query2: Query should return one row, but it returns no row.
--------------------------------------------------------------
(DBA)> select main.val1,sub.val2 from (select 1 as val1 from iq_dummy where 0=0) main left outer join ( select 2 as val2 from iq_dummy where 1=0 group by val2) sub on 0=0;
val1 val2
-------------
(0 rows) <---- Correct Value is 1 row
This problem will reproduce when using the IQ engine.
For example, when you use a dummy table, the problem does not reproduce.
Using dummy table(use a SQLA engine)
--------------------------------------------------------------
(DBA)> select main.val1,sub.val2 from (select 1 as val1 from dummy where 0=0) main left outer join ( select 2 as val2 from dummy where 1=0 ) sub on 0=0;
val1 val2
-------------
1 (NULL)
(1 rows)
Execution time: 0.004 seconds
(DBA)> select main.val1,sub.val2 from (select 1 as val1 from dummy where 0=0) main left outer join ( select 2 as val2 from dummy where 1=0 group by val2) sub on 0=0;
val1 val2
-------------
1 (NULL)
(1 rows)
Read more...
Environment
- Sybase IQ 12.7
- SAP IQ 15.x or later
- SAP IQ 16.x
Product
Keywords
LEFT OUTER JOIN, 796769, , KBA , BC-SYB-IQ , Sybase IQ , Bug Filed
About this page
This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP for Me (Login required).Search for additional results
Visit SAP Support Portal's SAP Notes and KBA Search.