Subject Re: [firebird-support] changed WHERE behavior from fb 1.5 to 2.5
Author Kjell Rilbe
Anderson Farias skriver:
> Not sure this was documented a while back (v.2.1 has same behavior as
> 2.5 so this was not introduced in 2.5).
>
> Lets supose you have this table my_table (code char(1), status smallint):
>
> --------------
> code | staus
> --------------
> 1 | 0
> A | 1
> 2 | 0
> --------------
>
> and execute the folowing select
>
> select * from my_table
> where cast(code as integer)=1
> and status=0
>
> it will work on fb 1.5 and fail on 2.5 (and 2.1)
>
> if you change the order of conditions to
>
> select * from my_table
> where status=0
> and cast(code as integer)=1
>
> than will work on 2.5 (and 2.1) and not on fb 1.5
>
> so I *guess* fb 1.5 tested conditions 'from last to first' and somewhere
> (2.0 ou 2.1) this changed to 'from first to last'

Please show us what results you get in each case.

Kjell
--
--------------------------------------
Kjell Rilbe
DataDIA AB
E-post: kjell@...
Telefon: 08-761 06 55
Mobil: 0733-44 24 64