Subject RE: [firebird-support] Re: Subselects
Author Bogdan Mugerli
Hi

The aliases were on proper places, i omitted them when translating names to
english.

When I've first encountered this, i solved it immediately and then tested in
local database and found out that
if iuse field from outer select or conditions in subselects - the results
aren't predictable anymore.

Some times such query runs smoothly for months and then suddenly start
giving bad results.


This particular database has 1000 SP's (about 80.000 lines of code) written
in dialect 1

I'm very fond of this group, so don't take me erroneusly

Regards
Bogdan

ps.:Old programmers seldom order







> Bogdan, this bug is registered in FB tracker and if you were more
>attentive, you could avoid it. Change query to

> SELECT MC1.VALID_FROM, MC1.PRICE FROM MATERIALCENA MC1
> WHERE MC1.MATERIALid = :IMATERIALID AND MC1.VALID_FROM =
> (select max(MC.VALID_FROM from materialcena mc where mc.materialid =
> MC1.MATERIALid and mc.VALID_FROM <= 'today')

> AFAIU this bug is fixed in FB1.5 but fix breaks compatibility with
>client-side components which for a long time implemented different
>workarounds. So it is decided to make fix optionally turned on/off by
>OldParameterOrdering parameter in firebird.conf. Did'nt tried to turn
>it on myself. Note proper tables aliases usage in modified query too.

> PS.: this problem should have been solved years ago

> Are you ordering?

>Best regards,
>Alexander.