Hi ,
I'm seeing a difference in behaviour of derby from version 10.1 and
10.2. Looks like it is regression. But no idea about the reason.The
schema I have used is
CREATE TABLE inbox (id bigint generated always as identity (start with
1,increment by 1),
date timestamp,
CONSTRAINT inbox__pk PRIMARY KEY (id));
With 10.1.2
------------------------
ij> select id,date from inbox where id = 0<3;
ID |DATE
-----------------------------------------------
14 |2006-01-26 22:48:47.42
18 |2006-01-26 22:49:47.697
12 |2006-01-26 22:48:19.941
13 |2006-01-26 22:48:22.745
15 |2006-01-26 22:48:58.566
16 |2006-01-26 22:49:10.003
17 |2006-01-26 22:49:21.499
19 |2006-01-26 22:49:51.522
20 |2006-01-26 22:49:55.608
21 |2006-01-26 22:49:59.223
22 |2006-01-26 22:50:03.53
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
with 10.2.
--------------------------------------------------
ij> select id,date from inbox where id = 0<3;
ID |DATE
-----------------------------------------------
25 |2006-01-26 14:35:46.584
34 |2006-01-26 14:36:16.588
21 |2006-01-26 14:34:46.455
22 |2006-01-26 14:34:47.176
27 |2006-01-26 14:35:47.054
24 |2006-01-26 14:35:16.58
28 |2006-01-26 14:35:47.305
35 |2006-01-26 14:36:18.771
31 |2006-01-26 14:35:48.496
32 |2006-01-26 14:35:48.887
33 |2006-01-26 14:35:49.308
11 rows selected
ij> select id,date from inbox where id = true;
ID |DATE
-----------------------------------------------
21 |2006-01-26 14:34:46.455
1 row selected
ij> select id from inbox where id = true;
ID
--------------------
21
But on 10.2 instead of giving me a syntax error the query returns rows..WHY?
Also one more question on both versions the followig query passes
ij> select id,date from inbox where id = 0<3;
How can id(bigint column) can be compared against a boolean expression?
Can any one please clear my doubts?
Thanks
Manjula