You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafodion.apache.org by "Alice Chen (JIRA)" <ji...@apache.org> on 2015/07/22 20:15:47 UTC

[jira] [Created] (TRAFODION-363) LP Bug: 1328254 - SQL: explain options 'm' fails with error 8690 (invalid char in TRANSLATE function)

Alice Chen created TRAFODION-363:
------------------------------------

             Summary: LP Bug: 1328254 - SQL: explain options 'm' fails with error 8690 (invalid char in TRANSLATE function)
                 Key: TRAFODION-363
                 URL: https://issues.apache.org/jira/browse/TRAFODION-363
             Project: Apache Trafodion
          Issue Type: Bug
          Components: sql-exe
            Reporter: Apache Trafodion
            Assignee: Apache Trafodion


The Explain options 'm' query uses an internal table which was created and populated during the 'prepare' query.   That internal table has a column named DESCRIPTION which, in this case, is of type VARCHAR(3000 BYTES) CHARACTER SET UTF8. The actual size of the column is controllable via the cqd named EXPLAIN_DESCRIPTION_COLUMN_SIZE but, in this case, this cqd was set to 3000.  The contents of the column is a description of the Query Plan that was generated during the 'prepare' statement.  If the generated description is  longer than 3000 bytes, the description is truncated to fit in the 3000 byte limit.   For this particular case, the 'prepare' statement was working with a query that involved tables with UCS2 columns and, consequently, the plan DESCRIPTION column contained a few non-ASCII, but valid UTF8 characters
that were each 3 bytes in length.   Unfortunately, one of those UTF8 characters happened to be right at the end of the 3000 bytes.  When the
truncation was done, the last two bytes of that 3-byte UTF8 character were changed to '*' and '\0', but the first byte of that character was left untouched.   

When the Explain options 'm' is requested, there is a TRANSLATE function performed on the contents of the DESCRIPTION column to get the contents translated from UTF8 to UCS2.   When the TRANSLATE function came across the truncated UTF8 character, it recognized that the character was not a valid 3-byte UTF8 character and correctly reported the 8690 error.

The proper solution to this problem is to change the truncation logic to ensure that it never truncates in the middle of a UTF8 character.
Assigned to LaunchPad User James Capps



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)