You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by sa...@apache.org on 2017/01/04 23:06:47 UTC

[07/10] incubator-trafodion git commit: Fixed misc issues from review and testware issues

 Fixed misc issues from review and testware issues


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

Branch: refs/heads/master
Commit: 0b79c843a6f84900171fabd30bcf9270dff948e5
Parents: f364d03
Author: Sandhya Sundaresan <sa...@apache.org>
Authored: Wed Jan 4 02:08:33 2017 +0000
Committer: Sandhya Sundaresan <sa...@apache.org>
Committed: Wed Jan 4 02:08:33 2017 +0000

----------------------------------------------------------------------
 core/sql/cli/Cli.cpp                     |   2 -
 core/sql/clitest/blobtest.cpp            |   6 +-
 core/sql/exp/ExpLOB.cpp                  |  49 +----------
 core/sql/exp/ExpLOBaccess.cpp            |   3 +-
 core/sql/optimizer/SynthType.cpp         |   6 +-
 core/sql/regress/executor/EXPECTED015.SB |  14 ++--
 core/sql/regress/executor/EXPECTED130    | 116 +++++++++++++-------------
 core/sql/regress/executor/TEST130        |   8 +-
 8 files changed, 78 insertions(+), 126 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/0b79c843/core/sql/cli/Cli.cpp
----------------------------------------------------------------------
diff --git a/core/sql/cli/Cli.cpp b/core/sql/cli/Cli.cpp
index 58af2cf..92b7cf5 100644
--- a/core/sql/cli/Cli.cpp
+++ b/core/sql/cli/Cli.cpp
@@ -10139,8 +10139,6 @@ Lng32 SQLCLI_LOBcliInterface
                   *inoutDescSyskey = inDescSyskey;
               }
           }
-	//	else
-	//cliRC = -100;
 
 	Lng32 saveCliErr = cliRC;
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/0b79c843/core/sql/clitest/blobtest.cpp
----------------------------------------------------------------------
diff --git a/core/sql/clitest/blobtest.cpp b/core/sql/clitest/blobtest.cpp
index 2df98f2..28246c5 100644
--- a/core/sql/clitest/blobtest.cpp
+++ b/core/sql/clitest/blobtest.cpp
@@ -279,7 +279,7 @@ Int32 updateBufferToLobHandle(CliGlobals *cliglob,char *handle)
  
   char statusBuf[200] = {'\0'};
   Int32 statusBufLen = 0;
-  Int64 lobUpdateLen = 10;
+  Int64 lobUpdateLen = 50;
   char *lobDataBuf = new char[lobUpdateLen];
   memcpy(lobDataBuf, "zzzzzzzzzzzzzzzzzzzz",20);
   str_sprintf(query,"update lob (LOB '%s' , LOCATION %Ld, SIZE %Ld)", handle, (Int64)lobDataBuf, lobUpdateLen);
@@ -313,7 +313,7 @@ Int32 updateAppendBufferToLobHandle(CliGlobals *cliglob,char *handle)
  
   char statusBuf[200] = {'\0'};
   Int32 statusBufLen = 0;
-  Int64 lobUpdateLen = 10;
+  Int64 lobUpdateLen = 50;
   char *lobDataBuf = new char[lobUpdateLen];
   memcpy(lobDataBuf, "zzzzzzzzzzzzzzzzzzzz",20);
   str_sprintf(query,"update lob (LOB '%s' , LOCATION %Ld, SIZE %Ld,append )", handle, (Int64)lobDataBuf, lobUpdateLen);
@@ -348,7 +348,7 @@ Int32 updateTruncateLobHandle(CliGlobals *cliglob,char *handle)
  
   char statusBuf[200] = {'\0'};
   Int32 statusBufLen = 0;
-  Int64 lobUpdateLen = 10;
+  Int64 lobUpdateLen = 50;
   char *lobDataBuf = new char[lobUpdateLen];
   memcpy(lobDataBuf, "zzzzzzzzzzzzzzzzzzzz",20);
   str_sprintf(query,"update lob (LOB '%s' , empty_blob())", handle, (Int64)lobDataBuf, lobUpdateLen);

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/0b79c843/core/sql/exp/ExpLOB.cpp
----------------------------------------------------------------------
diff --git a/core/sql/exp/ExpLOB.cpp b/core/sql/exp/ExpLOB.cpp
index 85c0ad6..ac97b89 100644
--- a/core/sql/exp/ExpLOB.cpp
+++ b/core/sql/exp/ExpLOB.cpp
@@ -1356,54 +1356,7 @@ ex_expr::exp_return_type ExpLOBupdate::eval(char *op_data[],
       lobLen = 0;
       so = Lob_Memory;
     }
