trafodion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hzel...@apache.org
Subject [1/2] trafodion git commit: [TRAFODION-3109] comment can not transfer single quote normally in comment string
Date Tue, 19 Jun 2018 20:30:34 GMT
Repository: trafodion
Updated Branches:
  refs/heads/master 7aa5eec47 -> 7bd498cb3


[TRAFODION-3109] comment can not transfer single quote normally in comment string


Project: http://git-wip-us.apache.org/repos/asf/trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafodion/commit/ffb9416d
Tree: http://git-wip-us.apache.org/repos/asf/trafodion/tree/ffb9416d
Diff: http://git-wip-us.apache.org/repos/asf/trafodion/diff/ffb9416d

Branch: refs/heads/master
Commit: ffb9416dba18beceeae2ff40cc09e63d052395b7
Parents: 1ee3de7
Author: zlei929 <z_lei929@163.com>
Authored: Fri Jun 15 17:30:56 2018 +0800
Committer: zlei929 <z_lei929@163.com>
Committed: Fri Jun 15 17:30:58 2018 +0800

----------------------------------------------------------------------
 core/sql/sqlcomp/CmpSeabaseDDLcommentOn.cpp | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/ffb9416d/core/sql/sqlcomp/CmpSeabaseDDLcommentOn.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLcommentOn.cpp b/core/sql/sqlcomp/CmpSeabaseDDLcommentOn.cpp
index cc4b00e..411560d 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLcommentOn.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLcommentOn.cpp
@@ -354,16 +354,21 @@ void  CmpSeabaseDDL::doSeabaseCommentOn(StmtDDLCommentOn   *commentOnNode,
 
   if (comment.length() > 0)
     {
+		
+	  //'removeConsecutiveQuotes' was done at the beginning of lexical analysis.
+	  // so we should recovery it("'" ==> "''") in there to make insert successfully.
+      NAString quotedComment; 
+      ToQuotedString(quotedComment, comment, FALSE);
+
       //add or modify comment
       char query[2048];
-
       str_sprintf(query, "insert into %s.\"%s\".%s values (%ld, %d, %d, %d, 0, '%s') ; ",
               getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_TEXT,
               objUID, 
               textType, 
               subID, 
               0,
-              comment.data());
+              quotedComment.data());
       cliRC = cliInterface.executeImmediate(query);
       
       if (cliRC < 0)


Mime
View raw message