[ 
http://tracker.firebirdsql.org/browse/CORE-1812?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Philippe Makowski reopened CORE-1812:
-------------------------------------


Seems that we have a regression here with 2.5.1.26308
select * from t where col > 'now' - 7 ;
-- PLAN (T NATURAL)
-- PROBLEM


> Index is not used for some date/time expressions in dialect 1
> -------------------------------------------------------------
>
>                 Key: CORE-1812
>                 URL: http://tracker.firebirdsql.org/browse/CORE-1812
>             Project: Firebird Core
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 2.1 RC1, 2.1 RC2
>         Environment: Any
>            Reporter: Dmitry Yemanov
>            Assignee: Dmitry Yemanov
>             Fix For: 2.1.1,  2.5 Beta 1
>
>
> This is a regression introduced in v2.1 and it's caused by a more strict 
> checking for datatypes being compatible for an index scan. In dialect 1, 
> expression ('now' - <const>) has the datatype "double precision" which is now 
> considered incompatible with a timestamp. A workaround is to use CAST or the 
> explicit datatype prefix before 'now'. This issue affects other date/time 
> constants ('today', etc) as well.
> In case we'll intend to fix that issue, a possible solution would be to check 
> not only the descriptor datatype but also node flags (nod_date / nod_double). 
> This should allow better compatibility with the legacy dialect.
> Test case (database dialect 1):
> create table t (col timestamp) ;
> create index it on t (col) ;
> commit ;
> select * from t where col > timestamp 'now' - 7 ;
> -- PLAN (T INDEX (IT))
> -- OK
> select * from t where col > 'now' - 7 ;
> -- PLAN (T NATURAL)
> -- PROBLEM

-- 
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

        

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to