Uploaded image for project: 'Apache Trafodion (Retired)'
  1. Apache Trafodion (Retired)
  2. TRAFODION-3088

Multi-value BETWEEN on interval key column gives wrong result

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3
    • 2.3
    • sql-cmp
    • None

    Description

      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.

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

      Attachments

        Issue Links

          Activity

            People

              dbirdsall Dave Birdsall
              dbirdsall Dave Birdsall
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: