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/04/05 16:13:41 UTC

[jira] [Created] (TRAFODION-2576) Incremental UPDATE STATS fails on long varchar values

David Wayne Birdsall created TRAFODION-2576:
-----------------------------------------------

             Summary: Incremental UPDATE STATS fails on long varchar values
                 Key: TRAFODION-2576
                 URL: https://issues.apache.org/jira/browse/TRAFODION-2576
             Project: Apache Trafodion
          Issue Type: Bug
          Components: sql-cmp
         Environment: All
            Reporter: David Wayne Birdsall
            Assignee: David Wayne Birdsall


The following test script demonstrates the problem:

-- This script creates a table with varchar values longer than 256 characters.
-- It tnen demonstrates issues with incremental stats on such values.

?section setup

drop table if exists testbigcol;

create table testbigcol
  ( a int not null,
    b varchar(500),
    primary key (a) )
salt using 4 partitions;

insert into testbigcol values (1,'axq'),(2,'bxw');

insert into testbigcol select x.a + 2 * y.a, x.b || y.b from testbigcol x cross join testbigcol y;

insert into testbigcol select x.a + 6 * y.a, x.b || y.b from testbigcol x cross join testbigcol y;

insert into testbigcol select x.a + 42 * y.a, x.b || y.b from testbigcol x cross join testbigcol y;

--                              0         1         2         3         4         5
--                              012345678901234567890123456789012345678901234567890123
update testbigcol set b = b || ' and now for something completely different 0123456789'
  where mod(a,2) = 1;

update testbigcol set b = b || ' that was fun, and now for something completely different 0123456789'
  where mod(a,3) = 1;

update testbigcol set b = b || ' and then there was a great hue and cry and now for something completely different 0123456789'
  where mod(a,5) = 1;

update testbigcol set b = b || ' and we can do all sorts of things to make these strings longer, and now for something completely different 0123456789'
  where mod(a,7) = 1;

?section testit

update statistics for table testbigcol on every column sample random 100 percent persistent;

showstats for table testbigcol on existing columns detail;

update testbigcol set b = 'c' || b where a > 1700;

update statistics for table testbigcol on existing columns incremental where a > 1700;

showstats for table testbigcol on existing columns detail;

When run, the last UPDATE STATISTICS command fails as follows:

>>update statistics for table testbigcol on existing columns incremental where a > 1700;

*** ERROR[9200] UPDATE STATISTICS for table TRAFODION.SEABASE.TESTBIGCOL encountered an error (8402) from statement IUS data set I creation.

*** ERROR[8402] A string overflow occurred during the evaluation of a character expression. Conversion of Source Type:VARCHAR(REC_BYTE_V_ASCII,290 BYTES,ISO88591) Source Value:caxqbxwbxwaxqaxqbxwbxwbxw and now for something completely different 0123456789 and then there was a great hue and cry and now for something completely different 0123456789 and we can do all sorts of to Target Type:VARCHAR(REC_BYTE_V_ASCII,256 BYTES,ISO88591).

--- SQL operation failed with errors.




--
This message was sent by Atlassian JIRA
(v6.3.15#6346)