You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafodion.apache.org by "David Wayne Birdsall (JIRA)" <ji...@apache.org> on 2017/09/19 22:13:00 UTC

[jira] [Created] (TRAFODION-2749) UPDATE STATS mc histogram failure when column has reserved word name

David Wayne Birdsall created TRAFODION-2749:
-----------------------------------------------

             Summary: UPDATE STATS mc histogram failure when column has reserved word name
                 Key: TRAFODION-2749
                 URL: https://issues.apache.org/jira/browse/TRAFODION-2749
             Project: Apache Trafodion
          Issue Type: Bug
          Components: sql-cmp
    Affects Versions: 2.3-incubating
         Environment: All
            Reporter: David Wayne Birdsall
            Assignee: David Wayne Birdsall


When UPDATE STATISTICS tries to create a multi-column histogram, and one or more of the columns has a name which happens to be a SQL reserved word, the command fails with a syntax error on an internal statement.

The following script reproduces the problem (here, the failure occurs when UPDATE STATS tries to create a multi-column histogram on the two key columns):

?section setup

create table ExampleTable 
( a smallint not null,
  "YEAR" smallint not null,
  primary key (a, "YEAR") );

insert into ExampleTable values (1,1996),(2,1997),(3,1998);

?section doit

update statistics for table ExampleTable on every column;

Below is the execution output:

>>obey repro.sql;
>>?section setup
>>
>>create table ExampleTable 
+>( a smallint not null,
+>  "YEAR" smallint not null,
+>  primary key (a, "YEAR") );

--- SQL operation complete.
>>
>>insert into ExampleTable values (1,1996),(2,1997),(3,1998);

--- 3 row(s) inserted.
>>
>>?section doit
>>
>>update statistics for table ExampleTable on every column;

*** ERROR[9200] UPDATE STATISTICS for table TRAFODION.SCH.EXAMPLETABLE encountered an error (15001) from statement FETCH_BOUNDARY_ROWSET.

*** ERROR[15001] A syntax error occurred at or before: 
SELECT FMTVAL, SUMVAL FROM (SELECT "A","YEAR", _ucs2'unused', COUNT(*) FROM TRA
FODION.SCH.EXAMPLETABLE <<+ cardinality 3.000000e+00 >>  GROUP BY A, YEAR FOR R
EAD UNCOMMITTED ACCESS) T(A, YEAR, FMTVAL, SUMVAL);
   ^ (162 characters from start of SQL statement)

*** ERROR[8822] The statement was not prepared.

--- SQL operation failed with errors.
>>
>>





--
This message was sent by Atlassian JIRA
(v6.4.14#64029)