Repository: trafodion
Updated Branches:
  refs/heads/master d80f009eb -> 03fd16139


[TRAFODION-2951] group_concat on utf8 column with chinese character get messy 
code


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

Branch: refs/heads/master
Commit: c7039b920846ba084f8404ba48ea5c8ab2dd3dc5
Parents: 6d38e58
Author: Liu Ming <ovis_p...@sina.com>
Authored: Sat Feb 3 10:09:27 2018 +0000
Committer: Liu Ming <ovis_p...@sina.com>
Committed: Sat Feb 3 10:09:27 2018 +0000

----------------------------------------------------------------------
 core/sql/optimizer/SynthType.cpp | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/c7039b92/core/sql/optimizer/SynthType.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/SynthType.cpp b/core/sql/optimizer/SynthType.cpp
index 5494472..a0f9042 100644
--- a/core/sql/optimizer/SynthType.cpp
+++ b/core/sql/optimizer/SynthType.cpp
@@ -1762,7 +1762,16 @@ const NAType *AggrGrouping::synthesizeType()
 // -----------------------------------------------------------------------
 const NAType *PivotGroup::synthesizeType()
 {
-  return new HEAP SQLVarChar(HEAP, maxLen_, TRUE);
+  //for Character type, need to consider the charset
+  //the output charset should be same as input child 0
+  const NAType &operand = child(0)->getValueId().getType();
+  if(operand.getTypeQualifier() == NA_CHARACTER_TYPE)
+  {
+    CharType & origType = (CharType &) operand;
+    return new HEAP SQLVarChar(HEAP, maxLen_, TRUE, origType.isUpshifted(), 
FALSE, operand.getCharSet());
+  }
+  else
+    return new HEAP SQLVarChar(HEAP, maxLen_, TRUE);
 }
 
 // -----------------------------------------------------------------------

Reply via email to