[ http://tracker.firebirdsql.org/browse/CORE-3355?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Philippe Makowski reopened CORE-3355: ------------------------------------- seems that it is not fixed in 2.1.4 and in 2.5.0 see : SQL> create table tdate (id integer not null primary key, val date); SQL> create index tdateix1 on tdate (val); SQL> commit; SQL> insert into tdate values (0, '1997-12-31'); SQL> insert into tdate values (1, '1998-01-01'); SQL> insert into tdate values (2, '1998-01-02'); SQL> insert into tdate values (3, '1998-01-03'); SQL> insert into tdate values (4, '1998-01-04'); SQL> insert into tdate values (5, '1998-01-05'); SQL> commit; SQL> select count(*) from tdate where val >= timestamp'1998-01-04 12:00:00.0000'; COUNT ============ 1 SQL> select count(*) from tdate where val < timestamp'1998-01-04 12:00:00.0000'; COUNT ============ 4 SQL> drop index tdateix1; SQL> commit; SQL> select count(*) from tdate where val >= timestamp'1998-01-04 12:00:00.0000'; COUNT ============ 1 SQL> select count(*) from tdate where val < timestamp'1998-01-04 12:00:00.0000'; COUNT ============ 5 > Wrong comparsion of DATE and TIMESTAMP if index is used > ------------------------------------------------------- > > Key: CORE-3355 > URL: http://tracker.firebirdsql.org/browse/CORE-3355 > Project: Firebird Core > Issue Type: Bug > Components: Engine > Affects Versions: 2.1.3, 3.0 Initial, 2.0.6, 2.5.0 > Environment: Any > Reporter: Dimitry Sibiryakov > Assignee: Dmitry Yemanov > Fix For: 2.5.1, 3.0 Alpha 1, 2.1.4 > > > Folowing script gives result 1 and 4 while it should be 1 and 5: > create table tdate (id integer not null primary key, val date); > create index tdateix1 on tdate (val); > commit; > insert into tdate values (0, '1997-12-31'); > insert into tdate values (1, '1998-01-01'); > insert into tdate values (2, '1998-01-02'); > insert into tdate values (3, '1998-01-03'); > insert into tdate values (4, '1998-01-04'); > insert into tdate values (5, '1998-01-05'); > commit; > select count(*) from tdate where val >= timestamp'1998-01-04 12:00:00.0000'; > select count(*) from tdate where val < timestamp'1998-01-04 12:00:00.0000'; -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://tracker.firebirdsql.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira ------------------------------------------------------------------------------ WhatsUp Gold - Download Free Network Management Software The most intuitive, comprehensive, and cost-effective network management toolset available today. Delivers lowest initial acquisition cost and overall TCO of any competing solution. http://p.sf.net/sfu/whatsupgold-sd Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel