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

INTERVAL SECOND(m,n) in multi-column key results in 6003 warnings

    XMLWordPrintableJSON

Details

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

    Description

      The following script reproduces the problem:

      drop table if exists tproblem;

      create table tproblem (a interval second(2,6) not null, b int not null, c int,
      primary key (a,b));

      insert into tproblem values (interval '12.345678' second(2,6),7,7),
      (interval '23.456789' second(2,6),8,8);

      update statistics for table tproblem on every column;

      – give RMS a little time to invalidate cached stats for tproblem
      sh sleep 20;

      select * from tproblem where b = 8;

      When run, the select statement gets a 6003 warning:

      >>select * from tproblem where b = 8;

          • WARNING[6003] The metadata table HISTOGRAM_INTERVALS contains invalid boundary value (INTERVAL '12.345678' SECOND(2, 6),7) for column TRAFODION.SCH.TPROBLEM.A. If you have manually modified the metadata table, then you should undo your changes using the CLEAR option in UPDATE STATISTICS and regenerate the statistics.

      A B C
      ---------- ----------- -----------

      23.456789 8 8

      — 1 row(s) selected.
      >>

      The warning happens because EncodedValue::constructorFunction (optimizer/EncodedValue.cpp) is not handling the INTERVAL literal in the histogram intervals correctly.

       

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: