[ 
https://issues.apache.org/jira/browse/TRAFODION-3088?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16494213#comment-16494213
 ] 

ASF GitHub Bot commented on TRAFODION-3088:
-------------------------------------------

GitHub user DaveBirdsall opened a pull request:

    https://github.com/apache/trafodion/pull/1584

    [TRAFODION-3088] Fix data conversion issue with INTERVAL literals

    ValueIdList::convertToTextKey (optimizer/ValueDesc.cpp) in some cases was 
encountering INTERVAL literal values containing the text "INTERVAL ... < 
qualifier >". The code expects this text to be there in some code paths but not 
all. With this change, I've taken care of the remaining code paths. So we 
should no longer see data conversion errors in the cases noted in the JIRA.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/DaveBirdsall/trafodion Trafodion3088

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/trafodion/pull/1584.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1584
    
----
commit 3662b90c7a51513a6f5cf0bd31943fbf4c996cfe
Author: Dave Birdsall <dbirdsall@...>
Date:   2018-05-29T20:32:37Z

    [TRAFODION-3088] Fix data conversion issue with INTERVAL literals

----


> Multi-value BETWEEN on interval key column gives wrong result
> -------------------------------------------------------------
>
>                 Key: TRAFODION-3088
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-3088
>             Project: Apache Trafodion
>          Issue Type: Bug
>          Components: sql-cmp
>    Affects Versions: 2.3
>            Reporter: David Wayne Birdsall
>            Assignee: David Wayne Birdsall
>            Priority: Major
>
> The sqlci session below demonstrates the problem. When we do a multi-column 
> BETWEEN where one of the columns is an INTERVAL key column and the values in 
> the BETWEEN predicate for that column are equal, we get a data conversion 
> error.
> {quote}>>obey jira.sql;
> >>?section setup
> >>
> >>drop table if exists t1;
> --- SQL operation complete.
> >>
> >>create table t1 ( a interval second not null,
> +> b int,
> +> primary key (a) );
> --- SQL operation complete.
> >>
> >>insert into table t1 values ( interval '41' second, 41 );
> --- 1 row(s) inserted.
> >>
> >>?section testit
> >>
> >>select * from t1;
> A B 
> ---------- -----------
> 41.000000 41
> --- 1 row(s) selected.
> >>
> >>select * from t1 where a = interval '41' second;
> A B 
> ---------- -----------
> 41.000000 41
> --- 1 row(s) selected.
> >>
> >>-- fails with a data conversion error
> >>select * from t1 where (a,b) between 
> +> (interval '41' second, 40) and (interval '41' second, 42);
> *** ERROR[8413] The string argument contains characters that cannot be 
> converted. Source data(in hex): 494e
> --- 0 row(s) selected.
> >>
> >>select * from t1 where a = interval '41' second
> +> and b between 40 and 42;
> A B 
> ---------- -----------
> 41.000000 41
> --- 1 row(s) selected.
> >>
> >>log;
> {quote}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to