Subject | Ambiguity not detected in coalesce |
---|---|
Author | kimon_the_athenian2 |
Post date | 2004-06-08T14:42:32Z |
Hi!
I had problems with a query that gave false results, then I noticed
that i hadn't qualified one of the fields in coalesce in select.
Unfourtunately firebird didn't warn about it and just used one of the
tables (listed at the end of from clause) where a field with this
name could be found.
The tables and query are too complex to show here, so I put a
simplified version here:
table1
------
some_field
table2
------
other_field
select coalesce (t2_alias1.field2 + other_field)
from table1 t1
left join table2 t2_alias1 on (...)
left join table2 t2_alias2 on (...)
The result showed that value from t2_alias2 appeared into coalesce.
Aivar
I had problems with a query that gave false results, then I noticed
that i hadn't qualified one of the fields in coalesce in select.
Unfourtunately firebird didn't warn about it and just used one of the
tables (listed at the end of from clause) where a field with this
name could be found.
The tables and query are too complex to show here, so I put a
simplified version here:
table1
------
some_field
table2
------
other_field
select coalesce (t2_alias1.field2 + other_field)
from table1 t1
left join table2 t2_alias1 on (...)
left join table2 t2_alias2 on (...)
The result showed that value from t2_alias2 appeared into coalesce.
Aivar