trafodion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sand...@apache.org
Subject [09/13] incubator-trafodion git commit: Additional fixes to deal with new Ansi blob datatype.
Date Fri, 08 Jan 2016 19:11:34 GMT
Additional fixes to deal with new Ansi blob datatype.


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

Branch: refs/heads/master
Commit: fd80e81f0435c091ee7f1e6a7bce320028abed03
Parents: 3fcf188
Author: Sandhya Sundaresan <sandhya@apache.org>
Authored: Tue Jan 5 18:04:41 2016 +0000
Committer: Sandhya Sundaresan <sandhya@apache.org>
Committed: Tue Jan 5 18:04:41 2016 +0000

----------------------------------------------------------------------
 core/sql/clitest/blobtest.cpp       |  2 +-
 core/sql/executor/ExExeUtilCli.cpp  |  5 ++++-
 core/sql/executor/ExExeUtilLoad.cpp |  3 ++-
 core/sql/parser/sqlparser.y         | 13 +++++++++++++
 4 files changed, 20 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/fd80e81f/core/sql/clitest/blobtest.cpp
----------------------------------------------------------------------
diff --git a/core/sql/clitest/blobtest.cpp b/core/sql/clitest/blobtest.cpp
index 44570b0..d92674f 100644
--- a/core/sql/clitest/blobtest.cpp
+++ b/core/sql/clitest/blobtest.cpp
@@ -53,7 +53,7 @@ Int32 extractLobToBuffer(CliGlobals *cliglob, char * lobHandle, Int64 &lengthOfL
   Int64 lobExtractLen = 1000;
   char *lobDataBuf = new char[lobExtractLen];
   
-  str_sprintf(query,"extract lobtobuffer(lob '%s', LOCATION %Ld, SIZE %Ld) ", lobHandle,
(Int64)lobDataBuf, lobExtractLen);
+  str_sprintf(query,"extract lobtobuffer(lob '%s', LOCATION %Ld, SIZE %Ld) ", lobHandle,
(Int64)lobDataBuf, &lobExtractLen);
  
  
   retcode = cliInterface.executeImmediatePrepare(query);

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/fd80e81f/core/sql/executor/ExExeUtilCli.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExExeUtilCli.cpp b/core/sql/executor/ExExeUtilCli.cpp
index 89d462e..b42715f 100644
--- a/core/sql/executor/ExExeUtilCli.cpp
+++ b/core/sql/executor/ExExeUtilCli.cpp
@@ -760,7 +760,10 @@ Lng32 ExeCliInterface::getPtrAndLen(short entry, char* &ptr, Lng32
&len, short**
       datatype == REC_BYTE_V_ASCII_LONG ||
       datatype == REC_BYTE_V_DOUBLE ||
       datatype == SQLTYPECODE_VARCHAR_WITH_LENGTH ||
-      datatype == SQLTYPECODE_VARCHAR_LONG)
+      datatype == SQLTYPECODE_VARCHAR_LONG ||
+      datatype == SQLTYPECODE_BLOB ||
+      datatype == SQLTYPECODE_CLOB
+      )
     {
 
       // Depending on value of len, first 2 or 4 bytes of data indicate

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/fd80e81f/core/sql/executor/ExExeUtilLoad.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExExeUtilLoad.cpp b/core/sql/executor/ExExeUtilLoad.cpp
index b4e32d9..aa509ec 100644
--- a/core/sql/executor/ExExeUtilLoad.cpp
+++ b/core/sql/executor/ExExeUtilLoad.cpp
@@ -2923,7 +2923,8 @@ short ExExeUtilLobExtractTcb::work()
 		   }
 		if  (lobTdb().retrieveLength())
 		  {
-		    str_cpy_all((char *)lobTdb().getBufAddr(), (char *)&lobDataLen_,sizeof(Int64));
+		    if ((lobTdb().getBufAddr() != -1) && (lobTdb().getBufAddr() != 0))
+		      str_cpy_all((char *)lobTdb().getBufAddr(), (char *)&lobDataLen_,sizeof(Int64));
 		    str_sprintf(statusString_," LOB Length : %d", lobDataLen_);
 		    step_ = RETURN_STATUS_;
 		    break;	

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/fd80e81f/core/sql/parser/sqlparser.y
----------------------------------------------------------------------
diff --git a/core/sql/parser/sqlparser.y b/core/sql/parser/sqlparser.y
index eb6055f..44ee4e5 100755
--- a/core/sql/parser/sqlparser.y
+++ b/core/sql/parser/sqlparser.y
@@ -15647,6 +15647,19 @@ exe_util_lob_extract : TOK_EXTRACT TOK_LOBLENGTH '(' TOK_LOB QUOTED_STRING
 ')'
 
 		 $$ = lle;
 	       }
+/* type relx */
+exe_util_lob_extract : TOK_EXTRACT TOK_LOBLENGTH '(' TOK_LOB QUOTED_STRING  ')' 
+               {
+		 ConstValue * handle = new(PARSERHEAP()) ConstValue(*$5);
+		
+		 ExeUtilLobExtract * lle =
+		   new (PARSERHEAP ()) ExeUtilLobExtract
+		   (handle, 
+		    ExeUtilLobExtract::RETRIEVE_LENGTH_,
+		    -1, NULL, 0, 0);
+
+		 $$ = lle;
+	       }
 
                | TOK_EXTRACT TOK_LOBTOSTRING '(' TOK_LOB QUOTED_STRING ',' TOK_SIZE NUMERIC_LITERAL_EXACT_NO_SCALE
')'
                {


Mime
View raw message