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

Subquery with [first 1] in select list results in Normalizer internal error

    XMLWordPrintableJSON

Details

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

    Description

      The following script illustrates the error:

      ?section setup

      CREATE TABLE subquery_table
      (
      x int no default not null,
      y int,
      primary key ( x )
      );

      CREATE TABLE main_table
      (
      a int no default not null,
      b int,
      primary key (a)
      );

      ?section testit

      prepare s1 from
      select
      (select [FIRST 1] y aa from subquery_table b where b.x = a.b) as company_id
      from main_table a;

      ?section testit2

      prepare s1 from
      select
      (select y aa from subquery_table b where b.x = a.b) as company_id
      from main_table a;

      If we run section setup to create the tables, then run section testit, the prepare fails with this error:

          • ERROR[2006] Internal error: assertion failure (CmpCommon::getDefault(COMP_BOOL_137) == DF_ON) in file ../optimizer/NormItemExpr.cpp at line 6028.

      The second query, in section testit2, on the other hand compiles and executes just fine.

       

      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: