[ 
https://issues.apache.org/jira/browse/TRAFODION-2970?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16411058#comment-16411058
 ] 

ASF GitHub Bot commented on TRAFODION-2970:
-------------------------------------------

GitHub user EEDY opened a pull request:

    https://github.com/apache/trafodion/pull/1495

    [TRAFODION-2970] COMMENT-ON bug fix : support single quote in comment string

    1. fix error when single quote in comment string
    2. add escape quote for DDL statement in SHOWDDL

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/EEDY/incubator-trafodion master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/trafodion/pull/1495.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1495
    
----
commit f2ed5d6fbe6ae89bb90866775c33faaad484df91
Author: eedy <cqlcqlc@...>
Date:   2018-03-23T06:08:31Z

    COMMENT-ON Bug fix : add escape quote support for single quote character in 
comment string.
    
    1. fix error when single quote in comment string
    2. add escape quote for SHOWDDL statement

commit 71cfab862f72d23818fc0d726add01c43ebf7d9b
Author: eedy <cqlcqlc@...>
Date:   2018-03-23T08:41:11Z

    COMMENT-ON Bug fix : add escape quote regression test
    
    1. add escape quote regression test

----


> Comment-On bug : failed to add comment when there is a single quote in 
> comment string
> -------------------------------------------------------------------------------------
>
>                 Key: TRAFODION-2970
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-2970
>             Project: Apache Trafodion
>          Issue Type: Bug
>          Components: sql-general
>    Affects Versions: 2.3
>            Reporter: Qilin Chen
>            Assignee: Qilin Chen
>            Priority: Minor
>
> SQL>comment on table json_test is 'table''s comment for ansi json support 
> test';
> *** ERROR[15005] Unmatched quote in input (unterminated string):
> insert into TRAFODION."_MD_".TEXT values (1802720017000399316, 3, 0, 0, 0, 
> 'table's comment for ansi json support test') ; [2018-02-26 18:02:46]
>  
> So quotes in string 'table''s comment for ansi json support test' is escaped 
> twice, because we have a Insert statement within Comment-On statement.
>  
> And statement below works fine:
> SQL>comment on table json_test is 'table''''s comment for ansi json support 
> test';
> --- SQL operation complete.
> SQL>showddl json_test;
> CREATE TABLE TRAFODION.JSON.JSON_TEST
>  (
>  K INT DEFAULT NULL NOT SERIALIZED
>  , J VARCHAR(200) CHARACTER SET ISO88591
>  COLLATE DEFAULT DEFAULT NULL NOT SERIALIZED
>  )
>  ATTRIBUTES ALIGNED FORMAT
> ;
> COMMENT ON TABLE TRAFODION.JSON.JSON_TEST IS 'table's comment for ansi json
>  support test' ;
> --- SQL operation complete.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to