db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Manjula G Kutty <manjula.ku...@gmail.com>
Subject Re: Possible regression from 10.1 to 10.2
Date Fri, 27 Jan 2006 19:49:13 GMT
Manjula Kutty wrote:

> Hi Kathy,
>  
> Thanks for the valuable information.
>  
> --Manjula
>
>  
> On 1/27/06, *Kathey Marsden* <kmarsdenderby@sbcglobal.net 
> <mailto:kmarsdenderby@sbcglobal.net>> wrote:
>
>     Manjula G Kutty wrote:
>
>     >
>     > I'm seeing a difference in behaviour of derby from version 10.1
>     and 10.2.
>
>     I think this difference is ok.  See below
>
>     > ij> select id,date from inbox where id = true;
>     > ERROR 42X01: Syntax error: true.
>     > ij> select id from inbox where id = true;
>     > ERROR 42X01: Syntax error: true.
>     >
>     > This is the expected behaviour since the id colum is a bigint
>     >
>     [snip]
>
>     > But on 10.2 instead of giving me a syntax error the query returns
>     > rows..WHY?
>     >
>     The reason for the syntax error in 10.1  is not related to the column
>     being bigint. It is because  the type boolean  was not supported, so
>     specifying "where true"  or "where false"   was not legal.   In
>     10.2 we
>     added support for this type (DERBY-499).
>
>     In a where clause you always are going to have some boolean
>     expression,
>     but in 10.1 that had to be some expression  that evaluated to true or
>     false,   so if you wanted to specify "where true", you had to choose
>     some expression that was always true like "where 1=1"  or in this case
>     the less obvious "where 0<3".   For false in 10.1, you might choose
>     "where 1=0".
>
>     I don't think "where true"  adds much to to this query.  "select
>     id from
>     inbox" would also return all the rows.
>     "delete from inbox where true" would be a much more interesting
>     and some
>     days tempting prospect.
>
>     Kathey
>
>
>
Hi Kathy,

Can you please clarify me ,

then why
select id,date from inbox where id = true;
ID                  |DATE
-----------------------------------------------
21                  |2006-01-26 14:34:46.455

returns one row and

ij> select id,date from inbox where id = 0<3;
returns all rows in the table???

I think I'm confused now.

Thanks
Manjula



Mime
View raw message