trafodion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hzel...@apache.org
Subject [8/9] incubator-trafodion git commit: change more for jira 1720 comments
Date Mon, 01 Feb 2016 21:49:40 GMT
change more for jira 1720 comments


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

Branch: refs/heads/master
Commit: e6e88d0628979982f02d54c094156cf34f19c7a1
Parents: 63ef4bd
Author: Liu Ming <ming.liu@esgyn.cn>
Authored: Fri Jan 29 14:36:11 2016 +0000
Committer: Liu Ming <ming.liu@esgyn.cn>
Committed: Fri Jan 29 14:36:11 2016 +0000

----------------------------------------------------------------------
 core/sql/common/csconvert.cpp     | 4 +++-
 core/sql/exp/exp_conv.cpp         | 2 +-
 core/sql/generator/GenRelScan.cpp | 6 +-----
 3 files changed, 5 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/e6e88d06/core/sql/common/csconvert.cpp
----------------------------------------------------------------------
diff --git a/core/sql/common/csconvert.cpp b/core/sql/common/csconvert.cpp
index fc4263d..b4bdaac 100644
--- a/core/sql/common/csconvert.cpp
+++ b/core/sql/common/csconvert.cpp
@@ -1315,8 +1315,10 @@ int gbkToUtf8(char* gbkString, size_t gbklen,
    
    if ( addNullAtEnd )
    {
-     if(originalOutlen >= finalLength )
+     if(originalOutlen > finalLength )
        result[finalLength] = 0;
+     else
+       return -1;
    }
 
    return finalLength;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/e6e88d06/core/sql/exp/exp_conv.cpp
----------------------------------------------------------------------
diff --git a/core/sql/exp/exp_conv.cpp b/core/sql/exp/exp_conv.cpp
index 36f9a30..3a488fe 100644
--- a/core/sql/exp/exp_conv.cpp
+++ b/core/sql/exp/exp_conv.cpp
@@ -9327,7 +9327,7 @@ convDoIt(char * source,
   {
     int copyLen = 0;
     int convLen = gbkToUtf8( source, sourceLen, target, targetLen);
-    if (convLen > 0) {
+    if (convLen >= 0) {
       copyLen = convLen; 
       if ( varCharLen )
         setVCLength(varCharLen, varCharLenSize, copyLen);

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/e6e88d06/core/sql/generator/GenRelScan.cpp
----------------------------------------------------------------------
diff --git a/core/sql/generator/GenRelScan.cpp b/core/sql/generator/GenRelScan.cpp
index 7729b13..eaf46f6 100644
--- a/core/sql/generator/GenRelScan.cpp
+++ b/core/sql/generator/GenRelScan.cpp
@@ -216,7 +216,7 @@ int HbaseAccess::createAsciiColAndCastExpr(Generator * generator,
     }
 
   if (newGivenType->getTypeQualifier() == NA_CHARACTER_TYPE &&
-      CmpCommon::getDefaultString(HIVE_FILE_CHARSET) == "GBK")
+      (CmpCommon::getDefaultString(HIVE_FILE_CHARSET) == "GBK" || CmpCommon::getDefaultString(HIVE_FILE_CHARSET)
== "gbk") && CmpCommon::getDefaultString(HIVE_DEFAULT_CHARSET) == "UTF8" )
         needTranslate = TRUE;
 
   // source ascii row is a varchar where the data is a pointer to the source data
@@ -798,7 +798,6 @@ short FileScan::codeGenForHive(Generator * generator)
   const Int32 executorPredTuppIndex = 3;
   const Int32 asciiTuppIndex = 4;
   ULng32 asciiRowLen; 
-  ULng32 translateRowLen; 
   ExpTupleDesc * asciiTupleDesc = 0;
 
   ex_cri_desc * work_cri_desc = NULL;
@@ -808,7 +807,6 @@ short FileScan::codeGenForHive(Generator * generator)
   ExpTupleDesc::TupleDataFormat asciiRowFormat = ExpTupleDesc::SQLARK_EXPLODED_FORMAT;
   ExpTupleDesc::TupleDataFormat hdfsRowFormat = ExpTupleDesc::SQLMX_ALIGNED_FORMAT;
   ValueIdList asciiVids;
-  ValueIdList transVids;
   ValueIdList executorPredCastVids;
   ValueIdList projectExprOnlyCastVids;
 
@@ -1515,7 +1513,6 @@ short HbaseAccess::genRowIdExpr(Generator * generator,
 	  int res;
 	  ItemExpr * castVal = NULL;
 	  ItemExpr * asciiVal = NULL;
-	  ItemExpr * transVal = NULL;
 	  res = createAsciiColAndCastExpr(generator,
 					  givenType,
 					  asciiVal, castVal);
@@ -1611,7 +1608,6 @@ short HbaseAccess::genRowIdExprForNonSQ(Generator * generator,
 	  int res;
 	  ItemExpr * castVal = NULL;
 	  ItemExpr * asciiVal = NULL;
-	  ItemExpr * transVal = NULL;
 	  res = createAsciiColAndCastExpr(generator,
 					  givenType,
 					  asciiVal, castVal);


Mime
View raw message