Subject Re: Possible BUG in Left join on Stored Procedures...
Author emb_blaster
--- In firebird-support@yahoogroups.com, "Ismael L. Donis GarcĂ­a" <ismael@...> wrote:
>
> select * from
> t1_proc T1
> LEFT JOIN
> (
> SELECT 10 AS VALX FROM rdb$database
> ) T2
> ON T1.VAL=T2.VALX
> UNION
> select * from
> t1_proc T1
> LEFT JOIN
> (
> SELECT 20 AS VALX FROM rdb$database
> ) T2
> ON T1.VAL=T2.VALX
>
> Regards
> =========
> || ISMAEL ||
> =========
> ----- Original Message -----
> From: emb_blaster
> To: firebird-support@yahoogroups.com
> Sent: Friday, February 25, 2011 3:32 PM
> Subject: [firebird-support] Possible BUG in Left join on Stored Procedures...
>

Hi Ismael,

I am not sure why you write that as you didn't provide any explanation. This only expand the bug to a union of selects. Maybe my English was not clear enough (blame my English teacher!!! \o/ ). If is that, I am sorry.
Anyway, I just found that you don't need to create a procedure to reproduce. See query below:
select * from
(SELECT 1 as val from rdb$database
UNION SELECT 2 FROM rdb$database
UNION SELECT 3 FROM rdb$database
UNION SELECT 4 FROM rdb$database) T1
LEFT JOIN
(
SELECT 10 AS VAL FROM rdb$database

) T2
ON T1.VAL=T2.VAl

Expected result set:
VAL VAL1
1 NULL
2 NULL
3 NULL
4 NULL


Result Set found:

VAL VAL1
1 10
2 10
3 10
4 10

Am I working too much?