You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by li...@apache.org on 2018/02/05 13:34:28 UTC

[1/3] trafodion git commit: [TRAFODION-2951] group_concat on utf8 column with chinese character get messy code

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 <ov...@sina.com>
Authored: Sat Feb 3 10:09:27 2018 +0000
Committer: Liu Ming <ov...@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);
 }
 
 // -----------------------------------------------------------------------


[2/3] trafodion git commit: add regression test

Posted by li...@apache.org.
add regression test


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

Branch: refs/heads/master
Commit: 3c963796066d13a2a55bb6a8fe903d82b5ea49da
Parents: c7039b9
Author: Liu Ming <ov...@sina.com>
Authored: Sat Feb 3 11:12:02 2018 +0000
Committer: Liu Ming <ov...@sina.com>
Committed: Sat Feb 3 11:12:02 2018 +0000

----------------------------------------------------------------------
 core/sql/regress/executor/EXPECTED002.SB | 21 ++++++++++++++++++---
 core/sql/regress/executor/TEST002        |  3 +++
 2 files changed, 21 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/3c963796/core/sql/regress/executor/EXPECTED002.SB
----------------------------------------------------------------------
diff --git a/core/sql/regress/executor/EXPECTED002.SB b/core/sql/regress/executor/EXPECTED002.SB
index c6fe1bf..d4742cb 100644
--- a/core/sql/regress/executor/EXPECTED002.SB
+++ b/core/sql/regress/executor/EXPECTED002.SB
@@ -6670,6 +6670,9 @@ A            B            C            E
 >>insert into student values('s2', 58);
 
 --- 1 row(s) inserted.
+>>insert into student values('学生三',79);
+
+--- 1 row(s) inserted.
 >>
 >>SELECT student_name,
 +>          GROUP_CONCAT(DISTINCT test_score
@@ -6683,8 +6686,9 @@ STUDENT_NAME  (EXPR)
 s1            40-50-60-79-88-100-101                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
                                          
 s2            18-58-88-188                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
                                          
 s3            40-90-100                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
                                          
+学生三     79                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
 
---- 3 row(s) selected.
+--- 4 row(s) selected.
 >>
 >>SELECT student_name,
 +>          GROUP_CONCAT(test_score
@@ -6698,8 +6702,18 @@ STUDENT_NAME  (EXPR)
 s1            40-50-60-79-88-88-100-101                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
                                          
 s2            18-58-88-88-188                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
                                          
 s3            40-40-90-100                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
                                          
+学生三     79                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
 
---- 3 row(s) selected.
+--- 4 row(s) selected.
+>>
+>>SELECT GROUP_CONCAT(student_name) from student;
+
+(EXPR)
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 ---------------------------
+
+s1        ,s1        ,s2        ,s3        ,s1        ,s1        ,s1        ,s1        ,s1        ,s1        ,s3        ,s3        ,s3        ,s2        ,s2        ,s2        ,s2        ,学生三                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
+
+--- 1 row(s) selected.
 >>
 >>cqd ATTEMPT_ESP_PARALLELISM 'ON';
 
@@ -6737,8 +6751,9 @@ STUDENT_NAME  (EXPR)
 s1            101-100-88-79-60-50-40                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
                                          
 s2            188-88-58-18                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
                                          
 s3            100-90-40                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
                                          
+学生三     79                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
 
---- 3 row(s) selected.
+--- 4 row(s) selected.
 >>control query shape cut;
 
 --- SQL operation complete.

http://git-wip-us.apache.org/repos/asf/trafodion/blob/3c963796/core/sql/regress/executor/TEST002
----------------------------------------------------------------------
diff --git a/core/sql/regress/executor/TEST002 b/core/sql/regress/executor/TEST002
index 07a4122..22cec00 100755
--- a/core/sql/regress/executor/TEST002
+++ b/core/sql/regress/executor/TEST002
@@ -1137,6 +1137,7 @@ insert into student values('s2', 88);
 insert into student values('s2', 188);
 insert into student values('s2', 18);
 insert into student values('s2', 58);
+insert into student values('学生三',79);
 
 SELECT student_name,
           GROUP_CONCAT(DISTINCT test_score
@@ -1150,6 +1151,8 @@ SELECT student_name,
           FROM student
           GROUP BY student_name order by student_name;
 
+SELECT GROUP_CONCAT(student_name) from student;
+
 cqd ATTEMPT_ESP_PARALLELISM 'ON';
 control query shape exchange(cut);
 prepare s1 from SELECT student_name,


[3/3] trafodion git commit: [TRAFODION-2951] group_concat on utf8 column with chinese character get messy code

Posted by li...@apache.org.
[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/03fd1613
Tree: http://git-wip-us.apache.org/repos/asf/trafodion/tree/03fd1613
Diff: http://git-wip-us.apache.org/repos/asf/trafodion/diff/03fd1613

Branch: refs/heads/master
Commit: 03fd16139769f97c1e5373f6cf62e2378ed546cc
Parents: d80f009 3c96379
Author: Liu Ming <ov...@sina.com>
Authored: Mon Feb 5 08:20:50 2018 +0000
Committer: Liu Ming <ov...@sina.com>
Committed: Mon Feb 5 08:20:50 2018 +0000

----------------------------------------------------------------------
 core/sql/optimizer/SynthType.cpp         | 11 ++++++++++-
 core/sql/regress/executor/EXPECTED002.SB | 21 ++++++++++++++++++---
 core/sql/regress/executor/TEST002        |  3 +++
 3 files changed, 31 insertions(+), 4 deletions(-)
----------------------------------------------------------------------