-  /*  if (fromEmpty())
-    {
-      // delete the lob and initialize with  a new lob handle
-     
-      rc = ExpLOBInterfaceDelete(getExeGlobals()->getExLobGlobal(), 
-                                 getLobHdfsServer(),
-                                 getLobHdfsPort(),
-                                 tgtLobName, 
-                                 lobStorageLocation(),
-                                 handleLen, 
-                                 lobHandle,
-                                 requestTag_,
-                                 getExeGlobals()->lobGlobals()->xnId(),
-                                 fromDescKey,
-                                 (lobOperStatus == CHECK_STATUS_ ? 1 : 0),
-                                 waitedOp
-                                 );
-      if (rc < 0)
-        {
-          Lng32 intParam1 = -rc;
-          ExRaiseSqlError(h, diagsArea, 
-                          (ExeErrorCode)(8442), NULL, &intParam1, 
-                          &cliError, NULL, (char*)"ExpLOBInterfaceUpdate",
-                          (char*)"ExpLOBInterfaceUpdate",getLobErrStr(intParam1));
-          return ex_expr::EXPR_ERROR;
-        }
-      //Initialize a fresh lob handle
-      char * lobHandle = NULL;
-      Lng32 handleLen = 0;
-      char lobHandleBuf[LOB_HANDLE_LEN];
-      Int64 descTS = NA_JulianTimestamp();
-
-      lobHandle = lobHandleBuf;
-      ExpLOBoper::genLOBhandle(objectUID_, lobNum(), (short)lobStorageType(),
-			       -1, descTS, -1,
-			       descSchNameLen_, descSchName(),
-			       handleLen, lobHandle);
-      // update lob handle with the returned values
-      str_cpy_all(result, lobHandle, handleLen);
-      //     str_cpy_all(result, op_data[2], handleLen);
-      //     ExpLOBoper::updLOBhandle(sDescSyskey, 0, result); 
-      getOperand(0)->setVarLength(handleLen, op_data[-MAX_OPERANDS]);
-
-      return ex_expr::EXPR_OK;                     
-                                 
-    }
-
-    else*/ if (isAppend() && !fromEmpty())
+   if (isAppend() && !fromEmpty())
     {
       rc = ExpLOBInterfaceUpdateAppend
 	(getExeGlobals()->getExLobGlobal(), 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/0b79c843/core/sql/exp/ExpLOBaccess.cpp
----------------------------------------------------------------------
diff --git a/core/sql/exp/ExpLOBaccess.cpp b/core/sql/exp/ExpLOBaccess.cpp
index 42fb6f0..0788382 100644
--- a/core/sql/exp/ExpLOBaccess.cpp
+++ b/core/sql/exp/ExpLOBaccess.cpp
@@ -1534,7 +1534,8 @@ Ex_Lob_Error ExLob::allocateDesc(ULng32 size, Int64 &descNum, Int64 &dataOffset,
                   NADELETEBASIC(saveLobDataFile,getLobGlobalHeap());
                   return LOB_DATA_FILE_WRITE_ERROR;
                 }
-            return LOB_DATA_FILE_OPEN_ERROR;
+               NADELETEBASIC(saveLobDataFile,getLobGlobalHeap());
+               return LOB_DATA_FILE_OPEN_ERROR;
             
           }
         else

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/0b79c843/core/sql/optimizer/SynthType.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/SynthType.cpp b/core/sql/optimizer/SynthType.cpp
index 89fb800..474a537 100644
--- a/core/sql/optimizer/SynthType.cpp
+++ b/core/sql/optimizer/SynthType.cpp
@@ -6712,7 +6712,7 @@ const NAType *LOBinsert::synthesizeType()
       (obj_ == EXTERNAL_) ||
       (obj_ == LOAD_))
     {
-      if (typ1->getTypeQualifier() != NA_CHARACTER_TYPE)
+      if (typ1 && typ1->getTypeQualifier() != NA_CHARACTER_TYPE)
 	{
 	  // 4221 The operand of a $0~String0 function must be character.
 	  *CmpCommon::diags() << DgSqlCode(-4221) << DgString0("LOBINSERT")
@@ -6722,7 +6722,7 @@ const NAType *LOBinsert::synthesizeType()
     }
   else if (obj_ == LOB_)
     {
-      if (typ1->getTypeQualifier() != NA_LOB_TYPE)
+      if (typ1 && typ1->getTypeQualifier() != NA_LOB_TYPE)
 	{
 	  // 4043 The operand of a $0~String0 function must be blob
 	  *CmpCommon::diags() << DgSqlCode(-4221) << DgString0("LOBINSERT")
@@ -6732,7 +6732,7 @@ const NAType *LOBinsert::synthesizeType()
     }
   else if (obj_ == BUFFER_)
     {
-     if (typ1->getTypeQualifier() != NA_NUMERIC_TYPE)
+     if (typ1 && typ1->getTypeQualifier() != NA_NUMERIC_TYPE)
 	{
 	  // 4043 The operand of a $0~String0 function must be blob
 	  *CmpCommon::diags() << DgSqlCode(-4221) << DgString0("LOBINSERT")

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/0b79c843/core/sql/regress/executor/EXPECTED015.SB
----------------------------------------------------------------------
diff --git a/core/sql/regress/executor/EXPECTED015.SB b/core/sql/regress/executor/EXPECTED015.SB
index 15e3d87..e3c1767 100755
--- a/core/sql/regress/executor/EXPECTED015.SB
+++ b/core/sql/regress/executor/EXPECTED015.SB
@@ -2052,15 +2052,15 @@ A                     B            C            D            E
 >>execute xx2;
 
 --- 2 row(s) inserted.
->>select * from t015t16 order by a;
+>>select a,b from t015t16 order by a;
 
-A                     B            C            D            E          
---------------------  -----------  -----------  -----------  -----------
+A                     B          
+--------------------  -----------
 
-                   1            2           30           40           50
-                   3            4            1            1            1
-                   6            7           81           91          101
-                  10           11           12           13           14
+                   1            2
+                   3            4
+                   6            7
+                  10           11
 
 --- 4 row(s) selected.
 >>