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 2016/01/08 20:11:26 UTC

[01/13] incubator-trafodion git commit: Suppport for extractingl lob data to a user buffer inn a cursor-like fashion. Added a cli test interface to programmatically dynamic queries such as lob extract.

Repository: incubator-trafodion
Updated Branches:
  refs/heads/master 9f8afad66 -> 60ffbd9aa


Suppport for extractingl lob data to a user buffer inn a cursor-like fashion.
Added a cli test interface to programmatically dynamic queries such as lob extract.


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

Branch: refs/heads/master
Commit: dd732847da86e2971766c5b169b0663093320e29
Parents: 1baeae6
Author: Sandhya Sundaresan <sa...@apache.org>
Authored: Wed Dec 9 07:26:42 2015 +0000
Committer: Sandhya Sundaresan <sa...@apache.org>
Committed: Wed Dec 9 07:26:42 2015 +0000

----------------------------------------------------------------------
 core/sql/bin/clitest.cpp                  | 94 ++++++++++++++++++++++++++
 core/sql/clitest/blobtest.cpp             | 38 +++++++++++
 core/sql/clitest/blobtest.h               | 32 +++++++++
 core/sql/nskgmake/clitest/Makefile        | 35 ++++++++++
 core/sql/nskgmake/clitest/Makefile~       | 35 ++++++++++
 core/sql/nskgmake/clitestdriver/Makefile  | 35 ++++++++++
 core/sql/nskgmake/clitestdriver/Makefile~ | 35 ++++++++++
 7 files changed, 304 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/dd732847/core/sql/bin/clitest.cpp
----------------------------------------------------------------------
diff --git a/core/sql/bin/clitest.cpp b/core/sql/bin/clitest.cpp
new file mode 100644
index 0000000..78d347a
--- /dev/null
+++ b/core/sql/bin/clitest.cpp
@@ -0,0 +1,94 @@
+/**********************************************************************
+// @@@ START COPYRIGHT @@@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+// @@@ END COPYRIGHT @@@
+**********************************************************************/
+/* -*-C++-*-
+****************************************************************************
+*
+* File:         clitest.cpp
+* Description:  Test driver useing exe util cli interface
+*
+*
+*
+*
+****************************************************************************
+*/
+#include "Platform.h"
+
+
+#include <iostream>
+#include <stdio.h>
+#include <stdlib.h>
+#include "BaseTypes.h"
+#include "NAAssert.h"
+#include "stdlib.h"
+#include "stdio.h"
+#include "sqlcli.h"
+#include "ComDiags.h"
+#include "ex_stdh.h"
+#include "memorymonitor.h"
+#include "ex_exe_stmt_globals.h"
+#include "ex_esp_frag_dir.h"
+#include "ComTdb.h"
+#include "ex_tcb.h"
+#include "ex_split_bottom.h"
+#include "ex_send_bottom.h"
+#include "NAExit.h"
+#include "ExSqlComp.h"
+#include "Globals.h"
+#include "Int64.h"
+#include "SqlStats.h"
+#include "ComUser.h"
+#include "ExpError.h"
+#include "ComSqlId.h"
+#include "ex_globals.h"
+#include "ex_tcb.h"
+#include "ExExeUtil.h"
+#include "Globals.h"
+#include "Context.h"
+#include "blobtest.h"
+
+// DEFINE_DOVERS(clitest)
+
+int main()
+{
+  SQLCTX_HANDLE defContext = 0;
+  Lng32 retCode = SQL_EXEC_CreateContext(&defContext, NULL, 0);
+
+  if(retCode == 0){
+    cerr << "success -- new handle:" << defContext << endl;
+  }
+  else{
+    cerr << "error -- " << endl;
+   
+  }
+  CliGlobals * cliGlob = GetCliGlobals();
+  //extract length of blob column from a table with 1 lob column.
+  Int64 lengthOfLob= 0;
+  retCode = extractLengthOfBlobColumn(cliGlob, lengthOfLob,(char *)"c2",(char *)"tlob1");
+ 
+  
+  
+  return 0;
+  
+}
+
+

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/dd732847/core/sql/clitest/blobtest.cpp
----------------------------------------------------------------------
diff --git a/core/sql/clitest/blobtest.cpp b/core/sql/clitest/blobtest.cpp
new file mode 100644
index 0000000..3955e2d
--- /dev/null
+++ b/core/sql/clitest/blobtest.cpp
@@ -0,0 +1,38 @@
+#include "blobtest.h"
+
+Int32 extractLengthOfBlobColumn(CliGlobals *cliglob, Int64 &lengthOfLob, 
+				char *lobColumnName, char *tableName)
+{
+  Int32 retcode = 0;
+  ExeCliInterface cliInterface((cliglob->currContext())->exHeap(), (Int32)SQLCHARSETCODE_UTF8, cliglob->currContext(),NULL);
+  char * query = new char[4096];
+  char *lobHandle = new char[1024];
+  str_cpy_all(lobHandle," ",1024);
+  Int32 lobHandleLen = 0;
+  str_sprintf(query,"select %s from %s",lobColumnName,tableName);
+  
+  retcode = cliInterface.executeImmediate(query,lobHandle,&lobHandleLen,FALSE);
+
+  if (retcode)
+    return retcode;
+  lobHandle[lobHandleLen]='\0';
+
+  //Use lob handle to retrieve the lob length.
+  char lobLengthResult[200];
+  str_cpy_all(lobLengthResult," ",200);
+  Int32 lobLengthResultLen = 0;
+  str_sprintf(query,"extract loblength (lob '%s')",lobHandle);
+  retcode = cliInterface.executeImmediate(query,lobLengthResult,&lobLengthResultLen,FALSE);
+
+  // Extract lob data into a buffer.
+  char lobBuf[200];
+  str_cpy_all(lobBuf," ",200);
+  char lobBufStatus[200];
+  str_cpy_all(lobBufStatus," ",200);
+  Int32 lobBufStatusLen = 0;
+
+  str_sprintf(query,"extract lobtobuffer(lob '%s', LOCATION (Int64)lobBuf, SIZE 4 ", lobHandle);
+  retcode = cliInterface.executeImmediate(query,lobBufStatus,&lobBufStatusLen,FALSE);
+
+  return retcode;
+}

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/dd732847/core/sql/clitest/blobtest.h
----------------------------------------------------------------------
diff --git a/core/sql/clitest/blobtest.h b/core/sql/clitest/blobtest.h
new file mode 100644
index 0000000..e5a9dc3
--- /dev/null
+++ b/core/sql/clitest/blobtest.h
@@ -0,0 +1,32 @@
+#include <iostream>
+#include <stdio.h>
+#include <stdlib.h>
+#include "BaseTypes.h"
+#include "NAAssert.h"
+#include "stdlib.h"
+#include "stdio.h"
+#include "sqlcli.h"
+#include "ComDiags.h"
+#include "ex_stdh.h"
+#include "memorymonitor.h"
+#include "ex_exe_stmt_globals.h"
+#include "ex_esp_frag_dir.h"
+#include "ComTdb.h"
+#include "ex_tcb.h"
+#include "ex_split_bottom.h"
+#include "ex_send_bottom.h"
+#include "NAExit.h"
+#include "ExSqlComp.h"
+#include "Globals.h"
+#include "Int64.h"
+#include "SqlStats.h"
+#include "ComUser.h"
+#include "ExpError.h"
+#include "ComSqlId.h"
+#include "ex_globals.h"
+#include "ex_tcb.h"
+#include "ExExeUtil.h"
+#include "Globals.h"
+#include "Context.h"
+
+Int32 extractLengthOfBlobColumn(CliGlobals *cliglob, Int64 &lengthOfLob,char *lobColumnName, char *tableName);

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/dd732847/core/sql/nskgmake/clitest/Makefile
----------------------------------------------------------------------
diff --git a/core/sql/nskgmake/clitest/Makefile b/core/sql/nskgmake/clitest/Makefile
new file mode 100755
index 0000000..ffde7d4
--- /dev/null
+++ b/core/sql/nskgmake/clitest/Makefile
@@ -0,0 +1,35 @@
+#######################################################################
+# @@@ START COPYRIGHT @@@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# @@@ END COPYRIGHT @@@
+#######################################################################
+
+CPPSRC := \
+        blobtest.cpp 
+       
+CPPSRC += mpisetup.cpp 
+SRCPATH := clitest bin 
+C_INC_OVERRIDE := -I$(MY_SQROOT)/export/include -I$(MY_SQROOT)/export/include/seabed
+
+
+ifeq ($(FLAVOR), debug)
+    CXXFLAGS += -DNA_DEBUG_GUI
+endif
+

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/dd732847/core/sql/nskgmake/clitest/Makefile~
----------------------------------------------------------------------
diff --git a/core/sql/nskgmake/clitest/Makefile~ b/core/sql/nskgmake/clitest/Makefile~
new file mode 100755
index 0000000..767ebdc
--- /dev/null
+++ b/core/sql/nskgmake/clitest/Makefile~
@@ -0,0 +1,35 @@
+#######################################################################
+# @@@ START COPYRIGHT @@@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# @@@ END COPYRIGHT @@@
+#######################################################################
+
+CPPSRC := SqlciMain.cpp \
+	MxciEHCallBack.cpp
+
+EARLY_DLLS:= -ljsig
+
+DEP_LIBS += tdm_sqlcli sqlcilib arkcmp_dll
+
+CPPSRC += vprocsqlci.cpp
+
+
+SRCPATH := sqlci bin
+

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/dd732847/core/sql/nskgmake/clitestdriver/Makefile
----------------------------------------------------------------------
diff --git a/core/sql/nskgmake/clitestdriver/Makefile b/core/sql/nskgmake/clitestdriver/Makefile
new file mode 100755
index 0000000..c07a510
--- /dev/null
+++ b/core/sql/nskgmake/clitestdriver/Makefile
@@ -0,0 +1,35 @@
+#######################################################################
+# @@@ START COPYRIGHT @@@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# @@@ END COPYRIGHT @@@
+#######################################################################
+
+CPPSRC := clitest.cpp 
+
+
+EARLY_DLLS:= -ljsig
+
+DEP_LIBS += tdm_sqlcli arkcmp_dll clitest
+
+CPPSRC += vprocsqlci.cpp
+
+
+SRCPATH := clitest bin
+

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/dd732847/core/sql/nskgmake/clitestdriver/Makefile~
----------------------------------------------------------------------
diff --git a/core/sql/nskgmake/clitestdriver/Makefile~ b/core/sql/nskgmake/clitestdriver/Makefile~
new file mode 100755
index 0000000..767ebdc
--- /dev/null
+++ b/core/sql/nskgmake/clitestdriver/Makefile~
@@ -0,0 +1,35 @@
+#######################################################################
+# @@@ START COPYRIGHT @@@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# @@@ END COPYRIGHT @@@
+#######################################################################
+
+CPPSRC := SqlciMain.cpp \
+	MxciEHCallBack.cpp
+
+EARLY_DLLS:= -ljsig
+
+DEP_LIBS += tdm_sqlcli sqlcilib arkcmp_dll
+
+CPPSRC += vprocsqlci.cpp
+
+
+SRCPATH := sqlci bin
+


[02/13] incubator-trafodion git commit: Recommitting the last commit. Some files did notget added. Context/changes are the same as earlier commit.

Posted by sa...@apache.org.
Recommitting the last commit. Some files did notget added. Context/changes are the same as earlier commit.


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

Branch: refs/heads/master
Commit: 5cfc9fa4e70eaeb041a03499fb2e7dd2fae7d28e
Parents: dd73284
Author: Sandhya Sundaresan <sa...@apache.org>
Authored: Wed Dec 9 22:39:20 2015 +0000
Committer: Sandhya Sundaresan <sa...@apache.org>
Committed: Wed Dec 9 22:39:20 2015 +0000

----------------------------------------------------------------------
 core/sql/bin/clitest.cpp                 |  91 +++++++++++++++++---
 core/sql/cli/Cli.cpp                     |  31 +++++--
 core/sql/cli/sqlcli.h                    |   5 +-
 core/sql/clitest/blobtest.cpp            |  86 +++++++++++++++----
 core/sql/clitest/blobtest.h              |   7 +-
 core/sql/comexe/ComTdbExeUtil.cpp        |  18 ++--
 core/sql/comexe/ComTdbExeUtil.h          |  27 ++++--
 core/sql/comexe/ComTdbRoot.h             |  14 ++-
 core/sql/executor/ExExeUtil.h            |   2 +-
 core/sql/executor/ExExeUtilCli.cpp       |  74 +++++++++++++++-
 core/sql/executor/ExExeUtilCli.h         |   6 +-
 core/sql/executor/ExExeUtilLoad.cpp      | 117 +++++++++++++++++---------
 core/sql/executor/ExHdfsScan.cpp         |   8 +-
 core/sql/exp/ExpLOBaccess.cpp            |   2 +-
 core/sql/exp/ExpLOBenums.h               |   1 +
 core/sql/exp/ExpLOBinterface.cpp         |   9 +-
 core/sql/exp/ExpLOBinterface.h           |   1 +
 core/sql/generator/GenRelExeUtil.cpp     |  11 ++-
 core/sql/generator/GenRelMisc.cpp        |   4 +
 core/sql/nskgmake/Makerules.linux        |   4 +-
 core/sql/nskgmake/clitest/Makefile       |   3 +-
 core/sql/nskgmake/clitestdriver/Makefile |   2 +-
 core/sql/optimizer/RelExeUtil.cpp        |   4 +-
 core/sql/optimizer/RelExeUtil.h          |  12 +--
 core/sql/parser/sqlparser.y              |  21 ++---
 25 files changed, 426 insertions(+), 134 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/5cfc9fa4/core/sql/bin/clitest.cpp
----------------------------------------------------------------------
diff --git a/core/sql/bin/clitest.cpp b/core/sql/bin/clitest.cpp
index 78d347a..e88ee9d 100644
--- a/core/sql/bin/clitest.cpp
+++ b/core/sql/bin/clitest.cpp
@@ -66,25 +66,92 @@
 #include "Context.h"
 #include "blobtest.h"
 
-// DEFINE_DOVERS(clitest)
-
-int main()
+//DEFINE_DOVERS(clitestdriver)
+// 
+int main(int argc, const char * argv[])
 {
+
+  if ((argc < 2) || (argc > 2))
+    {
+      cout << "Error -  provide an option: " << endl;
+      cout << "Usage : clitestdriver <option number>" << endl;
+      cout << "TEST            : OPTION        "<<endl;
+      cout << "--------------------------------"<<endl;
+      cout << "Blob test          1 "<< endl;
+      return 0;
+    }
+  Int32 retcode = 0;
   SQLCTX_HANDLE defContext = 0;
   Lng32 retCode = SQL_EXEC_CreateContext(&defContext, NULL, 0);
+ 
+  int option = atoi(argv[1]);
 
-  if(retCode == 0){
-    cerr << "success -- new handle:" << defContext << endl;
-  }
-  else{
-    cerr << "error -- " << endl;
+  if(retcode != 0 )
+    cout << "Error creating a CLI context error " << endl;
    
-  }
+  
   CliGlobals * cliGlob = GetCliGlobals();
-  //extract length of blob column from a table with 1 lob column.
-  Int64 lengthOfLob= 0;
-  retCode = extractLengthOfBlobColumn(cliGlob, lengthOfLob,(char *)"c2",(char *)"tlob1");
+  char tablename[50] = {'\0'};
+  char columnname[50] = {'\0'};
  
+  switch (option) 
+    {
+    case 1:
+      {
+	cout <<"***********"  <<endl;
+	cout << "Blob test " << endl;
+	cout <<"***********"  <<endl;
+	cout << " Extract from a lob column in a lob table" << endl << endl;
+	cout << " Input lob table name :" << endl;
+	cin.getline(tablename,40);
+	cout << " Table name : " << tablename << endl;
+	cout << "Input lob column name to extract from :" << endl;
+	cin.getline(columnname,40); 
+	cout << "Column Name : " << columnname << endl;
+
+      //extract lob handle
+      
+      char *lobHandle = new char[1024];
+      str_cpy_all(lobHandle," ",1024);
+      cout << "Extracting  lob handle for column " << columnname << "..." << endl;
+      retcode = extractLobHandle(cliGlob, lobHandle, (char *)"c2",(char *)"tlob1");
+      if (retcode)
+	{
+	  cout << "extractLobHandle returned " << retcode <<endl;
+	
+	  delete lobHandle;
+	  return retcode;
+	}
+      cout << "LOB handle for "<< columnname << ": " << lobHandle << endl;
+      //extract length of lob column from a table with 1 lob column.
+
+      cout << "Extracting LOB data length for the above handle..." << endl;
+      Int64 lengthOfLob= 0;
+      retCode = extractLengthOfLobColumn(cliGlob, lobHandle, lengthOfLob,(char *)"c2",(char *)"tlob1");
+      if (retcode)
+	{
+	  cout << "extractLengthOfLobColumn returned " << retcode <<endl;
+	 
+	  delete lobHandle;
+	  return retcode;
+	}
+      cout << "LOB data length :" << lengthOfLob << endl;
+      //extract lob data to buffer
+      cout << "Extracting lob data into user buffer in a loop ..." << endl;
+      retCode = extractLobToBuffer(cliGlob,lobHandle, lengthOfLob,(char *)"c2",(char *)"tlob1");
+      if (retcode)
+	{
+	  cout << "extractLobToBuffer returned " << retcode <<endl;
+
+	  delete lobHandle;
+	  return retcode;
+	}
+      delete lobHandle;
+      return retcode;
+      }
+     
+      break;
+    }
   
   
   return 0;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/5cfc9fa4/core/sql/cli/Cli.cpp
----------------------------------------------------------------------
diff --git a/core/sql/cli/Cli.cpp b/core/sql/cli/Cli.cpp
index ba733d1..58a77ba 100644
--- a/core/sql/cli/Cli.cpp
+++ b/core/sql/cli/Cli.cpp
@@ -7532,8 +7532,13 @@ Lng32 SQLCLI_Xact(/*IN*/ CliGlobals * cliGlobals,
         if ((currContext.getTransaction()->xnInProgress()) &&
             (currContext.getTransaction()->exeStartedXn()) &&
             (currContext.getTransaction()->autoCommit()))
-          {
-            currContext.getTransaction()->rollbackTransactionWaited();
+          {            
+	    retcode = currContext.getTransaction()->rollbackTransactionWaited();
+	    if (retcode)
+	      {
+		diags.mergeAfter(*(currContext.getTransaction()->getDiagsArea()));
+		return -1;
+	      }
           }
       }
       //LCOV_EXCL_STOP
@@ -7546,8 +7551,14 @@ Lng32 SQLCLI_Xact(/*IN*/ CliGlobals * cliGlobals,
 	    (currContext.getTransaction()->exeStartedXn()))
 	  {
 	    retcode = currContext.getTransaction()->commitTransaction();
+
             if (retcode)
-              return -1;
+	      {
+                diags.mergeAfter(*(currContext.getTransaction()->getDiagsArea()));
+                return -1;
+	      }
+              
+	  
 	  }
       }
       //LCOV_EXCL_STOP
@@ -7559,7 +7570,12 @@ Lng32 SQLCLI_Xact(/*IN*/ CliGlobals * cliGlobals,
 	if ((currContext.getTransaction()->xnInProgress()) &&
 	    (currContext.getTransaction()->exeStartedXn()))
 	  {
-	    currContext.getTransaction()->rollbackTransaction();
+	    retcode= currContext.getTransaction()->rollbackTransaction();
+            if (retcode)
+	      {
+                diags.mergeAfter(*(currContext.getTransaction()->getDiagsArea()));
+                return -1;
+              }
 	  }
       }
       //LCOV_EXCL_STOP
@@ -7570,7 +7586,12 @@ Lng32 SQLCLI_Xact(/*IN*/ CliGlobals * cliGlobals,
       {
 	if (! (currContext.getTransaction()->xnInProgress()))
 	  {
-	    currContext.getTransaction()->beginTransaction();
+	    retcode = currContext.getTransaction()->beginTransaction();
+            if (retcode)
+	      {
+		diags.mergeAfter(*(currContext.getTransaction()->getDiagsArea()));
+		return -1;
+	      }
 	  }
       }
       //LCOV_EXCL_STOP

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/5cfc9fa4/core/sql/cli/sqlcli.h
----------------------------------------------------------------------
diff --git a/core/sql/cli/sqlcli.h b/core/sql/cli/sqlcli.h
index 8b9fba3..07338db 100644
--- a/core/sql/cli/sqlcli.h
+++ b/core/sql/cli/sqlcli.h
@@ -825,6 +825,7 @@ enum SQLATTRQUERY_TYPE {
      approach to extract data from SQL tables into extrenal files */
   SQL_SELECT_UNLOAD = 19
   
+  
 
 };
 
@@ -837,7 +838,9 @@ enum SQLATTR_SUBQUERY_TYPE
   SQL_DESCRIBE_QUERY = 4,
   SQL_DISPLAY_EXPLAIN = 5,
   SQL_STMT_HBASE_LOAD = 6,
-  SQL_STMT_HBASE_UNLOAD = 7
+  SQL_STMT_HBASE_UNLOAD = 7,
+  /* Used to denote lob access */
+  SQL_LOB_EXTRACT = 8
 };
 
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/5cfc9fa4/core/sql/clitest/blobtest.cpp
----------------------------------------------------------------------
diff --git a/core/sql/clitest/blobtest.cpp b/core/sql/clitest/blobtest.cpp
index 3955e2d..d7d700d 100644
--- a/core/sql/clitest/blobtest.cpp
+++ b/core/sql/clitest/blobtest.cpp
@@ -1,13 +1,30 @@
 #include "blobtest.h"
 
-Int32 extractLengthOfBlobColumn(CliGlobals *cliglob, Int64 &lengthOfLob, 
-				char *lobColumnName, char *tableName)
+Int32 extractLengthOfLobColumn(CliGlobals *cliglob, char *lobHandle, 
+			       Int64 &lengthOfLob, 
+			       char *lobColumnName, char *tableName)
+{
+  Int32 retcode = 0;
+  char * query = new char[4096];
+  ExeCliInterface cliInterface((cliglob->currContext())->exHeap(), (Int32)SQLCHARSETCODE_UTF8, cliglob->currContext(),NULL);
+  //Use lob handle to retrieve the lob length.
+  char lobLengthResult[200];
+  str_cpy_all(lobLengthResult," ",200);
+  Int32 lobLengthResultLen = 0;
+  str_sprintf(query,"extract loblength (lob '%s') LOCATION %Ld ",lobHandle, &lengthOfLob);
+  retcode = cliInterface.executeImmediate(query,lobLengthResult,&lobLengthResultLen,FALSE);
+
+  delete query;
+  return retcode;
+ 
+}
+
+Int32 extractLobHandle(CliGlobals *cliglob, char *& lobHandle, 
+		       char *lobColumnName, char *tableName)
 {
   Int32 retcode = 0;
   ExeCliInterface cliInterface((cliglob->currContext())->exHeap(), (Int32)SQLCHARSETCODE_UTF8, cliglob->currContext(),NULL);
   char * query = new char[4096];
-  char *lobHandle = new char[1024];
-  str_cpy_all(lobHandle," ",1024);
   Int32 lobHandleLen = 0;
   str_sprintf(query,"select %s from %s",lobColumnName,tableName);
   
@@ -16,23 +33,56 @@ Int32 extractLengthOfBlobColumn(CliGlobals *cliglob, Int64 &lengthOfLob,
   if (retcode)
     return retcode;
   lobHandle[lobHandleLen]='\0';
+  delete query;
+  
+  return retcode;
+ 
+}
 
-  //Use lob handle to retrieve the lob length.
-  char lobLengthResult[200];
-  str_cpy_all(lobLengthResult," ",200);
-  Int32 lobLengthResultLen = 0;
-  str_sprintf(query,"extract loblength (lob '%s')",lobHandle);
-  retcode = cliInterface.executeImmediate(query,lobLengthResult,&lobLengthResultLen,FALSE);
-
+Int32 extractLobToBuffer(CliGlobals *cliglob, char * lobHandle, Int64 &lengthOfLob, 
+				char *lobColumnName, char *tableName)
+{
+  Int32 retcode = 0;
+  ExeCliInterface cliInterface((cliglob->currContext())->exHeap(), (Int32)SQLCHARSETCODE_UTF8, cliglob->currContext(),NULL);
   // Extract lob data into a buffer.
-  char lobBuf[200];
-  str_cpy_all(lobBuf," ",200);
-  char lobBufStatus[200];
-  str_cpy_all(lobBufStatus," ",200);
-  Int32 lobBufStatusLen = 0;
+  char * query = new char [500];
+  
+  char *lobFinalBuf = new char[lengthOfLob];
+  char statusBuf[200] = {'\0'};
+  Int32 statusBufLen = 0;
+  Int64 lobExtractLen = 10;
+  char *lobDataBuf = new char[lobExtractLen];
+  
+  str_sprintf(query,"extract lobtobuffer(lob '%s', LOCATION %Ld, SIZE %Ld) ", lobHandle, (Int64)lobDataBuf, lobExtractLen);
+ 
+ 
+  retcode = cliInterface.executeImmediatePrepare(query);
+  short i = 0;
+  while ((retcode != 100) && !(retcode<0))
+    {    
+      retcode = cliInterface.clearExecFetchClose(NULL,NULL,statusBuf, &statusBufLen);
+      if (!retcode)
+	{
+	memcpy((char*)&(lobFinalBuf[i]),(char *)lobDataBuf,lobExtractLen);
+	i += lobExtractLen;
+	}
+    }
+  if (retcode ==100 || retcode ==0)
+    {
+      FILE * lobFileId = fopen("lob_output_file","w");
+  
+      int byteCount=fwrite(lobFinalBuf,sizeof(char),lengthOfLob, lobFileId);
+      cout << "Wrote " << byteCount << " bytes to file lob_output_file" << endl;
 
-  str_sprintf(query,"extract lobtobuffer(lob '%s', LOCATION (Int64)lobBuf, SIZE 4 ", lobHandle);
-  retcode = cliInterface.executeImmediate(query,lobBufStatus,&lobBufStatusLen,FALSE);
+      fclose(lobFileId);
+    }
+  delete  lobFinalBuf;
+  delete query;
+  delete lobDataBuf;
+    
 
   return retcode;
+
 }
+
+

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/5cfc9fa4/core/sql/clitest/blobtest.h
----------------------------------------------------------------------
diff --git a/core/sql/clitest/blobtest.h b/core/sql/clitest/blobtest.h
index e5a9dc3..4ec96dc 100644
--- a/core/sql/clitest/blobtest.h
+++ b/core/sql/clitest/blobtest.h
@@ -28,5 +28,10 @@
 #include "ExExeUtil.h"
 #include "Globals.h"
 #include "Context.h"
+Int32 extractLobHandle(CliGlobals *cliglob, char *& lobHandle, 
+		       char *lobColumnName, char *tableName);
 
-Int32 extractLengthOfBlobColumn(CliGlobals *cliglob, Int64 &lengthOfLob,char *lobColumnName, char *tableName);
+Int32 extractLengthOfLobColumn(CliGlobals *cliglob, char * lobHandle, Int64 &lengthOfLob,char *lobColumnName, char *tableName);
+
+Int32 extractLobToBuffer(CliGlobals *cliglob, char * lobHandle, Int64 &lengthOfLob, 
+			 char *lobColumnName, char *tableName);

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/5cfc9fa4/core/sql/comexe/ComTdbExeUtil.cpp
----------------------------------------------------------------------
diff --git a/core/sql/comexe/ComTdbExeUtil.cpp b/core/sql/comexe/ComTdbExeUtil.cpp
index 1463a07..773df33 100644
--- a/core/sql/comexe/ComTdbExeUtil.cpp
+++ b/core/sql/comexe/ComTdbExeUtil.cpp
@@ -2200,6 +2200,8 @@ ComTdbExeUtilLobExtract::ComTdbExeUtilLobExtract
  char * handle,
  Lng32 handleLen,
  ExtractToType toType,
+ Int64 bufAddr,
+ Int64 extractSize,
  Int64 intParam1,
  Int64 intParam2,
  Lng32 lobStorageType,
@@ -2231,28 +2233,32 @@ ComTdbExeUtilLobExtract::ComTdbExeUtilLobExtract
     handle_(handle),
     handleLen_(handleLen),
     toType_((short)toType),
+    bufAddr_(bufAddr),
+    extractSize_(extractSize),
     lobStorageType_(lobStorageType),
     stringParam1_(stringParam1),
     stringParam2_(stringParam2),
     stringParam3_(stringParam3),
     lobHdfsServer_(lobHdfsServer),
     lobHdfsPort_(lobHdfsPort),
-    rowSize_(0),
-    bufSize_(0),
+    totalBufSize_(0),
     flags_(0)
 {
   setNodeType(ComTdb::ex_LOB_EXTRACT);
   if ((toType_ == ExtractToType::TO_BUFFER_) || (toType_ == ExtractToType::TO_STRING_))
     {
-      // intparam1 contains the rowsize passed in via syntax
+      /*// intparam1 contains the rowsize passed in via syntax
       // intparam2 constains the total buf size user has allocated
       rowSize_ = intParam1;
-      bufSize_ = intParam2;
+      bufSize_ = intParam2; */
+      
     }
     else if (toType_ == ExtractToType::TO_FILE_)
       {
-	// rowSize_ is irrelevant since the whole lob will be read into the output file
-	// bufSize_ is not passed in by user. It is a CQD value LOB_OUTPUT_SIZE
+	// extractSize_ is irrelevant since the whole lob will be read into the output file
+	// bufAddr_ is not passed in by user. It is a CQD value LOB_OUTPUT_SIZE
+	extractSize_ = 0;
+	bufAddr_ = 0;
 	
       }
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/5cfc9fa4/core/sql/comexe/ComTdbExeUtil.h
----------------------------------------------------------------------
diff --git a/core/sql/comexe/ComTdbExeUtil.h b/core/sql/comexe/ComTdbExeUtil.h
index 8389bcc..afe1a69 100644
--- a/core/sql/comexe/ComTdbExeUtil.h
+++ b/core/sql/comexe/ComTdbExeUtil.h
@@ -2655,7 +2655,7 @@ public:
   enum ExtractToType
   {
     TO_FILE_, TO_STRING_, TO_BUFFER_, TO_EXTERNAL_FROM_STRING_,
-    TO_EXTERNAL_FROM_FILE_,  NOOP_
+    TO_EXTERNAL_FROM_FILE_, RETRIEVE_LENGTH_,NOOP_
   };
   
 
@@ -2668,8 +2668,10 @@ public:
      char * handle,
      Lng32 handleLen,
      ExtractToType toType,
-     Int64 size,
-     Int64 size2,
+     Int64 bufAddr,
+     Int64 extractSize,
+     Int64 intParam1,
+     Int64 intParam2,
      Int32 lobStorageType,
      char * stringParam1,
      char * stringParam2,
@@ -2702,7 +2704,7 @@ public:
   Lng32 getLobHdfsPort() { return lobHdfsPort_; }
 
   ExtractToType getToType() { return (ExtractToType)toType_; }
-
+ 
   // ---------------------------------------------------------------------
   // Redefine virtual functions required for Versioning.
   //----------------------------------------------------------------------
@@ -2751,9 +2753,13 @@ public:
   {(v ? flags_ |= APPEND_OR_CREATE : flags_ &= ~APPEND_OR_CREATE); };
   NABoolean appendOrCreate() { return (flags_ & APPEND_OR_CREATE) != 0; };
 
-  void setRowSize(Int64 rowSize) { rowSize_ = rowSize; };
-  void setBufSize(Int64 bufSize) { bufSize_ = bufSize;};
-  
+  void setExtractSize(Int64 extractSize) { extractSize_ = extractSize; };
+  Int64 getExtractSize() { return extractSize_;}
+  void setTotalBufSize(Int64 bufSize) { totalBufSize_ = bufSize;};
+  Int64 getTotalBufSize() { return totalBufSize_;};
+  void setBufAddr(Int64 bufAddr) {bufAddr_ = bufAddr;};
+  Int64 getBufAddr() { return bufAddr_;};
+
 private:
   enum
   {
@@ -2773,8 +2779,11 @@ private:
   short toType_;                                           // 08-09
   Int32 flags_;    
   Lng32 handleLen_;
-  Int64 rowSize_; // row size
-  Int64 bufSize_; // buf size
+  Int64 extractSize_; // as passed in via syntax size
+  Int64 totalBufSize_; // buf size
+  Int64 bufAddr_ ; //buffer addressed as passed in by user via syntax
+  Int64 intParam1_;
+  Int64 intParam2_;
   Lng32 lobStorageType_ ; // valid when  extract is from a file.
   Lng32 lobHdfsPort_;
   NABasicPtr lobHdfsServer_;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/5cfc9fa4/core/sql/comexe/ComTdbRoot.h
----------------------------------------------------------------------
diff --git a/core/sql/comexe/ComTdbRoot.h b/core/sql/comexe/ComTdbRoot.h
index e6d4d78..f7662fe 100644
--- a/core/sql/comexe/ComTdbRoot.h
+++ b/core/sql/comexe/ComTdbRoot.h
@@ -362,7 +362,8 @@ class ComTdbRoot : public ComTdb
     HDFS_ACCESS                 = 0x00000008,
     EXE_UTIL_RWRS              = 0x00000010,
     EMBEDDED_COMPILER          = 0x00000020,
-    HIVE_ACCESS                = 0x00000040
+    HIVE_ACCESS                = 0x00000040,
+    EXE_LOB_ACCESS             = 0x00000080
   };
 
   // Use these values in 16-bit rtFlags3_
@@ -628,7 +629,8 @@ public:
     SQL_DESCRIBE_QUERY = 4,
     SQL_DISPLAY_EXPLAIN = 5,
     SQL_STMT_HBASE_LOAD = 6,
-    SQL_STMT_HBASE_UNLOAD = 7
+    SQL_STMT_HBASE_UNLOAD = 7,
+    SQL_STMT_LOB_EXTRACT = 8
    };
   
   ComTdbRoot();
@@ -843,7 +845,9 @@ public:
 
    NABoolean isEmbeddedCompiler() const
     {return ((rtFlags2_ & EMBEDDED_COMPILER) != 0);};
- 
+    NABoolean isLobExtract() const
+    {return ((rtFlags2_ & EXE_LOB_ACCESS) != 0);};
+
   char * getSnapshotScanTempLocation () { return snapshotscanTempLocation_; }
   Queue * getListOfSnapshotScanTables() { return listOfSnapshotScanTables_; }
 
@@ -997,6 +1001,10 @@ public:
     { 
       (v ? rtFlags2_ |= EMBEDDED_COMPILER : rtFlags2_ &= ~EMBEDDED_COMPILER); 
     }
+  void setLobAccess(NABoolean v)
+    { 
+      (v ? rtFlags2_ |= EXE_LOB_ACCESS : rtFlags2_ &= ~EXE_LOB_ACCESS); 
+    }
   NABoolean hdfsAccess() const
     {return ((rtFlags2_ & HDFS_ACCESS) != 0);};
  

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/5cfc9fa4/core/sql/executor/ExExeUtil.h
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExExeUtil.h b/core/sql/executor/ExExeUtil.h
index 61fd4b9..42e04bc 100755
--- a/core/sql/executor/ExExeUtil.h
+++ b/core/sql/executor/ExExeUtil.h
@@ -2947,7 +2947,7 @@ public:
   Lng32 lobType_;
   char * lobData_;
   char * lobData2_;
-  Int64 lobDataExtractLen_;
+  Int64 lobDataSpecifiedExtractLen_;
   Int64 lobDataLen_;
   Lng32 remainingBytes_;
   Lng32 currPos_;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/5cfc9fa4/core/sql/executor/ExExeUtilCli.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExExeUtilCli.cpp b/core/sql/executor/ExExeUtilCli.cpp
index 13cfdb1..89d462e 100644
--- a/core/sql/executor/ExExeUtilCli.cpp
+++ b/core/sql/executor/ExExeUtilCli.cpp
@@ -759,7 +759,8 @@ Lng32 ExeCliInterface::getPtrAndLen(short entry, char* &ptr, Lng32 &len, short**
   if (datatype == REC_BYTE_V_ASCII ||
       datatype == REC_BYTE_V_ASCII_LONG ||
       datatype == REC_BYTE_V_DOUBLE ||
-      datatype == SQLTYPECODE_VARCHAR_WITH_LENGTH)
+      datatype == SQLTYPECODE_VARCHAR_WITH_LENGTH ||
+      datatype == SQLTYPECODE_VARCHAR_LONG)
     {
 
       // Depending on value of len, first 2 or 4 bytes of data indicate
@@ -1048,6 +1049,77 @@ Lng32 ExeCliInterface::executeImmediateExec(const char * stmtStr,
   return ((cliRetcode != -1) ? cliRetcode : retcode);
 }
 
+
+Lng32 ExeCliInterface::executeImmediateExecNoDealloc(const char * stmtStr,
+					   char * outputBuf,
+					   Lng32 * outputBufLen,
+					   NABoolean nullTerminate,
+					   Int64 * rowsAffected 
+					   )
+{
+  Lng32 retcode = 0;
+
+  retcode = exec();
+  if (retcode < 0)
+    {
+      deallocStuff(module_, stmt_, sql_src_, input_desc_, output_desc_);
+      return retcode;
+    }
+
+  retcode = fetch();
+  if (retcode < 0)
+    {
+      deallocStuff(module_, stmt_, sql_src_, input_desc_, output_desc_);
+      return retcode;
+    }
+
+  if ((outputBuf) &&
+      (outputBufLen))
+    {
+      *outputBufLen = 0;
+      if (retcode != 100)
+	{
+	  char * ptr;
+	  Lng32 len;
+	  getPtrAndLen(1, ptr, len);
+
+	  str_cpy_all(outputBuf, ptr, len);
+	  
+	  if (nullTerminate)
+	    outputBuf[len] = 0;
+	  *outputBufLen = len;
+	}
+    }
+
+  Lng32 cliRetcode = -1;
+  if (retcode >= 0)
+  {
+    cliRetcode = retcode;
+    if (rowsAffected)
+    {
+      Int64 tmpRowsAffected = 0;
+      retcode = SQL_EXEC_GetDiagnosticsStmtInfo2(NULL, SQLDIAG_ROW_COUNT,
+        &tmpRowsAffected, NULL,
+        0, NULL);
+
+      if(retcode == EXE_NUMERIC_OVERFLOW) 
+      {
+        GetRowsAffected(rowsAffected);
+      }
+      else
+        *rowsAffected = tmpRowsAffected;
+    }
+  }
+
+  clearGlobalDiags();
+
+  retcode = close();
+
+  /*deallocStuff(module_, stmt_, sql_src_, input_desc_, output_desc_);
+
+  clearGlobalDiags();*/
+  return ((cliRetcode != -1) ? cliRetcode : retcode);
+}
 Lng32 ExeCliInterface::executeImmediate(const char * stmtStr,
 				       char * outputBuf,
 				       Lng32 * outputBufLen,

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/5cfc9fa4/core/sql/executor/ExExeUtilCli.h
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExExeUtilCli.h b/core/sql/executor/ExExeUtilCli.h
index 73e3a1c..b94c61b 100644
--- a/core/sql/executor/ExExeUtilCli.h
+++ b/core/sql/executor/ExExeUtilCli.h
@@ -100,7 +100,11 @@ private:
                             Lng32 * outputBufLen = NULL,
                             NABoolean nullTerminate = TRUE,
                             Int64 * rowsAffected = NULL);
-
+  Lng32 executeImmediateExecNoDealloc(const char * stmt,
+                            char * outputBuf = NULL,
+                            Lng32 * outputBufLen = NULL,
+                            NABoolean nullTerminate = TRUE,
+                            Int64 * rowsAffected = NULL);
   Lng32 prepare(const char * stmtStr,
 		SQLMODULE_ID * module,
 		SQLSTMT_ID * stmt,

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/5cfc9fa4/core/sql/executor/ExExeUtilLoad.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExExeUtilLoad.cpp b/core/sql/executor/ExExeUtilLoad.cpp
index 0d36135..07d7902 100644
--- a/core/sql/executor/ExExeUtilLoad.cpp
+++ b/core/sql/executor/ExExeUtilLoad.cpp
@@ -2621,7 +2621,7 @@ ExExeUtilLobExtractTcb::ExExeUtilLobExtractTcb
   lobData_= NULL;
   lobData2_= NULL;
 
-  lobDataExtractLen_ = 0; // default. Actual value set from tdb below
+  lobDataSpecifiedExtractLen_ = 0; // default. Actual value set from tdb below
   lobDataLen_= 0;
   
   remainingBytes_= 0;
@@ -2639,9 +2639,9 @@ short ExExeUtilLobExtractTcb::work()
 {
   Lng32 cliRC = 0;
   Lng32 retcode = 0;
-  Int64 lobDataLen = 0;
-  Int64 outLobLen = 0;
+  Int64 lobDataOutputLen = 0;
   Int64 requestTag = -1;
+  LobsSubOper so;
   // if no parent request, return
   if (qparent_.down->isEmpty())
     return WORK_OK;
@@ -2890,7 +2890,12 @@ short ExExeUtilLobExtractTcb::work()
 
 	      }
 	    
-	    step_ = RETRIEVE_LOB_LENGTH_;	    
+	    if (lobTdb().getToType() == ComTdbExeUtilLobExtract::TO_BUFFER_)
+	      step_ = EXTRACT_LOB_DATA_;
+	    else
+	      if ((lobTdb().getToType() == ComTdbExeUtilLobExtract::RETRIEVE_LENGTH_) || (lobTdb().getToType() == ComTdbExeUtilLobExtract::TO_FILE_))
+	      step_ = RETRIEVE_LOB_LENGTH_;
+	    
 	    break;
 	  }
 	case RETRIEVE_LOB_LENGTH_ : 
@@ -2908,7 +2913,7 @@ short ExExeUtilLobExtractTcb::work()
 	   
 		//Retrieve the total length of this lob using the handle info and return to the caller
 		Int64 dummy = 0;
-		cliRC = SQL_EXEC_LOBcliInterface(lobHandle_, lobHandleLen_,NULL,NULL,NULL,NULL,LOB_CLI_SELECT_LOBLENGTH,LOB_CLI_ExecImmed, 0,&lobDataLen, &dummy, &dummy,0,0);
+		cliRC = SQL_EXEC_LOBcliInterface(lobHandle_, lobHandleLen_,NULL,NULL,NULL,NULL,LOB_CLI_SELECT_LOBLENGTH,LOB_CLI_ExecImmed, 0,&lobDataLen_, &dummy, &dummy,0,0);
 		if (cliRC < 0)
 		   {
 		     getDiagsArea()->mergeAfter(diags);
@@ -2918,7 +2923,8 @@ short ExExeUtilLobExtractTcb::work()
 		   }
 		if  (lobTdb().retrieveLength())
 		  {
-		    str_sprintf(statusString_," LOB Length : %d", lobDataLen);
+		    str_cpy_all((char *)lobTdb().getBufAddr(), (char *)&lobDataLen_,sizeof(Int64));
+		    str_sprintf(statusString_," LOB Length : %d", lobDataLen_);
 		    step_ = RETURN_STATUS_;
 		    break;	
 		  }
@@ -2934,13 +2940,14 @@ short ExExeUtilLobExtractTcb::work()
 	    Int64 uid, inDescSyskey, descPartnKey;
 	    short schNameLen;
 	    char schName[1024];
+	    
 	    ExpLOBoper::extractFromLOBhandle(&flags, &lobType_, &lobNum, &uid,  
 					     &inDescSyskey, &descPartnKey, 
 					     &schNameLen, (char *)schName,
 					     (char *)lobHandle_, (Lng32)lobHandleLen_);
 	    lobName_ = ExpLOBoper::ExpGetLOBname(uid, lobNum, lobNameBuf_, 1000);
 
-	    lobDataExtractLen_ = lobTdb().bufSize_; 
+	    lobDataSpecifiedExtractLen_ = lobTdb().totalBufSize_; 
 	    
 	    
 	   
@@ -2976,6 +2983,7 @@ short ExExeUtilLobExtractTcb::work()
 
 	    if (lobTdb().getToType() == ComTdbExeUtilLobExtract::TO_FILE_)
 	      {
+		so = Lob_File;
 		LobTgtFileFlags tgtFlags = Lob_Error_Or_Create;
 		if (lobTdb().errorIfNotExists() && !lobTdb().truncateExisting())
 		  tgtFlags = Lob_Append_Or_Error;
@@ -2994,12 +3002,12 @@ short ExExeUtilLobExtractTcb::work()
 						lobHandleLen_,
 						lobHandle_,
 						requestTag,
-						Lob_File,
+						so,
 						((LOBglobals *)lobGlobs)->xnId(),
 						0,0,					       					
-						0, lobDataLen, outLobLen, 
+						0, lobDataLen_, lobDataOutputLen, 
 						lobTdb().getFileName(),
-						lobDataExtractLen_,
+						lobDataSpecifiedExtractLen_,
 						(Int32)tgtFlags
 						);
 		if (retcode <0)
@@ -3014,9 +3022,15 @@ short ExExeUtilLobExtractTcb::work()
 		    step_ = HANDLE_ERROR_;
 		    break;
 		  }
-		str_sprintf(statusString_, "Success. Targetfile :%s  Length : %Ld", lobTdb().getFileName(), outLobLen);
+		str_sprintf(statusString_, "Success. Targetfile :%s  Length : %Ld", lobTdb().getFileName(), lobDataOutputLen);
 		step_ = RETURN_STATUS_;
 	      }
+	    else if (lobTdb().getToType() == ComTdbExeUtilLobExtract::TO_BUFFER_)
+	      {
+		so = Lob_Buffer;
+		lobData_ =  (char *)lobTdb().getBufAddr();
+		step_ = OPEN_CURSOR_;
+	      }
 	  }
 	  break;
 
@@ -3036,11 +3050,11 @@ short ExExeUtilLobExtractTcb::work()
                0, // cursor bytes 
                NULL, //cursor id
 	       requestTag_, 
+	       Lob_Buffer,
 	       0, // not check status
 	       1, // waited op
-
-	       0, lobDataExtractLen_, 
-	       lobDataLen_, lobData_, 
+	       0, lobDataSpecifiedExtractLen_, 
+	       lobDataOutputLen, lobData_, 
 	       1, // open
 	       2); // must open
 
@@ -3064,6 +3078,9 @@ short ExExeUtilLobExtractTcb::work()
 
 	case READ_CURSOR_:
 	  {
+	    if (lobTdb().getToType() == ComTdbExeUtilLobExtract::TO_BUFFER_)
+	      so = Lob_Buffer;
+	    lobDataSpecifiedExtractLen_ = lobTdb().getExtractSize();
 	    retcode = ExpLOBInterfaceSelectCursor
 	      (lobGlobs,
 	       lobName_, 
@@ -3071,16 +3088,18 @@ short ExExeUtilLobExtractTcb::work()
 	       lobType_,
 	       lobTdb().getLobHdfsServer(),
 	       lobTdb().getLobHdfsPort(),
-
 	       lobHandleLen_, lobHandle_,
                0 , //cursor bytes,
 	       NULL, //cursor id
 	       requestTag_, 
+	       so,
 	       0, // not check status
 	       1, // waited op
-
-	       0, lobDataExtractLen_, 
-	       lobDataLen_, lobData_, 
+	       0, 
+	       lobDataSpecifiedExtractLen_, 
+	       //lobDataLen_, lobData_, 
+	       lobDataOutputLen,
+	       lobData_,
 	       2, // read
 	       0); // open type not applicable
 
@@ -3098,19 +3117,22 @@ short ExExeUtilLobExtractTcb::work()
 		break;
 	      }
 
-	    if (lobDataLen_ == 0)
+	    if (lobDataOutputLen == 0)
 	      {
 		step_ = CLOSE_CURSOR_;
 		break;
 	      }
 
-	    remainingBytes_ = (Lng32)lobDataLen_;
+	    remainingBytes_ = (Lng32)lobDataOutputLen;
 	    currPos_ = 0;
 
-            if (lobTdb().getToType() == ComTdbExeUtilLobExtract::TO_FILE_)
-              step_ = INSERT_FROM_STRING_;
-            else
-              step_ = RETURN_STRING_;
+            /*if (lobTdb().getToType() == ComTdbExeUtilLobExtract::TO_FILE_)
+              step_ = INSERT_FROM_STRING_;*/
+            if (lobTdb().getToType() == ComTdbExeUtilLobExtract::TO_BUFFER_)
+	      {
+		str_sprintf(statusString_," Success: LOB data length returned : %d", lobDataOutputLen);
+		step_ = RETURN_STATUS_;
+	      }
 	  }
 	  break;
 
@@ -3128,10 +3150,11 @@ short ExExeUtilLobExtractTcb::work()
                0, //cursor bytes
                NULL, //cursor id
 	       requestTag_, 
+	       so,
 	       0, // not check status
 	       1, // waited op
 
-	       0, lobDataExtractLen_, 
+	       0, lobDataSpecifiedExtractLen_, 
 	       lobDataLen_, lobData_, 
 	       3, // close
                0); // open type not applicable
@@ -3149,7 +3172,6 @@ short ExExeUtilLobExtractTcb::work()
 		step_ = HANDLE_ERROR_;
 		break;
 	      }
-
 	    step_ = DONE_;
 	  }
 	  break;
@@ -3160,7 +3182,7 @@ short ExExeUtilLobExtractTcb::work()
 	    if (qparent_.up->isFull())
 	      return WORK_OK;
 
-	    Lng32 size = MINOF((Lng32)lobTdb().rowSize_, (Lng32)remainingBytes_);
+	    Lng32 size = MINOF((Lng32)lobTdb().extractSize_, (Lng32)remainingBytes_);
 
 	    moveRowToUpQueue(&lobData_[currPos_], size);
 
@@ -3168,7 +3190,10 @@ short ExExeUtilLobExtractTcb::work()
 	    currPos_ += size;
 
 	    if (remainingBytes_ <= 0)
-	      step_ = READ_CURSOR_;
+	      {
+		step_ = READ_CURSOR_;
+		qparent_.down->removeHead();
+	      }
 
 	    return WORK_RESCHEDULE_AND_RETURN;
 	  }
@@ -3182,7 +3207,15 @@ short ExExeUtilLobExtractTcb::work()
        
 	    short rc; 
 	    moveRowToUpQueue(statusString_, 200, &rc);
-	    step_ = DONE_ ;
+
+	    if ((so == Lob_Buffer) && (remainingBytes_ >= 0))
+	      {
+		step_ = READ_CURSOR_;
+		qparent_.down->removeHead();
+		return WORK_RESCHEDULE_AND_RETURN;
+	      }
+	    else
+	      step_ = DONE_ ;
 	  }
 	  break;
 	case HANDLE_ERROR_:
@@ -3295,12 +3328,12 @@ short ExExeUtilFileExtractTcb::work()
 
 	    lobType_ =  lobTdb().lobStorageType_; //(Lng32)Lob_External_HDFS_File;
 
-	    lobDataExtractLen_ = lobTdb().bufSize_; 
+	    lobDataSpecifiedExtractLen_ = lobTdb().totalBufSize_; 
 	   
 
 	    // allocate 2 buffers for double buffering.
-	    lobData_ = new(getHeap()) char[(UInt32)lobDataExtractLen_];
-	    lobData2_ = new(getHeap()) char[(UInt32)lobDataExtractLen_];
+	    lobData_ = new(getHeap()) char[(UInt32)lobDataSpecifiedExtractLen_];
+	    lobData2_ = new(getHeap()) char[(UInt32)lobDataSpecifiedExtractLen_];
 
 	    eodReturned_ = FALSE;
 
@@ -3323,10 +3356,11 @@ short ExExeUtilFileExtractTcb::work()
 	       0, NULL, // handleLen, handle
                0, NULL, //cursor bytes, cursor id
 	       requestTag_, 
+	       Lob_File,
 	       0, // not check status
 	       1, // waited op
 
-	       0, lobDataExtractLen_, 
+	       0, lobDataSpecifiedExtractLen_, 
 	       lobDataLen_, lobData_, 
 	       1, // open
 	       2); // must open
@@ -3369,10 +3403,11 @@ short ExExeUtilFileExtractTcb::work()
 	       0, NULL,
                0, NULL ,//cursor bytes, cursor id
 	       requestTag_, 
+	       Lob_File,
 	       0, // not check status
 	       1, // waited op
 
-	       0, lobDataExtractLen_, 
+	       0, lobDataSpecifiedExtractLen_, 
 	       lobDataLen_, lobData_, 
 	       2, // read
 	       0); // open type not applicable
@@ -3400,7 +3435,7 @@ short ExExeUtilFileExtractTcb::work()
 		break;
 	      }
 
-	    if (lobDataLen_ < lobDataExtractLen_)
+	    if (lobDataLen_ < lobDataSpecifiedExtractLen_)
 	      {
 		// EOD with data: return data and then close cursor
 		eodReturned_ = TRUE;
@@ -3426,10 +3461,10 @@ short ExExeUtilFileExtractTcb::work()
 	       0, NULL,
                0, NULL, //cursor bytes, cursor id
 	       requestTag_, 
+	       Lob_File,
 	       0, // not check status
 	       1, // waited op
-
-	       0, lobDataExtractLen_, 
+	       0, lobDataSpecifiedExtractLen_, 
 	       lobDataLen_, lobData_, 
 	       3, // close
                0); // open type not applicable
@@ -3457,7 +3492,7 @@ short ExExeUtilFileExtractTcb::work()
 	    if (qparent_.up->isFull())
 	      return WORK_OK;
 
-	    Lng32 size = MINOF((Lng32)lobTdb().rowSize_, (Lng32)remainingBytes_);
+	    Lng32 size = MINOF((Lng32)lobTdb().extractSize_, (Lng32)remainingBytes_);
 
 	    // eval expression to convert lob data to sql row.
 	    // TBD.
@@ -3576,10 +3611,10 @@ short ExExeUtilFileLoadTcb::work()
 
 	    lobType_ =  lobTdb().lobStorageType_; //(Lng32)Lob_HDFS_File;
 
-	    lobDataExtractLen_ = lobTdb().bufSize_; 
+	    lobDataSpecifiedExtractLen_ = lobTdb().totalBufSize_; 
 	    
 
-	    lobData_ = new(getHeap()) char[(UInt32)lobDataExtractLen_];
+	    lobData_ = new(getHeap()) char[(UInt32)lobDataSpecifiedExtractLen_];
 
 	    srcFileRemainingBytes_ = 0;
 
@@ -3667,7 +3702,7 @@ short ExExeUtilFileLoadTcb::work()
 		break;
 	      }
 	      
-	    Int64 length = MINOF(srcFileRemainingBytes_, lobDataExtractLen_);
+	    Int64 length = MINOF(srcFileRemainingBytes_, lobDataSpecifiedExtractLen_);
 
 	    indata_.read (lobData_, (std::streamsize)length);
 	      

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/5cfc9fa4/core/sql/executor/ExHdfsScan.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExHdfsScan.cpp b/core/sql/executor/ExHdfsScan.cpp
index 71c0118..7904ce2 100644
--- a/core/sql/executor/ExHdfsScan.cpp
+++ b/core/sql/executor/ExHdfsScan.cpp
@@ -498,7 +498,7 @@ ExWorkProcRetcode ExHdfsScanTcb::work()
                    bytesLeft_, // max bytes
                    cursorId_, 
 		       
-                   requestTag_, 
+                   requestTag_, Lob_Memory,
                    0, // not check status
                    (NOT hdfsScanTdb().hdfsPrefetch()),  //1, // waited op
 		       
@@ -531,7 +531,7 @@ ExWorkProcRetcode ExHdfsScanTcb::work()
                        hdfo->getBytesToRead(), // max bytes
                        cursorId, 
                            
-                       requestTag_, 
+                       requestTag_, Lob_Memory,
                        0, // not check status
                        (NOT hdfsScanTdb().hdfsPrefetch()),  //1, // waited op
                            
@@ -637,7 +637,7 @@ ExWorkProcRetcode ExHdfsScanTcb::work()
                    0, NULL,		       
                    0, cursorId_,
 		       
-                   requestTag_, 
+                   requestTag_, Lob_Memory,
                    0, // not check status
                    (NOT hdfsScanTdb().hdfsPrefetch()),  //1, // waited op
 		       
@@ -1149,7 +1149,7 @@ ExWorkProcRetcode ExHdfsScanTcb::work()
                    0,NULL, //handle not relevant for non lob access
                    0, cursorId_,
 		       
-                   requestTag_, 
+                   requestTag_, Lob_Memory,
                    0, // not check status
                    (NOT hdfsScanTdb().hdfsPrefetch()),  //1, // waited op
 		       

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/5cfc9fa4/core/sql/exp/ExpLOBaccess.cpp
----------------------------------------------------------------------
diff --git a/core/sql/exp/ExpLOBaccess.cpp b/core/sql/exp/ExpLOBaccess.cpp
index c1df357..b52f183 100644
--- a/core/sql/exp/ExpLOBaccess.cpp
+++ b/core/sql/exp/ExpLOBaccess.cpp
@@ -2769,7 +2769,7 @@ Ex_Lob_Error ExLobsOper (
       break;
 
     case Lob_ReadCursor:
-      if (subOperation == Lob_Memory)
+      if ((subOperation == Lob_Memory) || (subOperation == Lob_Buffer))
 	err = lobPtr->readCursor(source, sourceLen, handleIn, handleInLen, retOperLen);
       else if (subOperation == Lob_File)
 	err = lobPtr->readCursor(source, -1, handleIn, handleInLen, retOperLen);

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/5cfc9fa4/core/sql/exp/ExpLOBenums.h
----------------------------------------------------------------------
diff --git a/core/sql/exp/ExpLOBenums.h b/core/sql/exp/ExpLOBenums.h
index dcdddb8..67f5f43 100644
--- a/core/sql/exp/ExpLOBenums.h
+++ b/core/sql/exp/ExpLOBenums.h
@@ -173,6 +173,7 @@ typedef enum {
    Lob_None,
    Lob_File,
    Lob_Memory,
+   Lob_Buffer,
    Lob_Foreign_Lob
 } LobsSubOper;
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/5cfc9fa4/core/sql/exp/ExpLOBinterface.cpp
----------------------------------------------------------------------
diff --git a/core/sql/exp/ExpLOBinterface.cpp b/core/sql/exp/ExpLOBinterface.cpp
index fafeabb..1790a50 100644
--- a/core/sql/exp/ExpLOBinterface.cpp
+++ b/core/sql/exp/ExpLOBinterface.cpp
@@ -792,6 +792,7 @@ Lng32 ExpLOBInterfaceSelectCursor(void * lobGlob,
 				  char *cursorId,
 				  
 				  Int64 &requestTag,
+				  LobsSubOper so,
 				  Lng32 checkStatus,
 				  Lng32 waitedOp,
 
@@ -810,7 +811,7 @@ Lng32 ExpLOBInterfaceSelectCursor(void * lobGlob,
   
   LobsOper lo;
 
-  //if (lobHandle == NULL)
+  if (lobHandle == NULL)
     {
       if (oper == 1)
 	lo = Lob_OpenDataCursorSimple;
@@ -821,7 +822,7 @@ Lng32 ExpLOBInterfaceSelectCursor(void * lobGlob,
       else
 	return -1;
     }
-  /*else
+  else
     {
       if (oper == 1)
 	lo = Lob_OpenCursor;
@@ -832,7 +833,7 @@ Lng32 ExpLOBInterfaceSelectCursor(void * lobGlob,
       else
 	return -1;
     }
-*/
+
   if (checkStatus)
     lo = Lob_Check_Status;
   else
@@ -852,7 +853,7 @@ Lng32 ExpLOBInterfaceSelectCursor(void * lobGlob,
 		   lobData, inLen, 
 		   cursorBytes,cursorId,
 		   lo,
-		   Lob_Memory,
+		   so,
                    waitedOp,
 		   lobGlob,
 		   0,

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/5cfc9fa4/core/sql/exp/ExpLOBinterface.h
----------------------------------------------------------------------
diff --git a/core/sql/exp/ExpLOBinterface.h b/core/sql/exp/ExpLOBinterface.h
index 2afe55e..646d846 100644
--- a/core/sql/exp/ExpLOBinterface.h
+++ b/core/sql/exp/ExpLOBinterface.h
@@ -265,6 +265,7 @@ Lng32 ExpLOBInterfaceSelectCursor(void * lobGlob,
 				  Int64 cusrorBytes,
 				  char *cursorId,
 				  Int64 &requestTag,
+				  LobsSubOper so,
 				  Lng32 checkStatus,
 				  Lng32 waitedOp,
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/5cfc9fa4/core/sql/generator/GenRelExeUtil.cpp
----------------------------------------------------------------------
diff --git a/core/sql/generator/GenRelExeUtil.cpp b/core/sql/generator/GenRelExeUtil.cpp
index ba307b2..d1b73e2 100644
--- a/core/sql/generator/GenRelExeUtil.cpp
+++ b/core/sql/generator/GenRelExeUtil.cpp
@@ -3680,11 +3680,14 @@ short ExeUtilLobExtract::codeGen(Generator * generator)
      handle,
      handleLen,
      (toType_ == TO_BUFFER_ ? ComTdbExeUtilLobExtract::TO_BUFFER_ :
-      (toType_ == TO_STRING_ ? ComTdbExeUtilLobExtract::TO_STRING_ :
-       (toType_ == TO_FILE_ ? ComTdbExeUtilLobExtract::TO_FILE_ :
+      (toType_ == RETRIEVE_LENGTH_ ? ComTdbExeUtilLobExtract::RETRIEVE_LENGTH_ :
+       (toType_ == TO_STRING_ ? ComTdbExeUtilLobExtract::TO_STRING_ :
+	(toType_ == TO_FILE_ ? ComTdbExeUtilLobExtract::TO_FILE_ :
 	(toType_ == TO_EXTERNAL_FROM_STRING_ ? ComTdbExeUtilLobExtract::TO_EXTERNAL_FROM_STRING_ :
 	 (toType_ == TO_EXTERNAL_FROM_FILE_ ? ComTdbExeUtilLobExtract::TO_EXTERNAL_FROM_FILE_ :
-	  ComTdbExeUtilLobExtract::NOOP_))))),
+	  ComTdbExeUtilLobExtract::NOOP_)))))),
+     bufAddr_,
+     extractSize_,
      intParam_,
      intParam2_,
      lst,
@@ -3741,7 +3744,7 @@ if (handleInStringFormat_)
     {
       exe_util_tdb->setRetrieveLength(TRUE);
     }
-  exe_util_tdb->setBufSize(CmpCommon::getDefaultNumeric(LOB_MAX_CHUNK_MEM_SIZE));
+  exe_util_tdb->setTotalBufSize(CmpCommon::getDefaultNumeric(LOB_MAX_CHUNK_MEM_SIZE));
 
   generator->setCriDesc(givenDesc, Generator::DOWN);
   generator->setCriDesc(returnedDesc, Generator::UP);

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/5cfc9fa4/core/sql/generator/GenRelMisc.cpp
----------------------------------------------------------------------
diff --git a/core/sql/generator/GenRelMisc.cpp b/core/sql/generator/GenRelMisc.cpp
index d2879b2..2580eab 100644
--- a/core/sql/generator/GenRelMisc.cpp
+++ b/core/sql/generator/GenRelMisc.cpp
@@ -2519,6 +2519,10 @@ short RelRoot::codeGen(Generator * generator)
        {
          root_tdb->setSubqueryType(ComTdbRoot::SQL_STMT_HBASE_UNLOAD);
        }
+       else if (exeUtil->getExeUtilType() == ExeUtilExpr::LOB_EXTRACT_)
+	 {
+	   root_tdb->setSubqueryType(ComTdbRoot::SQL_STMT_LOB_EXTRACT);
+	 }
 
       else if (exeUtil->isExeUtilQueryType())
 	{

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/5cfc9fa4/core/sql/nskgmake/Makerules.linux
----------------------------------------------------------------------
diff --git a/core/sql/nskgmake/Makerules.linux b/core/sql/nskgmake/Makerules.linux
index f56d9d1..2db10b1 100755
--- a/core/sql/nskgmake/Makerules.linux
+++ b/core/sql/nskgmake/Makerules.linux
@@ -139,7 +139,7 @@ GLOBAL_SYS_LIBS := -L $(LOC_JVMLIBS) $(LIBHDFS_LIB) $(THRIFT_LIB) $(LIBCURL_LIB)
 
 # EXECUTABLES defines the executables that are built for release and debug
 # builds.  Any flavor-specific targets can be added later in this makefile.
-EXECUTABLES= arkcmp sqlci arkesp tdm_udrserv mxlobsrvr sscp ssmp
+EXECUTABLES= arkcmp sqlci arkesp tdm_udrserv mxlobsrvr sscp ssmp clitestdriver
 	# mxCompileUserModule mxsqlcfe mxsqlcofe sqlfe
 
 # LIBS defines the libraries that are built for release and debug builds.
@@ -150,7 +150,7 @@ DLLS := comexe common executor sort sqlmsg \
 	tdm_sqlmxevents tdm_sqlshare tdm_sqlerrormsg \
 	eh lmcomp \
 	sqlcilib cli porting_layer tdm_sqlmxmsg_intl \
-	arkcmp_dll smdio udr_predef
+	arkcmp_dll smdio udr_predef clitest
 
 DLLS += sqlcomp ustat sqlcat parser optimizer generator \
 	tdm_sqllangman arkcmplib qmscommon

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/5cfc9fa4/core/sql/nskgmake/clitest/Makefile
----------------------------------------------------------------------
diff --git a/core/sql/nskgmake/clitest/Makefile b/core/sql/nskgmake/clitest/Makefile
index ffde7d4..d129541 100755
--- a/core/sql/nskgmake/clitest/Makefile
+++ b/core/sql/nskgmake/clitest/Makefile
@@ -22,7 +22,8 @@
 #######################################################################
 
 CPPSRC := \
-        blobtest.cpp 
+        blobtest.cpp \
+	vers_libclitest.cpp
        
 CPPSRC += mpisetup.cpp 
 SRCPATH := clitest bin 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/5cfc9fa4/core/sql/nskgmake/clitestdriver/Makefile
----------------------------------------------------------------------
diff --git a/core/sql/nskgmake/clitestdriver/Makefile b/core/sql/nskgmake/clitestdriver/Makefile
index c07a510..d2ffa3e 100755
--- a/core/sql/nskgmake/clitestdriver/Makefile
+++ b/core/sql/nskgmake/clitestdriver/Makefile
@@ -28,7 +28,7 @@ EARLY_DLLS:= -ljsig
 
 DEP_LIBS += tdm_sqlcli arkcmp_dll clitest
 
-CPPSRC += vprocsqlci.cpp
+CPPSRC += vprocclitestdriver.cpp
 
 
 SRCPATH := clitest bin

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/5cfc9fa4/core/sql/optimizer/RelExeUtil.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/RelExeUtil.cpp b/core/sql/optimizer/RelExeUtil.cpp
index 55a5210..3690c6f 100644
--- a/core/sql/optimizer/RelExeUtil.cpp
+++ b/core/sql/optimizer/RelExeUtil.cpp
@@ -5204,8 +5204,8 @@ RelExpr * ExeUtilLobExtract::copyTopNode(RelExpr *derivedNode, CollHeap* outHeap
 
   result->handle_ = handle_;
   result->toType_ = toType_;
-  result->bufAddrExpr_ = bufAddrExpr_;
-  result->bufSizeExpr_ = bufSizeExpr_;
+  result->bufAddr_ = bufAddr_;
+  result->extractSize_ = extractSize_;
   result->intParam_ = intParam_;
   result->intParam2_ = intParam2_;
   result->stringParam_ = stringParam_;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/5cfc9fa4/core/sql/optimizer/RelExeUtil.h
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/RelExeUtil.h b/core/sql/optimizer/RelExeUtil.h
index 7a3e976..28edeba 100644
--- a/core/sql/optimizer/RelExeUtil.h
+++ b/core/sql/optimizer/RelExeUtil.h
@@ -1870,8 +1870,8 @@ public:
   
  ExeUtilLobExtract(ItemExpr * handle, 
 		   ExtractToType toType,
-		   ItemExpr * bufaddr,
-		   ItemExpr * bufsize,
+		   Int64 bufaddr=0,
+		   Int64 extractSize=0,
 		   Int64 intParam = 0,
 		   Int64 intParam2 = 0,
 		   char * stringParam = NULL,
@@ -1884,8 +1884,8 @@ public:
 		 NULL, CharInfo::UnknownCharSet, oHeap),
     handle_(handle),
     toType_(toType),
-    bufAddrExpr_(bufaddr),
-    bufSizeExpr_(bufsize),
+    bufAddr_(bufaddr),
+    extractSize_(extractSize),
     intParam_(intParam),
     intParam2_(intParam2),
     handleInStringFormat_(TRUE),
@@ -1941,8 +1941,8 @@ public:
   ItemExpr * handle_;
   ExtractToType toType_;
   
-  ItemExpr * bufAddrExpr_;
-  ItemExpr * bufSizeExpr_;
+  Int64 bufAddr_;
+  Int64 extractSize_;
   
   Int64 intParam_;   // options for create or size limit
   Int64 intParam2_;// options for file behavior

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/5cfc9fa4/core/sql/parser/sqlparser.y
----------------------------------------------------------------------
diff --git a/core/sql/parser/sqlparser.y b/core/sql/parser/sqlparser.y
index e7166cf..6c686b4 100755
--- a/core/sql/parser/sqlparser.y
+++ b/core/sql/parser/sqlparser.y
@@ -15583,15 +15583,15 @@ exe_util_populate_in_memory_statistics : TOK_GENERATE TOK_STATISTICS TOK_FOR TOK
 	       }
 
 /* type relx */
-exe_util_lob_extract : TOK_EXTRACT TOK_LOBLENGTH '(' TOK_LOB QUOTED_STRING  ')'
+exe_util_lob_extract : TOK_EXTRACT TOK_LOBLENGTH '(' TOK_LOB QUOTED_STRING  ')' TOK_LOCATION NUMERIC_LITERAL_EXACT_NO_SCALE
                {
 		 ConstValue * handle = new(PARSERHEAP()) ConstValue(*$5);
-
+		 Int64 returnLengthAddr = atoInt64($8->data());
 		 ExeUtilLobExtract * lle =
 		   new (PARSERHEAP ()) ExeUtilLobExtract
 		   (handle, 
 		    ExeUtilLobExtract::RETRIEVE_LENGTH_,
-		    NULL, NULL, 0, 0);
+		    returnLengthAddr, NULL, 0, 0);
 
 		 $$ = lle;
 	       }
@@ -15614,9 +15614,9 @@ exe_util_lob_extract : TOK_EXTRACT TOK_LOBLENGTH '(' TOK_LOB QUOTED_STRING  ')'
 		 */
 	       }
 
-              | TOK_EXTRACT TOK_LOBTOBUFFER '(' TOK_LOB QUOTED_STRING ',' TOK_LOCATION value_expression ',' TOK_SIZE value_expression ')'
+              | TOK_EXTRACT TOK_LOBTOBUFFER '(' TOK_LOB QUOTED_STRING ',' TOK_LOCATION NUMERIC_LITERAL_EXACT_NO_SCALE ',' TOK_SIZE NUMERIC_LITERAL_EXACT_NO_SCALE ')'
                {
-                 if (NOT (($8->getOperatorType() == ITM_DYN_PARAM) ||
+		 /* if (NOT (($8->getOperatorType() == ITM_DYN_PARAM) ||
                           ($8->getOperatorType() == ITM_CONSTANT)))
                    {
                      YYERROR;
@@ -15626,23 +15626,24 @@ exe_util_lob_extract : TOK_EXTRACT TOK_LOBLENGTH '(' TOK_LOB QUOTED_STRING  ')'
                           ($11->getOperatorType() == ITM_CONSTANT)))
                    {
                      YYERROR;
-                   }
-
-                 ItemExpr * bufaddr = $8;
+		     }*/
+		 Int64 bufAddr = atoInt64($8->data());
+		 Int64 bufSize = atoInt64($11->data());
+		 /* ItemExpr * bufaddr = $8;
 		 bufaddr = new (PARSERHEAP()) 
 		   Cast(bufaddr, new (PARSERHEAP()) SQLLargeInt(TRUE, FALSE));
 
 		 ItemExpr * bufsize = $11;
 		 bufsize = new (PARSERHEAP()) 
 		   Cast(bufsize, new (PARSERHEAP()) SQLLargeInt(TRUE, FALSE));
-
+		 */
 		 ConstValue * handle = new(PARSERHEAP()) ConstValue(*$5);
 
 		 ExeUtilLobExtract * lle =
 		   new (PARSERHEAP ()) ExeUtilLobExtract
 		   (handle, 
 		    ExeUtilLobExtract::TO_BUFFER_,
-		    bufaddr, bufsize, 0, 0);
+		    bufAddr, bufSize, 0, 0);
 
 		 $$ = lle;
 	       }


[12/13] incubator-trafodion git commit: Remvoving erroneous backup file.

Posted by sa...@apache.org.
Remvoving erroneous backup file.


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

Branch: refs/heads/master
Commit: f36566710f430d48616a0ec9de1efbb1752007ee
Parents: 53a6473
Author: Sandhya Sundaresan <sa...@apache.org>
Authored: Fri Jan 8 04:11:27 2016 +0000
Committer: Sandhya Sundaresan <sa...@apache.org>
Committed: Fri Jan 8 04:11:27 2016 +0000

----------------------------------------------------------------------
 core/sql/nskgmake/clitest/Makefile~ | 35 --------------------------------
 1 file changed, 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/f3656671/core/sql/nskgmake/clitest/Makefile~
----------------------------------------------------------------------
diff --git a/core/sql/nskgmake/clitest/Makefile~ b/core/sql/nskgmake/clitest/Makefile~
deleted file mode 100755
index 767ebdc..0000000
--- a/core/sql/nskgmake/clitest/Makefile~
+++ /dev/null
@@ -1,35 +0,0 @@
-#######################################################################
-# @@@ START COPYRIGHT @@@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-# @@@ END COPYRIGHT @@@
-#######################################################################
-
-CPPSRC := SqlciMain.cpp \
-	MxciEHCallBack.cpp
-
-EARLY_DLLS:= -ljsig
-
-DEP_LIBS += tdm_sqlcli sqlcilib arkcmp_dll
-
-CPPSRC += vprocsqlci.cpp
-
-
-SRCPATH := sqlci bin
-


[10/13] incubator-trafodion git commit: added copyrights to new testdriver files

Posted by sa...@apache.org.
added copyrights to new testdriver files


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

Branch: refs/heads/master
Commit: 13f897e8f6600138fd4a73594847a40faa328e40
Parents: fd80e81
Author: Sandhya Sundaresan <sa...@apache.org>
Authored: Tue Jan 5 21:42:39 2016 +0000
Committer: Sandhya Sundaresan <sa...@apache.org>
Committed: Tue Jan 5 21:42:39 2016 +0000

----------------------------------------------------------------------
 core/sql/clitest/blobtest.cpp | 33 +++++++++++++++++++++++++++++++++
 core/sql/clitest/blobtest.h   | 34 ++++++++++++++++++++++++++++++++++
 2 files changed, 67 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/13f897e8/core/sql/clitest/blobtest.cpp
----------------------------------------------------------------------
diff --git a/core/sql/clitest/blobtest.cpp b/core/sql/clitest/blobtest.cpp
index d92674f..bd787f5 100644
--- a/core/sql/clitest/blobtest.cpp
+++ b/core/sql/clitest/blobtest.cpp
@@ -1,3 +1,36 @@
+/**********************************************************************
+// @@@ START COPYRIGHT @@@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+// @@@ END COPYRIGHT @@@
+**********************************************************************/
+/* -*-C++-*-
+****************************************************************************
+*
+* File:         Helper functions for use by bin/clitest.cpp
+* Description:  Test driver useing exe util cli interface
+*
+*
+*
+*
+****************************************************************************
+*/
 #include "blobtest.h"
 
 Int32 extractLengthOfLobColumn(CliGlobals *cliglob, char *lobHandle, 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/13f897e8/core/sql/clitest/blobtest.h
----------------------------------------------------------------------
diff --git a/core/sql/clitest/blobtest.h b/core/sql/clitest/blobtest.h
index 3832ee6..4faa4b3 100644
--- a/core/sql/clitest/blobtest.h
+++ b/core/sql/clitest/blobtest.h
@@ -1,3 +1,37 @@
+/**********************************************************************
+// @@@ START COPYRIGHT @@@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+// @@@ END COPYRIGHT @@@
+**********************************************************************/
+/* -*-C++-*-
+****************************************************************************
+*
+* File:         Healper functions for use in bin/clitest.cpp
+* Description:  Test driver functions useing exe util cli interface
+*
+*
+*
+*
+****************************************************************************
+*/
+
 #include <iostream>
 #include <stdio.h>
 #include <stdlib.h>


[11/13] incubator-trafodion git commit: Review comments incorporated

Posted by sa...@apache.org.
Review comments incorporated


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

Branch: refs/heads/master
Commit: 53a647345f85db005c5b0d39d8531748ad546ee5
Parents: 13f897e
Author: Sandhya Sundaresan <sa...@apache.org>
Authored: Wed Jan 6 16:50:24 2016 +0000
Committer: Sandhya Sundaresan <sa...@apache.org>
Committed: Wed Jan 6 16:50:24 2016 +0000

----------------------------------------------------------------------
 core/sql/clitest/blobtest.cpp             | 24 +++++++--
 core/sql/comexe/ComTdbExeUtil.cpp         | 10 +---
 core/sql/executor/ExExeUtilCli.cpp        | 69 --------------------------
 core/sql/executor/ExExeUtilCli.h          |  6 +--
 core/sql/executor/ExExeUtilLoad.cpp       | 53 ++++++++++----------
 core/sql/nskgmake/clitestdriver/Makefile~ | 35 -------------
 6 files changed, 48 insertions(+), 149 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/53a64734/core/sql/clitest/blobtest.cpp
----------------------------------------------------------------------
diff --git a/core/sql/clitest/blobtest.cpp b/core/sql/clitest/blobtest.cpp
index bd787f5..5bcba01 100644
--- a/core/sql/clitest/blobtest.cpp
+++ b/core/sql/clitest/blobtest.cpp
@@ -63,8 +63,6 @@ Int32 extractLobHandle(CliGlobals *cliglob, char *& lobHandle,
   
   retcode = cliInterface.executeImmediate(query,lobHandle,&lobHandleLen,FALSE);
 
-  if (retcode)
-    return retcode;
   lobHandle[lobHandleLen]='\0';
   delete query;
   
@@ -182,7 +180,13 @@ Int32 insertBufferToLob(CliGlobals *cliglob, char *tableName)
  
   retcode = cliInterface.executeImmediate(query);
   if (retcode <0)
-    return retcode;
+    {
+      cliInterface.executeImmediate("rollback work");
+      delete query;
+      delete lobDataBuf;
+    
+      return retcode;
+    }
 
   retcode = cliInterface.executeImmediate("commit work");
   delete query;
@@ -212,7 +216,12 @@ Int32 updateBufferToLob(CliGlobals *cliglob, char *tableName, char *columnName)
  
   retcode = cliInterface.executeImmediate(query);
   if (retcode <0)
-    return retcode;
+    {
+      cliInterface.executeImmediate("rollback work");
+      delete query;
+      delete lobDataBuf;
+      return retcode;
+    }
 
   retcode = cliInterface.executeImmediate("commit work");
   delete query;
@@ -243,7 +252,12 @@ Int32 updateAppendBufferToLob(CliGlobals *cliglob, char *tableName, char *column
  
   retcode = cliInterface.executeImmediate(query);
   if (retcode <0)
-    return retcode;
+    {
+      cliInterface.executeImmediate("rollback work");
+      delete query;
+      delete lobDataBuf;
+      return retcode;
+    }
 
   retcode = cliInterface.executeImmediate("commit work");
   delete query;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/53a64734/core/sql/comexe/ComTdbExeUtil.cpp
----------------------------------------------------------------------
diff --git a/core/sql/comexe/ComTdbExeUtil.cpp b/core/sql/comexe/ComTdbExeUtil.cpp
index 53661a4..b1bc62a 100644
--- a/core/sql/comexe/ComTdbExeUtil.cpp
+++ b/core/sql/comexe/ComTdbExeUtil.cpp
@@ -2245,15 +2245,7 @@ ComTdbExeUtilLobExtract::ComTdbExeUtilLobExtract
     flags_(0)
 {
   setNodeType(ComTdb::ex_LOB_EXTRACT);
-  if ((toType_ == ExtractToType::TO_BUFFER_) || (toType_ == ExtractToType::TO_STRING_))
-    {
-      /*// intparam1 contains the rowsize passed in via syntax
-      // intparam2 constains the total buf size user has allocated
-      rowSize_ = intParam1;
-      bufSize_ = intParam2; */
-      
-    }
-    else if (toType_ == ExtractToType::TO_FILE_)
+  if (toType_ == ExtractToType::TO_FILE_)
       {
 	// extractSize_ is irrelevant since the whole lob will be read into the output file
 	// bufAddr_ is not passed in by user. It is a CQD value LOB_OUTPUT_SIZE

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/53a64734/core/sql/executor/ExExeUtilCli.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExExeUtilCli.cpp b/core/sql/executor/ExExeUtilCli.cpp
index b42715f..451d884 100644
--- a/core/sql/executor/ExExeUtilCli.cpp
+++ b/core/sql/executor/ExExeUtilCli.cpp
@@ -1053,76 +1053,7 @@ Lng32 ExeCliInterface::executeImmediateExec(const char * stmtStr,
 }
 
 
-Lng32 ExeCliInterface::executeImmediateExecNoDealloc(const char * stmtStr,
-					   char * outputBuf,
-					   Lng32 * outputBufLen,
-					   NABoolean nullTerminate,
-					   Int64 * rowsAffected 
-					   )
-{
-  Lng32 retcode = 0;
-
-  retcode = exec();
-  if (retcode < 0)
-    {
-      deallocStuff(module_, stmt_, sql_src_, input_desc_, output_desc_);
-      return retcode;
-    }
-
-  retcode = fetch();
-  if (retcode < 0)
-    {
-      deallocStuff(module_, stmt_, sql_src_, input_desc_, output_desc_);
-      return retcode;
-    }
-
-  if ((outputBuf) &&
-      (outputBufLen))
-    {
-      *outputBufLen = 0;
-      if (retcode != 100)
-	{
-	  char * ptr;
-	  Lng32 len;
-	  getPtrAndLen(1, ptr, len);
-
-	  str_cpy_all(outputBuf, ptr, len);
-	  
-	  if (nullTerminate)
-	    outputBuf[len] = 0;
-	  *outputBufLen = len;
-	}
-    }
-
-  Lng32 cliRetcode = -1;
-  if (retcode >= 0)
-  {
-    cliRetcode = retcode;
-    if (rowsAffected)
-    {
-      Int64 tmpRowsAffected = 0;
-      retcode = SQL_EXEC_GetDiagnosticsStmtInfo2(NULL, SQLDIAG_ROW_COUNT,
-        &tmpRowsAffected, NULL,
-        0, NULL);
 
-      if(retcode == EXE_NUMERIC_OVERFLOW) 
-      {
-        GetRowsAffected(rowsAffected);
-      }
-      else
-        *rowsAffected = tmpRowsAffected;
-    }
-  }
-
-  clearGlobalDiags();
-
-  retcode = close();
-
-  /*deallocStuff(module_, stmt_, sql_src_, input_desc_, output_desc_);
-
-  clearGlobalDiags();*/
-  return ((cliRetcode != -1) ? cliRetcode : retcode);
-}
 Lng32 ExeCliInterface::executeImmediate(const char * stmtStr,
 				       char * outputBuf,
 				       Lng32 * outputBufLen,

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/53a64734/core/sql/executor/ExExeUtilCli.h
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExExeUtilCli.h b/core/sql/executor/ExExeUtilCli.h
index b94c61b..13feebe 100644
--- a/core/sql/executor/ExExeUtilCli.h
+++ b/core/sql/executor/ExExeUtilCli.h
@@ -100,11 +100,7 @@ private:
                             Lng32 * outputBufLen = NULL,
                             NABoolean nullTerminate = TRUE,
                             Int64 * rowsAffected = NULL);
-  Lng32 executeImmediateExecNoDealloc(const char * stmt,
-                            char * outputBuf = NULL,
-                            Lng32 * outputBufLen = NULL,
-                            NABoolean nullTerminate = TRUE,
-                            Int64 * rowsAffected = NULL);
+ 
   Lng32 prepare(const char * stmtStr,
 		SQLMODULE_ID * module,
 		SQLSTMT_ID * stmt,

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/53a64734/core/sql/executor/ExExeUtilLoad.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExExeUtilLoad.cpp b/core/sql/executor/ExExeUtilLoad.cpp
index aa509ec..1db4bee 100644
--- a/core/sql/executor/ExExeUtilLoad.cpp
+++ b/core/sql/executor/ExExeUtilLoad.cpp
@@ -2895,7 +2895,19 @@ short ExExeUtilLobExtractTcb::work()
 	    else
 	      if ((lobTdb().getToType() == ComTdbExeUtilLobExtract::RETRIEVE_LENGTH_) || (lobTdb().getToType() == ComTdbExeUtilLobExtract::TO_FILE_))
 	      step_ = RETRIEVE_LOB_LENGTH_;
-	    
+	      else
+		{
+		  // invalid "toType"
+		  ex_queue_entry * up_entry = qparent_.up->getTailEntry();
+		  ComDiagsArea * da = up_entry->getDiagsArea();
+		  ExRaiseSqlError(getMyHeap(),
+				  &da,
+				  (ExeErrorCode)(EXE_INTERNAL_ERROR));
+		  step_ = CANCEL_;
+		
+		break;
+
+		}
 	    break;
 	  }
 	case RETRIEVE_LOB_LENGTH_ : 
@@ -3128,8 +3140,7 @@ short ExExeUtilLobExtractTcb::work()
 	    remainingBytes_ = (Lng32)lobDataOutputLen;
 	    currPos_ = 0;
 
-            /*if (lobTdb().getToType() == ComTdbExeUtilLobExtract::TO_FILE_)
-              step_ = INSERT_FROM_STRING_;*/
+            
             if (lobTdb().getToType() == ComTdbExeUtilLobExtract::TO_BUFFER_)
 	      {
 		str_sprintf(statusString_," Success: LOB data length returned : %d", lobDataOutputLen);
@@ -3138,6 +3149,19 @@ short ExExeUtilLobExtractTcb::work()
 		memcpy((char *)lobTdb().dataExtractSizeIOAddr(), (char *)&lobDataOutputLen,sizeof(Int64));
 		step_ = RETURN_STATUS_;
 	      }
+	    else
+	      {
+		// No other "toType" shoudl reach here - i.e TO_FILE_ or TO_STRING
+		ex_queue_entry * up_entry = qparent_.up->getTailEntry();
+		ComDiagsArea * da = up_entry->getDiagsArea();
+		ExRaiseSqlError(getMyHeap(),
+				&da,
+				(ExeErrorCode)(EXE_INTERNAL_ERROR));
+		step_ = CANCEL_;
+		
+		break;
+		
+	      }
 	  }
 	  break;
 
@@ -3491,29 +3515,6 @@ short ExExeUtilFileExtractTcb::work()
 	  }
 	  break;
 
-
-	  /*case RETURN_STRING_:
-	  {
-	    if (qparent_.up->isFull())
-	      return WORK_OK;
-
-	    Lng32 size = MINOF((Lng32)lobTdb().dataExtractSizeIOAddr(), (Lng32)remainingBytes_);
-
-	    // eval expression to convert lob data to sql row.
-	    // TBD.
-
-	    moveRowToUpQueue(&lobData_[currPos_], size);
-
-	    remainingBytes_ -= size;
-	    currPos_ += size;
-
-	    if (remainingBytes_ <= 0)
-	      step_ = READ_CURSOR_;
-
-	    return WORK_RESCHEDULE_AND_RETURN;
-	  }
-	  break;*/
-
 	case HANDLE_ERROR_:
 	  {
 	    retcode = handleError();

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/53a64734/core/sql/nskgmake/clitestdriver/Makefile~
----------------------------------------------------------------------
diff --git a/core/sql/nskgmake/clitestdriver/Makefile~ b/core/sql/nskgmake/clitestdriver/Makefile~
deleted file mode 100755
index 767ebdc..0000000
--- a/core/sql/nskgmake/clitestdriver/Makefile~
+++ /dev/null
@@ -1,35 +0,0 @@
-#######################################################################
-# @@@ START COPYRIGHT @@@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-# @@@ END COPYRIGHT @@@
-#######################################################################
-
-CPPSRC := SqlciMain.cpp \
-	MxciEHCallBack.cpp
-
-EARLY_DLLS:= -ljsig
-
-DEP_LIBS += tdm_sqlcli sqlcilib arkcmp_dll
-
-CPPSRC += vprocsqlci.cpp
-
-
-SRCPATH := sqlci bin
-


[05/13] incubator-trafodion git commit: Regression test for testing the programmatic interface for extracting lob data into buffer like a cursor.

Posted by sa...@apache.org.
Regression test for testing the programmatic interface for extracting lob data  into buffer like a cursor.


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

Branch: refs/heads/master
Commit: e4f391f3dff713cf5b24c1e3860cfdc220a3a557
Parents: 781682a
Author: Sandhya Sundaresan <sa...@apache.org>
Authored: Thu Dec 17 05:29:49 2015 +0000
Committer: Sandhya Sundaresan <sa...@apache.org>
Committed: Thu Dec 17 05:29:49 2015 +0000

----------------------------------------------------------------------
 core/sql/bin/clitest.cpp                  |  10 +-
 core/sql/regress/executor/EXPECTED130     | 204 +++++++++++++++++++++++--
 core/sql/regress/executor/TEST130         |   8 +-
 core/sql/regress/executor/TEST130_argfile |   3 +
 4 files changed, 202 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/e4f391f3/core/sql/bin/clitest.cpp
----------------------------------------------------------------------
diff --git a/core/sql/bin/clitest.cpp b/core/sql/bin/clitest.cpp
index 37baf68..261cdf6 100644
--- a/core/sql/bin/clitest.cpp
+++ b/core/sql/bin/clitest.cpp
@@ -155,13 +155,13 @@ int main(int argc, const char * argv[])
     
      case 2:
       {
-	cout <<"***********"  <<endl;
+	cout <<"*************************************"  <<endl;
 	cout << "Blob test extract to file in chunks " << endl;
-	cout <<"***********"  <<endl;
-	cout << " Extract from a lob column in a lob table" << endl << endl;
-	cout << " Input lob table name :" << endl;
+	cout <<"************************************"  <<endl;
+	cout << "Extract from a lob column in a lob table" << endl << endl;
+	cout << "Input lob table name :" << endl;
 	cin.getline(tablename,40);
-	cout << " Table name : " << tablename << endl;
+	cout << "Table name : " << tablename << endl;
 	cout << "Input lob column name to extract from :" << endl;
 	cin.getline(columnname,40); 
 	cout << "Column Name : " << columnname << endl;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/e4f391f3/core/sql/regress/executor/EXPECTED130
----------------------------------------------------------------------
diff --git a/core/sql/regress/executor/EXPECTED130 b/core/sql/regress/executor/EXPECTED130
index cea117a..57bdc5f 100644
--- a/core/sql/regress/executor/EXPECTED130
+++ b/core/sql/regress/executor/EXPECTED130
@@ -53,9 +53,9 @@ C1
 C1           C2
 -----------  ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 ----------------------------------------
 
-          1  LOBH00000200010882713693210510862219414564511952143513218212313794957530571017"TRAFODION"."LOB"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
                                         
-          2  LOBH00000200010882713693210510862219414564511952725470718212313794971638403017"TRAFODION"."LOB"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
                                         
-          3  LOBH00000200010882713693210510862219414564511953242068818212313794976885710017"TRAFODION"."LOB"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
                                         
+          1  LOBH00000200010264088298048325324919185106419587973186518212316881469423000017"TRAFODION"."LOB"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
                                         
+          2  LOBH00000200010264088298048325324919185106419588373441918212316881473635505017"TRAFODION"."LOB"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
                                         
+          3  LOBH00000200010264088298048325324919185106419588752137918212316881477480775017"TRAFODION"."LOB"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
                                         
 
 --- 3 row(s) selected.
 >>
@@ -237,7 +237,7 @@ C1           (EXPR)                          (EXPR)
 >>sh cp $scriptsdir/executor/deep.jpg $rundir/executor/;
 >>sh cp $scriptsdir/executor/anoush.jpg $rundir/executor/;
 >>sh cp $scriptsdir/executor/lob_input_* $rundir/executor/;
->>
+>>sh cp $scriptsdir/executor/TEST130_argfile $rundir/executor/;
 >>-- inserts
 >>-- first line
 >>insert into tlob130txt1 values (1, filetolob('lob_input_a1.txt'));
@@ -333,7 +333,7 @@ And the dish ran away with the fork !
 >>sh grep "^LOBH" TMP130 | sed "s/^/extract lobtofile(LOB '/g" | sed "s/$/' , 'tlob130_txt1.txt');/g" >> t130_extract_command;
 >>
 >>obey t130_extract_command;
->>extract lobtofile(LOB 'LOBH00000200010882713693210514378719414564511984818875018212313795291895359017"TRAFODION"."LOB"     ' , 'tlob130_txt1.txt');
+>>extract lobtofile(LOB 'LOBH00000200010264088298048327963619185106419612837158218212316881718299730017"TRAFODION"."LOB"     ' , 'tlob130_txt1.txt');
 Success. Targetfile :tlob130_txt1.txt  Length : 19
 
 --- SQL operation complete.
@@ -349,7 +349,7 @@ Success. Targetfile :tlob130_txt1.txt  Length : 19
 >>sh rm t130_extract_command;
 >>sh grep "^LOBH" TMP130 | sed "s/^/extract lobtofile(LOB '/g" | sed "s/$/' , 'tlob130_deep.jpg');/g" >> t130_extract_command;
 >>obey t130_extract_command;
->>extract lobtofile(LOB 'LOBH00000200010882713693210514444119414564511990648251418212313795350940159017"TRAFODION"."LOB"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
                                                     ' , 'tlob130_deep.jpg');
+>>extract lobtofile(LOB 'LOBH00000200010264088298048328007319185106419616794479618212316881757900747017"TRAFODION"."LOB"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
                                                     ' , 'tlob130_deep.jpg');
 Success. Targetfile :tlob130_deep.jpg  Length : 159018
 
 --- SQL operation complete.
@@ -365,7 +365,7 @@ Success. Targetfile :tlob130_deep.jpg  Length : 159018
 >>sh grep "^LOBH" TMP130 | sed "s/^/extract lobtofile(LOB '/g" | sed "s/$/' , 'tlob130_anoush.jpg');/g" >> t130_extract_command;
 >>
 >>obey t130_extract_command;
->>extract lobtofile(LOB 'LOBH00000200010882713693210514444119414564511990648251418212313795350940159017"TRAFODION"."LOB"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
                                                     ' , 'tlob130_anoush.jpg');
+>>extract lobtofile(LOB 'LOBH00000200010264088298048328007319185106419616794479618212316881757900747017"TRAFODION"."LOB"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
                                                     ' , 'tlob130_anoush.jpg');
 Success. Targetfile :tlob130_anoush.jpg  Length : 230150
 
 --- SQL operation complete.
@@ -484,7 +484,7 @@ And the dish ran away with the fork !
 >>sh grep "^LOBH" TMP130 | sed "s/^/extract lobtofile(LOB '/g" | sed "s/$/' , 'hdfs:\/\/\/lobs\/tlob130_txt2.txt');/g" >> t130_extract_command;
 >>
 >>obey t130_extract_command;
->>extract lobtofile(LOB 'LOBH00000200010882713693210515418219414564511997894836018212313795423154729017"TRAFODION"."LOB"     ' , 'hdfs:///lobs/tlob130_txt2.txt');
+>>extract lobtofile(LOB 'LOBH00000200010264088298048328671219185106419621427223118212316881804234960017"TRAFODION"."LOB"     ' , 'hdfs:///lobs/tlob130_txt2.txt');
 Success. Targetfile :hdfs:///lobs/tlob130_txt2.txt  Length : 19
 
 --- SQL operation complete.
@@ -500,7 +500,7 @@ Success. Targetfile :hdfs:///lobs/tlob130_txt2.txt  Length : 19
 >>sh rm t130_extract_command;
 >>sh grep "^LOBH" TMP130 | sed "s/^/extract lobtofile(LOB '/g" | sed "s/$/' , 'hdfs:\/\/\/lobs\/tlob130_deep.jpg');/g" >> t130_extract_command;
 >>obey t130_extract_command;
->>extract lobtofile(LOB 'LOBH00000200010882713693210515488319414564512003657955318212313795480776063017"TRAFODION"."LOB"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
                                                     ' , 'hdfs:///lobs/tlob130_deep.jpg');
+>>extract lobtofile(LOB 'LOBH00000200010264088298048328721819185106419625378358018212316881843769708017"TRAFODION"."LOB"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
                                                     ' , 'hdfs:///lobs/tlob130_deep.jpg');
 Success. Targetfile :hdfs:///lobs/tlob130_deep.jpg  Length : 159018
 
 --- SQL operation complete.
@@ -516,13 +516,189 @@ Success. Targetfile :hdfs:///lobs/tlob130_deep.jpg  Length : 159018
 >>sh grep "^LOBH" TMP130 | sed "s/^/extract lobtofile(LOB '/g" | sed "s/$/' , 'hdfs:\/\/\/lobs\/tlob130_anoush.jpg');/g" >> t130_extract_command;
 >>
 >>obey t130_extract_command;
->>extract lobtofile(LOB 'LOBH00000200010882713693210514444119414564511990648251418212313795350940159017"TRAFODION"."LOB"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
                                                     ' , 'hdfs:///lobs/tlob130_anoush.jpg');
+>>extract lobtofile(LOB 'LOBH00000200010264088298048328007319185106419616794479618212316881757900747017"TRAFODION"."LOB"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
                                                     ' , 'hdfs:///lobs/tlob130_anoush.jpg');
 Success. Targetfile :hdfs:///lobs/tlob130_anoush.jpg  Length : 230150
 
 --- SQL operation complete.
 >>
 >>
->>
+>>sh clitestdriver 2 < TEST130_argfile 2>&1 | tee -a LOG130;
+***********
+Blob test extract to file in chunks 
+***********
+ Extract from a lob column in a lob table
+
+ Input lob table name :
+ Table name : tlob130bin1
+Input lob column name to extract from :
+Column Name : c2
+Input a filename to extract to : 
+Output File Name : lobc2out.jpg
+Extracting  lob handle for column c2...
+LOB handle for c2: LOBH00000200010476207798336764109119336145849975710857618212316460311278020021"TRAFODION"."SEABASE"
+Extracting LOB data length for the above handle...
+LOB data length :159018
+Extracting lob data into file in chunks of 1000 ...
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 18 bytes to file : lobc2out.jpg
 >>
 >>------------------------------------------------------------------------------
 >>obey TEST130(lob_misc_cleanup);
@@ -566,7 +742,7 @@ And the dish ran away with the spoon.
 >>sh rm t130_extract_command;
 >>sh grep "^LOBH" TMP130 | sed "s/^/extract lobtofile(LOB '/g" | sed "s/$/' , 'tlob130_deep2.jpg');/g" >> t130_extract_command;
 >>obey t130_extract_command;
->>extract lobtofile(LOB 'LOBH00000200020882713693210517156319414564512012287022618212313795567334522017"TRAFODION"."LOB"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
                                                     ' , 'tlob130_deep2.jpg');
+>>extract lobtofile(LOB 'LOBH00000200020264088298048330075619185106419633949770818212316881929446626017"TRAFODION"."LOB"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
                                                     ' , 'tlob130_deep2.jpg');
 Success. Targetfile :tlob130_deep2.jpg  Length : 159018
 
 --- SQL operation complete.
@@ -575,7 +751,7 @@ Success. Targetfile :tlob130_deep2.jpg  Length : 159018
 >>sh rm t130_extract_command;
 >>sh grep "^LOBH" TMP130 | sed "s/^/extract lobtofile(LOB '/g" | sed "s/$/' , 'hdfs:\/\/\/lobs\/tlob130_anoush2.jpg');/g" >> t130_extract_command;
 >>obey t130_extract_command;
->>extract lobtofile(LOB 'LOBH00000200030882713693210517156319414564512012826755818212313795572444089017"TRAFODION"."LOB"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
                                                     ' , 'hdfs:///lobs/tlob130_anoush2.jpg');
+>>extract lobtofile(LOB 'LOBH00000200030264088298048330075619185106419634292903818212316881932962861017"TRAFODION"."LOB"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
                                                     ' , 'hdfs:///lobs/tlob130_anoush2.jpg');
 Success. Targetfile :hdfs:///lobs/tlob130_anoush2.jpg  Length : 230150
 
 --- SQL operation complete.
@@ -602,7 +778,7 @@ Hey diddle diddle,
 >>sh rm t130_extract_command;
 >>sh grep "^LOBH" TMP130 | sed "s/^/extract lobtofile(LOB '/g" | sed "s/$/' , 'tlob130_anoush3.jpg',create,truncate);/g" >> t130_extract_command;
 >>obey t130_extract_command;
->>extract lobtofile(LOB 'LOBH00000200030882713693210517507719414564512016516238718212313795609661744017"TRAFODION"."LOB"     ' , 'tlob130_anoush3.jpg',create,truncate);
+>>extract lobtofile(LOB 'LOBH00000200030264088298048330340419185106419636881198218212316881958805296017"TRAFODION"."LOB"     ' , 'tlob130_anoush3.jpg',create,truncate);
 Success. Targetfile :tlob130_anoush3.jpg  Length : 230150
 
 --- SQL operation complete.

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/e4f391f3/core/sql/regress/executor/TEST130
----------------------------------------------------------------------
diff --git a/core/sql/regress/executor/TEST130 b/core/sql/regress/executor/TEST130
index 6bf031e..2c5a0a4 100755
--- a/core/sql/regress/executor/TEST130
+++ b/core/sql/regress/executor/TEST130
@@ -160,7 +160,7 @@ create table tlob130bin1 (c1 int not null, c2 blob, primary key (c1));
 sh cp $scriptsdir/executor/deep.jpg $rundir/executor/;
 sh cp $scriptsdir/executor/anoush.jpg $rundir/executor/;
 sh cp $scriptsdir/executor/lob_input_* $rundir/executor/;
-
+sh cp $scriptsdir/executor/TEST130_argfile $rundir/executor/;
 -- inserts
 -- first line
 insert into tlob130txt1 values (1, filetolob('lob_input_a1.txt'));
@@ -339,7 +339,7 @@ sh grep "^LOBH" TMP130 | sed "s/^/extract lobtofile(LOB '/g" | sed "s/$/' , 'hdf
 obey t130_extract_command;
 
 
-
+sh clitestdriver 2 < TEST130_argfile 2>&1 | tee -a LOG130;
 
 ------------------------------------------------------------------------------
 obey TEST130(lob_misc_cleanup);
@@ -426,8 +426,8 @@ drop table tlob130txt2;
 drop table tlob130bin2; 
 sh rm TMP130;
 sh rm tlob130txt2;
-
-drop schema trafodion.lob;
+sh rm TEST130_argfile;
+drop schema trafodion.lob cascade;
 
 exit;
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/e4f391f3/core/sql/regress/executor/TEST130_argfile
----------------------------------------------------------------------
diff --git a/core/sql/regress/executor/TEST130_argfile b/core/sql/regress/executor/TEST130_argfile
new file mode 100644
index 0000000..2ea2426
--- /dev/null
+++ b/core/sql/regress/executor/TEST130_argfile
@@ -0,0 +1,3 @@
+tlob130bin1
+c2
+lobc2out.jpg


[06/13] incubator-trafodion git commit: Merge remote branch 'origin/master' into lob_work_buffer

Posted by sa...@apache.org.
Merge remote branch 'origin/master' into lob_work_buffer

Conflicts:
	core/sql/regress/executor/EXPECTED130
	core/sql/regress/executor/TEST130


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

Branch: refs/heads/master
Commit: 2ba37e8e1091f210a2640eef4ea614837a7f6f09
Parents: e4f391f 55a5d00
Author: Sandhya Sundaresan <sa...@apache.org>
Authored: Fri Dec 18 22:40:55 2015 +0000
Committer: Sandhya Sundaresan <sa...@apache.org>
Committed: Fri Dec 18 22:40:55 2015 +0000

----------------------------------------------------------------------
 .gitattributes                                  |   14 +
 .rat-excludes                                   |  116 +-
 LICENSE.txt                                     |  178 +-
 NOTICE.txt                                      |    1 +
 RAT_README.txt                                  |  102 +-
 README.txt                                      |   33 +-
 core/Makefile                                   |    4 +-
 .../trafodion/jdbc/t4/T4DatabaseMetaData.java   |    3 -
 core/conn/security_dll/LICENSE                  |  127 -
 core/conn/trafci/.gitignore                     |    1 +
 core/conn/trafci/build.xml                      |    9 +-
 .../src/org/trafodion/ci/DatabaseQuery.java     |    4 +-
 .../trafciDefaultLookAndFeel.properties         |    1 +
 core/conn/trafci/utils/trafci.sh                |  185 -
 core/conn/trafci/utils/trafci.sh-tmpl           |  187 +
 .../odbc/odbcclient/unixcli/package/mklnxpkg.sh |    2 -
 .../unixcli/package/trafodbclnx_install.sh      |    2 +-
 core/sqf/build-scripts/genverhdr.ksh            |    3 +-
 core/sqf/conf/log4j.dtm.config                  |   22 -
 core/sqf/conf/log4j.hdfs.config                 |   22 -
 core/sqf/conf/trafodion.udr.config              |   22 -
 core/sqf/export/lib/Vili/Functions.pm           |  725 ---
 core/sqf/export/lib/Vili/Helper.pm              |  674 --
 core/sqf/export/lib/Vili/NoDriftTimer.pm        |   98 -
 core/sqf/sqenvcom.sh                            |    2 +-
 core/sqf/sql/scripts/cleanat                    |   39 +
 core/sqf/sql/scripts/findPort.py                |    1 +
 core/sqf/sql/scripts/gensq.pl                   |   20 +-
 core/sqf/sql/scripts/install_local_drill        |  114 +
 core/sqf/sql/scripts/install_local_hadoop       |   90 +-
 core/sqf/sql/scripts/lobstart                   |    4 +-
 core/sqf/sql/scripts/makemsg.ksh                |    2 +-
 core/sqf/sql/scripts/sqnodes.pm                 |   74 +-
 core/sqf/sqvers                                 |   29 +-
 core/sqf/src/seatrans/hbase-trx/pom.xml.apache  |    4 +
 .../client/transactional/BatchException.java    |   21 -
 .../CommitUnsuccessfulException.java            |   19 -
 .../HBaseBackedTransactionLogger.java           |   10 -
 .../client/transactional/JtaXAResource.java     |   10 -
 .../transactional/LocalTransactionLogger.java   |   19 -
 .../transactional/MemoryUsageException.java     |   20 -
 .../OutOfOrderProtocolException.java            |   20 -
 .../hbase/client/transactional/RMInterface.java |   20 -
 .../transactional/SsccTransactionalScanner.java |   20 -
 .../transactional/SsccTransactionalTable.java   |   20 -
 .../SsccUpdateConflictException.java            |   20 -
 .../hbase/client/transactional/TmDDL.java       |   20 -
 .../client/transactional/TransReturnCode.java   |   20 -
 .../hbase/client/transactional/TransState.java  |   20 -
 .../client/transactional/TransactionLogger.java |   19 -
 .../transactional/TransactionManager.java       |  333 +-
 .../client/transactional/TransactionMap.java    |   22 +-
 .../TransactionRegionLocation.java              |   20 -
 .../client/transactional/TransactionState.java  |   20 -
 .../TransactionalAggregationClient.java         |   19 -
 .../transactional/TransactionalScanner.java     |   20 -
 .../transactional/TransactionalTable.java       |   20 -
 .../transactional/TransactionalTableClient.java |   20 -
 .../UnknownTransactionException.java            |   19 -
 .../transactional/UnsuccessfulDDLException.java |   20 -
 .../transactional/SsccRegionEndpoint.java       |   21 -
 .../transactional/SsccTableClient.java          |   21 -
 .../transactional/SsccTableClientUtils.java     |   18 -
 .../transactional/TrxRegionEndpoint.java        |  386 +-
 .../transactional/TrxRegionObserver.java        |   22 -
 .../transactional/TrxTableClient.java           |   18 -
 .../transactional/TrxTableClient2.java          |   18 -
 .../transactional/TrxTableClient3.java          |   18 -
 .../transactional/TrxTableClient4.java          |   18 -
 .../generated/SsccRegionProtos.java             |  131 +-
 .../generated/TrxRegionProtos.java              | 1020 ++-
 .../CleanOldTransactionsChore.java              |   10 -
 .../hbase/regionserver/transactional/IdTm.java  |   10 -
 .../regionserver/transactional/IdTmCb.java      |   10 -
 .../transactional/IdTmException.java            |   10 -
 .../transactional/KeyValueListScanner.java      |   11 -
 .../transactional/MemoryUsageChore.java         |   10 -
 .../transactional/SsccTransactionState.java     |   21 -
 .../transactional/TransactionState.java         |   21 -
 .../transactional/TransactionalRegion.java      |   10 -
 .../TransactionalRegionScannerHolder.java       |   10 -
 .../transactional/TrxTransactionState.java      |  177 +-
 .../hbase-trx/src/main/protobuf/TrxRegion.proto |   11 +-
 core/sqf/src/tm/tools/dtmci.cpp                 |   34 +-
 core/sqf/tools/sqtools.sh                       |    4 +-
 core/sql/arkcmp/CmpContext.cpp                  |   18 +-
 core/sql/bin/SqlciErrors.txt                    |    3 +-
 core/sql/comexe/ComTdb.h                        |    2 +-
 core/sql/comexe/ComTdbExeUtil.cpp               |   27 +
 core/sql/comexe/ComTdbExeUtil.h                 |  119 +
 core/sql/common/ExprNode.cpp                    |    1 +
 core/sql/common/OperTypeEnum.h                  |   24 +-
 core/sql/common/from_GB2312.c                   |  134 +-
 core/sql/common/swscanf.cpp                     |   55 +-
 core/sql/common/swsprintf.cpp                   |   63 +-
 core/sql/executor/ExComTdb.cpp                  |    7 +
 core/sql/executor/ExExeUtil.h                   |  167 +
 core/sql/executor/ExExeUtilCommon.cpp           |    7 +-
 core/sql/executor/ExExeUtilGet.cpp              |  826 ++-
 core/sql/executor/ExHdfsScan.cpp                |    4 +-
 core/sql/executor/ExStats.cpp                   |   16 +-
 core/sql/executor/ExStats.h                     |    4 +-
 core/sql/executor/HBaseClient_JNI.cpp           |  118 +-
 core/sql/executor/HBaseClient_JNI.h             |    2 +
 core/sql/executor/ex_split_bottom.cpp           |   11 +
 core/sql/exp/ExpHbaseInterface.cpp              |   16 +
 core/sql/exp/ExpHbaseInterface.h                |    3 +
 core/sql/generator/GenRelExeUtil.cpp            |  119 +
 core/sql/optimizer/BindRelExpr.cpp              |    5 +
 core/sql/optimizer/ColStatDesc.h                |    2 +-
 core/sql/optimizer/GroupAttr.cpp                |  179 +
 core/sql/optimizer/GroupAttr.h                  |    4 +
 core/sql/optimizer/ImplRule.cpp                 |   16 +-
 core/sql/optimizer/ItemConstr.h                 |   39 +
 core/sql/optimizer/ItemExpr.cpp                 |   36 +-
 core/sql/optimizer/ItemExpr.h                   |    4 +-
 core/sql/optimizer/OptPhysRelExpr.cpp           |    3 +-
 core/sql/optimizer/PhyProp.cpp                  |    2 +-
 core/sql/optimizer/RelExeUtil.cpp               |  128 +-
 core/sql/optimizer/RelExeUtil.h                 |   60 +
 core/sql/optimizer/RelRoutine.cpp               |   55 +-
 core/sql/optimizer/ScanOptimizer.cpp            |  165 +-
 core/sql/optimizer/UdfDllInteraction.cpp        |   10 +-
 core/sql/optimizer/ValueDesc.cpp                |  194 +-
 core/sql/optimizer/ValueDesc.h                  |   14 +-
 core/sql/parser/ParKeyWords.cpp                 |    4 +-
 core/sql/parser/sqlparser.y                     |  112 +-
 core/sql/parser/ulexer.h                        |   39 +-
 core/sql/pom.xml                                |    5 +
 core/sql/regress/catman1/EXPECTED135            |    2 +
 core/sql/regress/compGeneral/EXPECTED071        |   47 +
 core/sql/regress/compGeneral/TEST062            |    1 +
 core/sql/regress/compGeneral/TEST071            |   22 +
 core/sql/regress/executor/EXPECTED130           |   29 +-
 core/sql/regress/executor/TEST016               |    5 +
 core/sql/regress/executor/TEST130               |    8 +-
 core/sql/regress/hive/EXPECTED005               |    3 +
 core/sql/regress/hive/EXPECTED006               |    3 +
 core/sql/regress/hive/EXPECTED020               |    5 +-
 core/sql/regress/hive/TEST005                   |    1 +
 core/sql/regress/hive/TEST006                   |    1 +
 core/sql/regress/hive/TEST018                   |    1 +
 core/sql/regress/hive/TEST020                   |    1 +
 core/sql/regress/newregr/card/runregr_card.ksh  |    7 -
 .../regress/newregr/mvs/BIG/expectedmv215_RU    |  480 --
 core/sql/regress/newregr/mvs/EXPECTEDMV500      | 4708 --------------
 core/sql/regress/newregr/mvs/EXPECTEDMV500A     | 5179 ----------------
 .../regress/newregr/mvs/EXPECTEDMV500A.LINUX    | 5789 ------------------
 .../sql/regress/newregr/mvs/TPCD/DBGEN_HELP.TXT |   83 -
 core/sql/regress/seabase/EXPECTED002            |  677 ++
 core/sql/regress/seabase/EXPECTED010            |   86 +-
 core/sql/regress/seabase/EXPECTED021            |   26 +-
 core/sql/regress/seabase/FILTER002              |   31 +
 core/sql/regress/seabase/TEST002                |  144 +
 core/sql/regress/seabase/TEST010                |    4 +
 core/sql/regress/seabase/TEST014                |    1 +
 core/sql/regress/tools/regress-filter           |    5 -
 core/sql/regress/tools/regress-filter-linux     |    5 -
 core/sql/regress/tools/runregr_udr.ksh          |    7 +
 core/sql/regress/udr/EXPECTED002                |   48 +-
 core/sql/regress/udr/EXPECTED100.SB             |    4 +-
 core/sql/regress/udr/TEST002                    |   18 +
 core/sql/sqlci/SqlCmd.cpp                       |    1 +
 core/sql/sqlcomp/CmpDescribe.cpp                |  170 +-
 core/sql/sqlcomp/CmpSeabaseDDLauth.cpp          |   15 +
 core/sql/sqlcomp/CmpSeabaseDDLauth.h            |    2 +-
 core/sql/sqlcomp/DefaultConstants.h             |   14 +-
 core/sql/sqlcomp/PrivMgrRoles.cpp               |   11 +-
 core/sql/sqlcomp/nadefaults.cpp                 |    8 +-
 core/sql/sqludr/doxygen_tmudr.1.6.config        |    4 +-
 core/sql/sqludr/sqludr.cpp                      |    2 +-
 core/sql/sqludr/sqludr.h                        |   16 +-
 .../java/org/trafodion/sql/HBaseClient.java     |  205 +-
 .../java/org/trafodion/sql/TrafRegionStats.java |  144 +
 .../trafodion/sql/udr/UDRInvocationInfo.java    |   17 +-
 .../org/trafodion/sql/udr/predef/JDBCUDR.java   |  690 +++
 core/sql/ustat/hs_cli.cpp                       |    4 +-
 core/sql/ustat/hs_cli.h                         |    2 +-
 core/sql/ustat/hs_globals.cpp                   |  128 +-
 core/sql/ustat/hs_globals.h                     |    2 -
 core/sql/ustat/hs_la.h                          |    6 +-
 core/sql/ustat/hs_parser.cpp                    |    1 -
 core/updateCopyrightCheck.py                    |    7 +-
 dcs/LICENSE.txt                                 |  202 -
 dcs/NOTICE.txt                                  |    7 -
 .../dcs/master/listener/ConnectReply.java       |   75 +-
 .../org/trafodion/dcs/servermt/ServerUtils.java |   20 +-
 .../servermt/serverHandler/ServerHandler.java   |    2 +
 .../org/trafodion/dcs/util/ByteBufferUtils.java |    2 -
 .../java/org/trafodion/dcs/util/SqlUtils.java   |    2 -
 .../org/trafodion/dcs/version/util/VerGen.java  |   19 -
 .../dcs-webapps/master/css/stylesheet.css       |  191 -
 dcs/src/test/pytests/.tox.ini.tmpl              |   21 -
 docs/.gitignore                                 |    1 +
 .../Trafodion_Client_Installation_Guide.xml     |    6 +-
 docs/client_install/source/xml-profile.xml      |    2 +-
 .../Trafodion_Command_Interface_Guide.xml       |   44 +-
 docs/command_interface/source/xml-profile.xml   |    2 +-
 docs/odb_manual/Trafodion_odb_User_Guide.xml    |    4 +-
 .../source/Trafodion_SQL_Reference_Manual.xml   |   10 +-
 docs/sql_reference/source/xml-profile.xml       |    2 +-
 docs/src/site/asciidoc/index.adoc               |   46 -
 docs/src/site/markdown/advocate.md              |   15 +
 docs/src/site/markdown/architecture-overview.md |  169 +
 docs/src/site/markdown/build-tools-manual.md    |  197 +
 docs/src/site/markdown/build.md                 |   80 +
 docs/src/site/markdown/code-organization.md     |   27 +
 docs/src/site/markdown/code.md                  |   32 +
 docs/src/site/markdown/contribute.md            |   69 +
 .../markdown/cplusplus-coding-guidelines.md     |  310 +
 .../src/site/markdown/create-dev-environment.md |  153 +
 docs/src/site/markdown/develop.md               |  245 +
 docs/src/site/markdown/document.md              |  124 +
 docs/src/site/markdown/documentation.md         |   25 +
 docs/src/site/markdown/download.md              |   36 +
 .../site/markdown/enable-secure-trafodion.md    |  224 +
 docs/src/site/markdown/faq.md                   |  220 +
 docs/src/site/markdown/index.md                 |  133 +
 docs/src/site/markdown/install-preparation.md   |  138 +
 docs/src/site/markdown/install-troubleshoot.md  |   21 +
 docs/src/site/markdown/install.md               |  201 +
 docs/src/site/markdown/ldapcheck.md             |   41 +
 docs/src/site/markdown/ldapconfigcheck.md       |   48 +
 .../src/site/markdown/manage-dev-environment.md |   51 +
 docs/src/site/markdown/management.md            |   62 +
 docs/src/site/markdown/merge.md                 |  140 +
 docs/src/site/markdown/new-features.md          |   15 +
 docs/src/site/markdown/passwordless-ssh.md      |  131 +
 docs/src/site/markdown/performance.md           |   15 +
 docs/src/site/markdown/port-assignment.md       |  134 +
 docs/src/site/markdown/presentations.md         |   18 +
 docs/src/site/markdown/quickstart.md            |   15 +
 docs/src/site/markdown/release-notes-0-8-0.md   |  165 +
 docs/src/site/markdown/release-notes-0-9-0.md   |  210 +
 docs/src/site/markdown/release-notes-1-0-0.md   |  256 +
 docs/src/site/markdown/release-notes-1-0-1.md   |  250 +
 docs/src/site/markdown/release-notes-1-1-0.md   |  181 +
 docs/src/site/markdown/release-notes-1-3-0.md   |  160 +
 docs/src/site/markdown/release-notes.md         |   24 +
 docs/src/site/markdown/release.md               |  225 +
 docs/src/site/markdown/roadmap.md               |   15 +
 .../site/markdown/setup-build-environment.md    |  160 +
 docs/src/site/markdown/testing.md               |  179 +
 docs/src/site/markdown/tests.md                 |   71 +
 .../site/markdown/traf_authentication_config.md |   96 +
 docs/src/site/markdown/uninstall.md             |  176 +
 docs/src/site/markdown/website.md               |  108 +
 docs/src/site/markdown/wiki.md                  |   23 +
 docs/src/site/resources/css/site.css            |  208 +-
 .../resources/images/carousel/processes.png     |  Bin 0 -> 129503 bytes
 .../resources/images/carousel/revolution.png    |  Bin 0 -> 66062 bytes
 .../site/resources/images/carousel/scale.png    |  Bin 0 -> 93783 bytes
 .../site/resources/images/carousel/stack.png    |  Bin 0 -> 102472 bytes
 .../site/resources/images/carousel/timeline.png |  Bin 0 -> 115681 bytes
 .../site/resources/images/logos/community.png   |  Bin 0 -> 6237 bytes
 .../site/resources/images/logos/contribute.png  |  Bin 0 -> 4902 bytes
 .../site/resources/images/logos/understand.png  |  Bin 0 -> 5925 bytes
 docs/src/site/resources/images/logos/use.png    |  Bin 0 -> 2789 bytes
 .../site/resources/images/multi-layer-esps.png  |  Bin 0 -> 116303 bytes
 .../resources/images/process-architecture.png   |  Bin 0 -> 72704 bytes
 docs/src/site/resources/images/revolution.png   |  Bin 0 -> 185535 bytes
 .../presentations/dtm-architecture.pdf          |  Bin 0 -> 225959 bytes
 docs/src/site/site.xml                          |  370 +-
 install/.gitignore                              |    1 +
 install/Makefile                                |    2 -
 install/README.rst                              |   32 -
 install/installer/dcs_installer                 |   53 +-
 install/installer/traf_add_sudoAccess           |   54 +
 install/installer/traf_add_user                 |   23 +-
 install/installer/traf_config_check             |   14 +
 install/installer/traf_config_setup             |   87 +-
 install/installer/traf_createPasswordLessSSH    |   63 +
 install/installer/traf_getHadoopNodes           |    4 +-
 install/installer/traf_package_setup            |   60 +-
 install/installer/trafodion_config_default      |   11 +
 install/installer/trafodion_install             |    9 +-
 licenses/LICENSE-bsd2                           |   14 +
 licenses/LICENSE-bsd4                           |   31 +
 licenses/LICENSE-facebook                       |   14 +
 licenses/LICENSE-js                             |   18 +
 licenses/LICENSE-salesforce                     |   23 +
 pom.xml                                         |  222 +-
 .../phoenix/end2end/AlterTableTest.java         |   21 -
 .../phoenix/end2end/ArithmeticQueryTest.java    |   21 -
 .../phoenix/end2end/AutoCommitTest.java         |   21 -
 .../org/trafodion/phoenix/end2end/BaseTest.java |   26 +-
 .../trafodion/phoenix/end2end/BatchTest.java    |  250 +
 .../phoenix/end2end/BinaryRowKeyTest.java       |   21 -
 .../phoenix/end2end/CoalesceFunctionTest.java   |   21 -
 .../end2end/CompareDecimalToLongTest.java       |   21 -
 .../phoenix/end2end/CreateTableTest.java        |   21 -
 .../phoenix/end2end/CustomEntityDataTest.java   |   21 -
 .../phoenix/end2end/DeleteRangeTest.java        |   21 -
 .../end2end/DescColumnSortOrderTest.java        |   21 -
 .../phoenix/end2end/DistinctCountTest.java      |   21 -
 .../phoenix/end2end/ExecuteStatementsTest.java  |   21 -
 .../phoenix/end2end/ExtendedQueryExecTest.java  |   21 -
 .../phoenix/end2end/FunkyNamesTest.java         |   21 -
 .../phoenix/end2end/GroupByCaseTest.java        |   21 -
 .../trafodion/phoenix/end2end/IndexTest.java    |   21 -
 .../trafodion/phoenix/end2end/IsNullTest.java   |   21 -
 .../trafodion/phoenix/end2end/KeyOnlyTest.java  |   21 -
 .../phoenix/end2end/MultiCfQueryExecTest.java   |   21 -
 .../trafodion/phoenix/end2end/OrderByTest.java  |   21 -
 .../phoenix/end2end/ProductMetricsTest.java     |   21 -
 .../phoenix/end2end/QueryExecTest.java          |   21 -
 .../end2end/QueryExecWithoutSCNTest.java        |   21 -
 .../phoenix/end2end/QueryPlanTest.java          |   21 -
 .../phoenix/end2end/ReadIsolationLevelTest.java |   21 -
 .../phoenix/end2end/SaltedTableTest.java        |   21 -
 .../end2end/SaltedTableUpsertSelectTest.java    |   21 -
 .../end2end/SaltedTableVarLengthRowKeyTest.java |   21 -
 .../phoenix/end2end/ServerExceptionTest.java    |   21 -
 .../phoenix/end2end/SkipScanQueryTest.java      |   21 -
 .../phoenix/end2end/StatementHintsTest.java     |   21 -
 .../trafodion/phoenix/end2end/StddevTest.java   |   21 -
 .../phoenix/end2end/ToCharFunctionTest.java     |   21 -
 .../phoenix/end2end/ToNumberFunctionTest.java   |   21 -
 .../org/trafodion/phoenix/end2end/TopNTest.java |   21 -
 .../phoenix/end2end/UpsertBigValuesTest.java    |   21 -
 .../end2end/UpsertSelectAutoCommitTest.java     |   21 -
 .../phoenix/end2end/UpsertSelectTest.java       |   21 -
 .../phoenix/end2end/UpsertValuesTest.java       |   21 -
 .../phoenix/end2end/VariableLengthPKTest.java   |   21 -
 win-odbc64/Krypton/KryptonBuild.bat             |   29 +-
 win-odbc64/Krypton/assocsvc.idl                 |   28 +-
 win-odbc64/Krypton/ca.idl                       |   30 +-
 win-odbc64/Krypton/ceecfg.idl                   |   27 +-
 win-odbc64/Krypton/ceercv.idl                   |   29 +-
 win-odbc64/Krypton/clientcfg.idl                |   32 +-
 win-odbc64/Krypton/generated_incs/cee.h         |   28 +-
 win-odbc64/Krypton/generated_incs/ceecfg.h      |   27 +-
 win-odbc64/Krypton/generated_incs/ceercv.h      |   27 +-
 win-odbc64/Krypton/generated_incs/glu.h         |   27 +-
 win-odbc64/Krypton/generated_incs/glu_rs.h      |   27 +-
 win-odbc64/Krypton/generated_incs/glu_stdexc.h  |   27 +-
 win-odbc64/Krypton/generated_incs/idltype.h     |   27 +-
 win-odbc64/Krypton/generated_incs/odbc.h        |   27 +-
 win-odbc64/Krypton/generated_incs/odbcCommon.h  |   27 +-
 win-odbc64/Krypton/generated_incs/odbc_cl.h     |   27 +-
 win-odbc64/Krypton/generated_incs/odbc_sv.h     |   27 +-
 win-odbc64/Krypton/generated_incs/odbcas_cl.h   |   27 +-
 win-odbc64/Krypton/generated_incs/odbcas_sv.h   |   27 +-
 win-odbc64/Krypton/generated_incs/odbccfg.h     |   27 +-
 win-odbc64/Krypton/generated_incs/odbccfg_cl.h  |   27 +-
 win-odbc64/Krypton/generated_incs/odbccfg_sv.h  |   27 +-
 .../Krypton/generated_incs/odbcsrvrcommon.h     |   27 +-
 .../Krypton/generated_incs/tdm_odbcSrvrMsg.h    |   28 +-
 win-odbc64/Krypton/idlcnp.bat                   |   27 +-
 win-odbc64/Krypton/odbc.idl                     |   29 +-
 win-odbc64/Krypton/odbcCommon.idl               |   29 +-
 win-odbc64/Krypton/odbcas.idl                   |   29 +-
 win-odbc64/Krypton/odbccfg.idl                  |   30 +-
 win-odbc64/Krypton/odbcsrvrcommon.idl           |   29 +-
 win-odbc64/Krypton/omxSec.idl                   |   30 +-
 .../odbcclient/DSNConverter/DSNConverter.def    |    2 +-
 .../TranslationDll/TranslationDll.def           |    2 +-
 win-odbc64/odbcclient/drvr35/cconnect.cpp       |    8 +-
 win-odbc64/odbcclient/drvr35/cstmt.cpp          |    6 +-
 win-odbc64/odbcclient/drvr35/drvrnet.h          |    2 +-
 win-odbc64/odbcclient/update_version.pl         |  176 +
 wms/LICENSE.txt                                 |  202 -
 wms/NOTICE.txt                                  |   11 -
 wms/build.xml                                   |    2 +-
 364 files changed, 14270 insertions(+), 22929 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2ba37e8e/core/sql/comexe/ComTdbExeUtil.cpp
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2ba37e8e/core/sql/comexe/ComTdbExeUtil.h
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2ba37e8e/core/sql/executor/ExExeUtil.h
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2ba37e8e/core/sql/executor/ExHdfsScan.cpp
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2ba37e8e/core/sql/generator/GenRelExeUtil.cpp
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2ba37e8e/core/sql/optimizer/RelExeUtil.cpp
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2ba37e8e/core/sql/optimizer/RelExeUtil.h
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2ba37e8e/core/sql/parser/sqlparser.y
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2ba37e8e/core/sql/regress/executor/EXPECTED130
----------------------------------------------------------------------
diff --cc core/sql/regress/executor/EXPECTED130
index 57bdc5f,0e2ee61..670abdf
--- a/core/sql/regress/executor/EXPECTED130
+++ b/core/sql/regress/executor/EXPECTED130
@@@ -53,10 -53,10 +53,9 @@@ C
  C1           C2
  -----------  -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -----------------------------------------
  
-           1  LOBH00000200010264088298048325324919185106419587973186518212316881469423000017"TRAFODION"."LOB"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
                                          
-           2  LOBH00000200010264088298048325324919185106419588373441918212316881473635505017"TRAFODION"."LOB"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
                                          
-           3  LOBH00000200010264088298048325324919185106419588752137918212316881477480775017"TRAFODION"."LOB"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
                                          
- 
+           1  LOBH00000200010279963438587423229119541341101965990251118212316399994956986020"TRAFODION"."LOB130"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
                                          
+           2  LOBH00000200010279963438587423229119541341101966300063218212316400003010310020"TRAFODION"."LOB130"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
                                          
+           3  LOBH00000200010279963438587423229119541341101966584793118212316400005859531020"TRAFODION"."LOB130"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
                                          
 -
  --- 3 row(s) selected.
  >>
  >>
@@@ -349,7 -349,7 +348,8 @@@ Success. Targetfile :tlob130_txt1.txt  
  >>sh rm t130_extract_command;
  >>sh grep "^LOBH" TMP130 | sed "s/^/extract lobtofile(LOB '/g" | sed "s/$/' , 'tlob130_deep.jpg');/g" >> t130_extract_command;
  >>obey t130_extract_command;
 ->>extract lobtofile(LOB 'LOBH00000200010279963438587425504419541341101988962025518212316400229655406020"TRAFODION"."LOB130"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
                                                      ' , 'tlob130_deep.jpg');
 +>>extract lobtofile(LOB 'LOBH00000200010264088298048328007319185106419616794479618212316881757900747017"TRAFODION"."LOB"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
                                                      ' , 'tlob130_deep.jpg');
++
  Success. Targetfile :tlob130_deep.jpg  Length : 159018
  
  --- SQL operation complete.
@@@ -365,7 -365,7 +365,8 @@@
  >>sh grep "^LOBH" TMP130 | sed "s/^/extract lobtofile(LOB '/g" | sed "s/$/' , 'tlob130_anoush.jpg');/g" >> t130_extract_command;
  >>
  >>obey t130_extract_command;
 ->>extract lobtofile(LOB 'LOBH00000200010279963438587425504419541341101988962025518212316400229655406020"TRAFODION"."LOB130"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
                                                      ' , 'tlob130_anoush.jpg');
++
 +>>extract lobtofile(LOB 'LOBH00000200010264088298048328007319185106419616794479618212316881757900747017"TRAFODION"."LOB"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
                                                      ' , 'tlob130_anoush.jpg');
  Success. Targetfile :tlob130_anoush.jpg  Length : 230150
  
  --- SQL operation complete.
@@@ -484,7 -484,7 +485,9 @@@ And the dish ran away with the fork 
  >>sh grep "^LOBH" TMP130 | sed "s/^/extract lobtofile(LOB '/g" | sed "s/$/' , 'hdfs:\/\/\/lobs\/tlob130_txt2.txt');/g" >> t130_extract_command;
  >>
  >>obey t130_extract_command;
 ->>extract lobtofile(LOB 'LOBH00000200010279963438587426033019541341101993803370618212316400277653681020"TRAFODION"."LOB130"  ' , 'hdfs:///lobs/tlob130_txt2.txt');
++
 +>>extract lobtofile(LOB 'LOBH00000200010264088298048328671219185106419621427223118212316881804234960017"TRAFODION"."LOB"     ' , 'hdfs:///lobs/tlob130_txt2.txt');
++
  Success. Targetfile :hdfs:///lobs/tlob130_txt2.txt  Length : 19
  
  --- SQL operation complete.
@@@ -500,7 -500,7 +503,9 @@@
  >>sh rm t130_extract_command;
  >>sh grep "^LOBH" TMP130 | sed "s/^/extract lobtofile(LOB '/g" | sed "s/$/' , 'hdfs:\/\/\/lobs\/tlob130_deep.jpg');/g" >> t130_extract_command;
  >>obey t130_extract_command;
 ->>extract lobtofile(LOB 'LOBH00000200010279963438587426095919541341101996655440218212316400306584607020"TRAFODION"."LOB130"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
                                                      ' , 'hdfs:///lobs/tlob130_deep.jpg');
++
 +>>extract lobtofile(LOB 'LOBH00000200010264088298048328721819185106419625378358018212316881843769708017"TRAFODION"."LOB"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
                                                      ' , 'hdfs:///lobs/tlob130_deep.jpg');
++
  Success. Targetfile :hdfs:///lobs/tlob130_deep.jpg  Length : 159018
  
  --- SQL operation complete.
@@@ -742,7 -566,7 +747,11 @@@ And the dish ran away with the spoon
  >>sh rm t130_extract_command;
  >>sh grep "^LOBH" TMP130 | sed "s/^/extract lobtofile(LOB '/g" | sed "s/$/' , 'tlob130_deep2.jpg');/g" >> t130_extract_command;
  >>obey t130_extract_command;
++<<<<<<< HEAD
 +>>extract lobtofile(LOB 'LOBH00000200020264088298048330075619185106419633949770818212316881929446626017"TRAFODION"."LOB"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
                                                      ' , 'tlob130_deep2.jpg');
++=======
+ >>extract lobtofile(LOB 'LOBH00000200020279963438587427046219541341102002085013918212316400360882889020"TRAFODION"."LOB130"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
                                                      ' , 'tlob130_deep2.jpg');
++>>>>>>> origin/master
  Success. Targetfile :tlob130_deep2.jpg  Length : 159018
  
  --- SQL operation complete.
@@@ -751,7 -575,7 +760,11 @@@
  >>sh rm t130_extract_command;
  >>sh grep "^LOBH" TMP130 | sed "s/^/extract lobtofile(LOB '/g" | sed "s/$/' , 'hdfs:\/\/\/lobs\/tlob130_anoush2.jpg');/g" >> t130_extract_command;
  >>obey t130_extract_command;
++<<<<<<< HEAD
 +>>extract lobtofile(LOB 'LOBH00000200030264088298048330075619185106419634292903818212316881932962861017"TRAFODION"."LOB"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
                                                      ' , 'hdfs:///lobs/tlob130_anoush2.jpg');
++=======
+ >>extract lobtofile(LOB 'LOBH00000200030279963438587427046219541341102002340817618212316400363467910020"TRAFODION"."LOB130"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
                                                      ' , 'hdfs:///lobs/tlob130_anoush2.jpg');
++>>>>>>> origin/master
  Success. Targetfile :hdfs:///lobs/tlob130_anoush2.jpg  Length : 230150
  
  --- SQL operation complete.
@@@ -778,7 -602,7 +791,11 @@@ Hey diddle diddle
  >>sh rm t130_extract_command;
  >>sh grep "^LOBH" TMP130 | sed "s/^/extract lobtofile(LOB '/g" | sed "s/$/' , 'tlob130_anoush3.jpg',create,truncate);/g" >> t130_extract_command;
  >>obey t130_extract_command;
++<<<<<<< HEAD
 +>>extract lobtofile(LOB 'LOBH00000200030264088298048330340419185106419636881198218212316881958805296017"TRAFODION"."LOB"     ' , 'tlob130_anoush3.jpg',create,truncate);
++=======
+ >>extract lobtofile(LOB 'LOBH00000200030279963438587427288519541341102004608530918212316400386132885020"TRAFODION"."LOB130"  ' , 'tlob130_anoush3.jpg',create,truncate);
++>>>>>>> origin/master
  Success. Targetfile :tlob130_anoush3.jpg  Length : 230150
  
  --- SQL operation complete.

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2ba37e8e/core/sql/regress/executor/TEST130
----------------------------------------------------------------------
diff --cc core/sql/regress/executor/TEST130
index 2c5a0a4,2503121..0941e78
--- a/core/sql/regress/executor/TEST130
+++ b/core/sql/regress/executor/TEST130
@@@ -426,9 -427,9 +427,10 @@@ drop table tlob130txt2
  drop table tlob130bin2; 
  sh rm TMP130;
  sh rm tlob130txt2;
 -
 +sh rm TEST130_argfile;
- drop schema trafodion.lob cascade;
+ drop schema trafodion.lob130 cascade;
+ 
 +
  exit;
  
  



[03/13] incubator-trafodion git commit: sqvers for clitestdriver

Posted by sa...@apache.org.
sqvers for clitestdriver


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

Branch: refs/heads/master
Commit: 353e1f3b8d619e5c5ee4934d6b58a6bf2b7aa542
Parents: 5cfc9fa
Author: Sandhya Sundaresan <sa...@apache.org>
Authored: Wed Dec 9 22:42:23 2015 +0000
Committer: Sandhya Sundaresan <sa...@apache.org>
Committed: Wed Dec 9 22:42:23 2015 +0000

----------------------------------------------------------------------
 core/sql/clitest/vers_libclitest.cpp | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/353e1f3b/core/sql/clitest/vers_libclitest.cpp
----------------------------------------------------------------------
diff --git a/core/sql/clitest/vers_libclitest.cpp b/core/sql/clitest/vers_libclitest.cpp
new file mode 100644
index 0000000..f7a4754
--- /dev/null
+++ b/core/sql/clitest/vers_libclitest.cpp
@@ -0,0 +1,28 @@
+// @@@ START COPYRIGHT @@@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+// @@@ END COPYRIGHT @@@
+
+#include "SCMVersHelp.h"
+
+// component version
+#define VERS_CV_MAJ 1
+#define VERS_CV_MIN 0
+#define VERS_CV_UPD 1
+VERS_LIB(libclitest)


[13/13] incubator-trafodion git commit: Merge remote branch 'origin/pr/248/head' into merge_248

Posted by sa...@apache.org.
Merge remote branch 'origin/pr/248/head' into merge_248


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

Branch: refs/heads/master
Commit: 60ffbd9aade42401011ebfffddd681dca96e0d4d
Parents: 9f8afad f365667
Author: Sandhya Sundaresan <sa...@apache.org>
Authored: Fri Jan 8 18:01:04 2016 +0000
Committer: Sandhya Sundaresan <sa...@apache.org>
Committed: Fri Jan 8 18:01:04 2016 +0000

----------------------------------------------------------------------
 core/sql/bin/clitest.cpp                  | 267 ++++++++++++++++++++++++
 core/sql/bin/vprocclitestdriver.cpp       |  51 +++++
 core/sql/cli/Cli.cpp                      |  31 ++-
 core/sql/cli/sqlcli.h                     |   9 +-
 core/sql/clitest/blobtest.cpp             | 269 ++++++++++++++++++++++++
 core/sql/clitest/blobtest.h               |  76 +++++++
 core/sql/clitest/vers_libclitest.cpp      |  28 +++
 core/sql/comexe/ComTdbExeUtil.cpp         |  22 +-
 core/sql/comexe/ComTdbExeUtil.h           |  27 ++-
 core/sql/comexe/ComTdbRoot.h              |  14 +-
 core/sql/common/BaseTypes.cpp             |  27 ++-
 core/sql/executor/ExExeUtil.h             |   2 +-
 core/sql/executor/ExExeUtilCli.cpp        |   8 +-
 core/sql/executor/ExExeUtilCli.h          |   2 +-
 core/sql/executor/ExExeUtilLoad.cpp       | 167 +++++++++------
 core/sql/executor/ExHdfsScan.cpp          |   8 +-
 core/sql/exp/ExpLOB.cpp                   |  70 ++++---
 core/sql/exp/ExpLOB.h                     |  13 +-
 core/sql/exp/ExpLOBaccess.cpp             |  26 ++-
 core/sql/exp/ExpLOBenums.h                |   1 +
 core/sql/exp/ExpLOBinterface.cpp          |  24 ++-
 core/sql/exp/ExpLOBinterface.h            |   1 +
 core/sql/generator/GenItemFunc.cpp        |   7 +
 core/sql/generator/GenRelExeUtil.cpp      |  11 +-
 core/sql/generator/GenRelMisc.cpp         |   4 +
 core/sql/nskgmake/Makerules.linux         |   4 +-
 core/sql/nskgmake/clitest/Makefile        |  36 ++++
 core/sql/nskgmake/clitestdriver/Makefile  |  35 ++++
 core/sql/optimizer/ItemExpr.cpp           |   4 +-
 core/sql/optimizer/ItemFunc.h             |  17 +-
 core/sql/optimizer/RelExeUtil.cpp         |   4 +-
 core/sql/optimizer/RelExeUtil.h           |  12 +-
 core/sql/optimizer/SynthType.cpp          |  33 ++-
 core/sql/parser/sqlparser.y               |  88 ++++----
 core/sql/regress/executor/EXPECTED130     | 275 +++++++++++++++++++++++--
 core/sql/regress/executor/TEST130         |   8 +-
 core/sql/regress/executor/TEST130_argfile |   3 +
 37 files changed, 1456 insertions(+), 228 deletions(-)
----------------------------------------------------------------------



[08/13] incubator-trafodion git commit: insert/update LOB support from external user buffer

Posted by sa...@apache.org.
insert/update LOB support from external user buffer


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

Branch: refs/heads/master
Commit: 3fcf18813fd9f7b5ecce041b2675548e82f7e574
Parents: 96ac8eb
Author: Sandhya Sundaresan <sa...@apache.org>
Authored: Mon Jan 4 18:36:25 2016 +0000
Committer: Sandhya Sundaresan <sa...@apache.org>
Committed: Mon Jan 4 18:36:25 2016 +0000

----------------------------------------------------------------------
 core/sql/bin/clitest.cpp           | 48 ++++++++++++++++-
 core/sql/cli/sqlcli.h              |  4 +-
 core/sql/clitest/blobtest.cpp      | 91 +++++++++++++++++++++++++++++++++
 core/sql/clitest/blobtest.h        |  3 ++
 core/sql/common/BaseTypes.cpp      | 27 +++++++---
 core/sql/exp/ExpLOB.cpp            | 70 ++++++++++++++++---------
 core/sql/exp/ExpLOB.h              | 13 ++++-
 core/sql/exp/ExpLOBaccess.cpp      | 24 ++++++---
 core/sql/exp/ExpLOBinterface.cpp   | 15 ++++--
 core/sql/generator/GenItemFunc.cpp |  7 +++
 core/sql/optimizer/ItemExpr.cpp    |  4 +-
 core/sql/optimizer/ItemFunc.h      | 17 +++---
 core/sql/optimizer/SynthType.cpp   | 33 +++++++++++-
 core/sql/parser/sqlparser.y        | 43 +++++++++++-----
 14 files changed, 329 insertions(+), 70 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/3fcf1881/core/sql/bin/clitest.cpp
----------------------------------------------------------------------
diff --git a/core/sql/bin/clitest.cpp b/core/sql/bin/clitest.cpp
index 261cdf6..360dadb 100644
--- a/core/sql/bin/clitest.cpp
+++ b/core/sql/bin/clitest.cpp
@@ -79,6 +79,10 @@ int main(int argc, const char * argv[])
       cout << "-------------------------------------------"<<endl;
       cout << "Blob test extract to buffer         1      "<< endl;
       cout << "Blob test extract to file in chunks 2      "<< endl;
+      cout << "Blob test to insert to lob column   3     "<< endl;
+      cout << "Blob test to update lob column      4     "<< endl;
+      cout << "Blob test to append to lob column   5      "<< endl;
+
       return 0;
     }
   Int32 retcode = 0;
@@ -211,9 +215,51 @@ int main(int argc, const char * argv[])
       }
      
       break;
+    
+    case 3:
+      {
+	
+	cout <<"*************************************"  <<endl;
+	cout << "Blob test insert lobdata from a buffer " << endl;
+	cout << "Input lob table name (1st int column, 2nd blob column:" << endl;
+	cin.getline(tablename,40);
+	cout << "Table name : " << tablename << endl;
+	retcode = insertBufferToLob(cliGlob,tablename);
+	return retcode;
+      }
+      break;
+    case 4:
+      {
+	
+	cout <<"*************************************"  <<endl;
+	cout << "Blob test update lobdata from a buffer " << endl;
+	cout << "Input lob table name :" << endl;
+	cin.getline(tablename,40);
+	cout << "Table name (1st int column ,2nd blob column): " << tablename << endl;
+	cout << "Input lob column name to update :" << endl;
+	cin.getline(columnname,40); 
+	cout << "Column Name : " << columnname << endl;
+	retcode = updateBufferToLob(cliGlob,tablename,columnname);
+	return retcode;
+      }
+      break;
+    case 5:
+      {
+	
+	cout <<"*************************************"  <<endl;
+	cout << "Blob test update append lobdata from a buffer " << endl;
+	cout << "Input lob table name :" << endl;
+	cin.getline(tablename,40);
+	cout << "Table name (1st int column , 2nd blob column: " << tablename << endl;
+	cout << "Input lob column name to update :" << endl;
+	cin.getline(columnname,40); 
+	cout << "Column Name : " << columnname << endl;
+	retcode = updateAppendBufferToLob(cliGlob,tablename,columnname);
+	return retcode;
+      }
+      break;
     }
   
-  
   return 0;
   
 }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/3fcf1881/core/sql/cli/sqlcli.h
----------------------------------------------------------------------
diff --git a/core/sql/cli/sqlcli.h b/core/sql/cli/sqlcli.h
index 07338db..e68bc30 100644
--- a/core/sql/cli/sqlcli.h
+++ b/core/sql/cli/sqlcli.h
@@ -409,7 +409,9 @@ enum SQLTYPE_CODE {
 
     /* LONG VARCHAR/ODBC CHARACTER VARYING */
     SQLTYPECODE_VARCHAR_LONG  = -1,		/* ## NEGATIVE??? */
-
+    /* BLOB TYPE */
+    SQLTYPECODE_BLOB  = -602,
+    SQLTYPECODE_CLOB  = -603,
     /* no ANSI value 13 */
 
     /* BIT */

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/3fcf1881/core/sql/clitest/blobtest.cpp
----------------------------------------------------------------------
diff --git a/core/sql/clitest/blobtest.cpp b/core/sql/clitest/blobtest.cpp
index 6abc04f..44570b0 100644
--- a/core/sql/clitest/blobtest.cpp
+++ b/core/sql/clitest/blobtest.cpp
@@ -129,3 +129,94 @@ Int32 extractLobToFileInChunks(CliGlobals *cliglob,  char * lobHandle, char *fil
   return retcode;
 
 }
+
+
+Int32 insertBufferToLob(CliGlobals *cliglob, char *tableName)
+{
+  Int32 retcode = 0;
+  ExeCliInterface cliInterface((cliglob->currContext())->exHeap(), (Int32)SQLCHARSETCODE_UTF8, cliglob->currContext(),NULL);
+  // Extract lob data into a buffer.
+  char * query = new char [500];
+  
+ 
+  char statusBuf[200] = {'\0'};
+  Int32 statusBufLen = 0;
+  Int64 lobInsertLen = 10;
+  char *lobDataBuf = new char[lobInsertLen];
+  memcpy(lobDataBuf, "xxxxxyyyyy",10);
+  str_sprintf(query,"insert into %s values (1, buffertolob (LOCATION %Ld, SIZE %Ld))", tableName,(Int64)lobDataBuf, lobInsertLen);
+ 
+ 
+  retcode = cliInterface.executeImmediate(query);
+  if (retcode <0)
+    return retcode;
+
+  retcode = cliInterface.executeImmediate("commit work");
+  delete query;
+  delete lobDataBuf;
+    
+
+  return retcode;
+
+}
+
+
+Int32 updateBufferToLob(CliGlobals *cliglob, char *tableName, char *columnName)
+{
+  Int32 retcode = 0;
+  ExeCliInterface cliInterface((cliglob->currContext())->exHeap(), (Int32)SQLCHARSETCODE_UTF8, cliglob->currContext(),NULL);
+  // Extract lob data into a buffer.
+  char * query = new char [500];
+  
+ 
+  char statusBuf[200] = {'\0'};
+  Int32 statusBufLen = 0;
+  Int64 lobUpdateLen = 10;
+  char *lobDataBuf = new char[lobUpdateLen];
+  memcpy(lobDataBuf, "zzzzzzzzzzzzzzzzzzzz",20);
+  str_sprintf(query,"update %s set %s= buffertolob(LOCATION %Ld, SIZE %Ld)", tableName,columnName, (Int64)lobDataBuf, lobUpdateLen);
+ 
+ 
+  retcode = cliInterface.executeImmediate(query);
+  if (retcode <0)
+    return retcode;
+
+  retcode = cliInterface.executeImmediate("commit work");
+  delete query;
+  delete lobDataBuf;
+    
+
+  return retcode;
+
+}
+
+
+
+Int32 updateAppendBufferToLob(CliGlobals *cliglob, char *tableName, char *columnName)
+{
+  Int32 retcode = 0;
+  ExeCliInterface cliInterface((cliglob->currContext())->exHeap(), (Int32)SQLCHARSETCODE_UTF8, cliglob->currContext(),NULL);
+  // Extract lob data into a buffer.
+  char * query = new char [500];
+  
+ 
+  char statusBuf[200] = {'\0'};
+  Int32 statusBufLen = 0;
+  Int64 lobUpdateLen = 10;
+  char *lobDataBuf = new char[lobUpdateLen];
+  memcpy(lobDataBuf, "aaaaabbbbbccccc",15);
+  str_sprintf(query,"update %s set %s=buffertolob (LOCATION %Ld, SIZE %Ld,append)", tableName, columnName,(Int64)lobDataBuf, lobUpdateLen);
+ 
+ 
+  retcode = cliInterface.executeImmediate(query);
+  if (retcode <0)
+    return retcode;
+
+  retcode = cliInterface.executeImmediate("commit work");
+  delete query;
+  delete lobDataBuf;
+    
+
+  return retcode;
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/3fcf1881/core/sql/clitest/blobtest.h
----------------------------------------------------------------------
diff --git a/core/sql/clitest/blobtest.h b/core/sql/clitest/blobtest.h
index da34fa7..3832ee6 100644
--- a/core/sql/clitest/blobtest.h
+++ b/core/sql/clitest/blobtest.h
@@ -37,3 +37,6 @@ Int32 extractLobToBuffer(CliGlobals *cliglob, char * lobHandle, Int64 &lengthOfL
 			 char *lobColumnName, char *tableName);
 Int32 extractLobToFileInChunks(CliGlobals *cliglob, char * lobHandle, char *filename, Int64 &lengthOfLob, 
 			 char *lobColumnName, char *tableName);
+Int32 insertBufferToLob(CliGlobals *cliglob,char *tbaleName);
+Int32 updateBufferToLob(CliGlobals *cliglob, char *tableName, char *columnName);
+Int32 updateAppendBufferToLob(CliGlobals *cliGlob, char *tableName, char *columnName);

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/3fcf1881/core/sql/common/BaseTypes.cpp
----------------------------------------------------------------------
diff --git a/core/sql/common/BaseTypes.cpp b/core/sql/common/BaseTypes.cpp
index e9c49d6..bcc6cf6 100644
--- a/core/sql/common/BaseTypes.cpp
+++ b/core/sql/common/BaseTypes.cpp
@@ -733,6 +733,12 @@ Lng32 getAnsiTypeFromFSType(Lng32 datatype)
    case REC_DATETIME:
       numeric_value = SQLTYPECODE_DATETIME;
       break;
+   case REC_BLOB:
+     numeric_value = SQLTYPECODE_BLOB;
+     break;
+   case REC_CLOB:
+     numeric_value = SQLTYPECODE_CLOB;
+     break;
 
    case REC_INT_YEAR:
    case REC_INT_MONTH:
@@ -832,6 +838,13 @@ const char * getAnsiTypeStrFromFSType(Lng32 datatype)
      return COM_DATETIME_SDT_LIT;
      break;
 
+   case REC_BLOB:
+     return COM_BLOB_SDT_LIT;
+     break;
+   case REC_CLOB:
+     return COM_CLOB_SDT_LIT;
+     break;
+
    case REC_INT_YEAR:
    case REC_INT_MONTH:
    case REC_INT_YEAR_MONTH:
@@ -847,12 +860,7 @@ const char * getAnsiTypeStrFromFSType(Lng32 datatype)
    case REC_INT_DAY_SECOND:
      return COM_INTERVAL_SDT_LIT;
      break;
-   case REC_BLOB:
-     return COM_BLOB_SDT_LIT;
-     break;
-   case REC_CLOB:
-       return COM_CLOB_SDT_LIT;
-     break;
+   
    default:
       // error
       break;
@@ -1081,7 +1089,12 @@ Lng32 getFSTypeFromANSIType(Lng32 ansitype)
    case SQLTYPECODE_DATETIME:
       datatype = REC_DATETIME;
       break;
-
+   case SQLTYPECODE_BLOB:
+     datatype = REC_BLOB;
+     break;
+   case SQLTYPECODE_CLOB:
+     datatype = REC_CLOB;
+     break;
    default:
       // error
       datatype = ansitype;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/3fcf1881/core/sql/exp/ExpLOB.cpp
----------------------------------------------------------------------
diff --git a/core/sql/exp/ExpLOB.cpp b/core/sql/exp/ExpLOB.cpp
index 9905fe4..18470d6 100644
--- a/core/sql/exp/ExpLOB.cpp
+++ b/core/sql/exp/ExpLOB.cpp
@@ -579,12 +579,13 @@ ExpLOBiud::ExpLOBiud(OperatorTypeEnum oper_type,
 ////////////////////////////////////////////////////////
 ExpLOBinsert::ExpLOBinsert(){};
 ExpLOBinsert::ExpLOBinsert(OperatorTypeEnum oper_type,
-			   Attributes ** attr, 
+			   Lng32 numAttrs,
+			   Attributes ** attr,			   
 			   Int64 objectUID,
 			   short descSchNameLen,
 			   char * descSchName,
 			   Space * space)
-  : ExpLOBiud(oper_type, 2, attr, objectUID, descSchNameLen, descSchName, space),
+  : ExpLOBiud(oper_type, numAttrs, attr, objectUID, descSchNameLen, descSchName, space),
     //    objectUID_(objectUID),
     //    descSchNameLen_(descSchNameLen),
     liFlags_(0)
@@ -657,8 +658,10 @@ ex_expr::exp_return_type ExpLOBiud::insertDesc(char *op_data[],
     so = Lob_Memory;
   else if (fromLob())
     so = Lob_Foreign_Lob;
+  else if (fromBuffer())
+    so = Lob_Buffer;
 
-  Int64 tempLobLen = getOperand(1)->getLength();
+  
 
   Lng32 waitedOp = 0;
 #ifdef __EID
@@ -691,7 +694,10 @@ ex_expr::exp_return_type ExpLOBiud::insertDesc(char *op_data[],
       str_cpy_and_null(lobData,op_data[1],lobLen,'\0',' ',TRUE);
       
     }
- 
+  if (so == Lob_Buffer)
+    {
+      memcpy(&lobLen, op_data[2],sizeof(Int64));
+    }
   LobsOper lo ;
  
   if (lobOperStatus == CHECK_STATUS_)
@@ -806,6 +812,11 @@ ex_expr::exp_return_type ExpLOBiud::insertData(Lng32 handleLen,
     }
     else
       lobData = op_data[1];
+  if (fromBuffer())
+    {
+      memcpy(&lobLen, op_data[2],sizeof(Int64)); // user specified buffer length
+      memcpy(lobData,op_data[1],sizeof(Int64)); // user buffer address
+    }
   LobsOper lo ;
  
   if (lobOperStatus == CHECK_STATUS_)
@@ -822,6 +833,8 @@ ex_expr::exp_return_type ExpLOBiud::insertData(Lng32 handleLen,
     so = Lob_Memory;
   else if (fromLob())
     so = Lob_Foreign_Lob;
+  else if(fromBuffer())
+    so = Lob_Buffer;
 
  
   Lng32 waitedOp = 0;
@@ -1108,27 +1121,27 @@ ex_expr::exp_return_type ExpLOBupdate::eval(char *op_data[],
   short sSchNameLen = 0;
   char sSchName[500];
 
- if (getOperand(2)->getNullFlag() &&
-     nullValue_)
-   {
-     ex_expr::exp_return_type err = insertDesc(op_data, h, diagsArea);
-     if (err == ex_expr::EXPR_ERROR)
-       return err;
+  if (getOperand(2)->getNullFlag() &&
+      nullValue_)
+    {
+      ex_expr::exp_return_type err = insertDesc(op_data, h, diagsArea);
+      if (err == ex_expr::EXPR_ERROR)
+	return err;
      
-     char * handle = op_data[0];
-     Lng32 handleLen = getOperand(0)->getLength();
-     err = insertData(handleLen, handle, op_data, h, diagsArea);
+      char * handle = op_data[0];
+      handleLen = getOperand(0)->getLength();
+      err = insertData(handleLen, handle, op_data, h, diagsArea);
      
-     return err;
+      return err;
 
-   }
- else
-   {
-     lobHandle = op_data[2];
-
-     handleLen = getOperand(2)->getLength(op_data[-MAX_OPERANDS+2]);
-   }
+    }
+  else
+    {
+      lobHandle = op_data[2];
 
+      handleLen = getOperand(2)->getLength(op_data[-MAX_OPERANDS+2]);
+    }
+     
   extractFromLOBhandle(&sFlags, &sLobType, &sLobNum, &sUid,
 		       &sDescSyskey, &sDescTS, 
 		       &sSchNameLen, sSchName,
@@ -1171,6 +1184,8 @@ ex_expr::exp_return_type ExpLOBupdate::eval(char *op_data[],
     so = Lob_Memory;
   else if (fromLob())
     so = Lob_Foreign_Lob;
+  else if (fromBuffer())
+    so= Lob_Buffer;
 
   Lng32 waitedOp = 0;
 #ifdef __EID
@@ -1190,7 +1205,11 @@ ex_expr::exp_return_type ExpLOBupdate::eval(char *op_data[],
   //  Int64 offset = 0;
   Int64 lobLen = getOperand(1)->getLength();
   char * data = op_data[1];
-
+  if (fromBuffer())
+    {
+      memcpy(&lobLen, op_data[3],sizeof(Int64)); // user specified buffer length
+      memcpy(data,op_data[1],sizeof(Int64)); // user buffer address
+    }
   if (isAppend())
     {
       rc = ExpLOBInterfaceUpdateAppend
@@ -1199,7 +1218,7 @@ ex_expr::exp_return_type ExpLOBupdate::eval(char *op_data[],
 	 getLobHdfsPort(),
 	 tgtLobName, 
 	 lobStorageLocation(),
-	 handleLen, op_data[2],
+	 handleLen, lobHandle,
 	 &outHandleLen_, outLobHandle_,
 	 requestTag_,
 	 getExeGlobals()->lobGlobals()->xnId(),
@@ -1222,7 +1241,7 @@ ex_expr::exp_return_type ExpLOBupdate::eval(char *op_data[],
 	 getLobHdfsPort(),
 	 tgtLobName, 
 	 lobStorageLocation(),
-	 handleLen, op_data[2],
+	 handleLen, lobHandle,
 	 &outHandleLen_, outLobHandle_,
 	 requestTag_,
 	 getExeGlobals()->lobGlobals()->xnId(),
@@ -1563,12 +1582,13 @@ ex_expr::exp_return_type ExpLOBconvertHandle::eval(char *op_data[],
 ////////////////////////////////////////////////////////
 ExpLOBload::ExpLOBload(){};
 ExpLOBload::ExpLOBload(OperatorTypeEnum oper_type,
+		       Lng32 numAttrs,
 		       Attributes ** attr, 
 		       Int64 objectUID,
 		       short descSchNameLen,
 		       char * descSchName,
 		       Space * space)
-  : ExpLOBinsert(oper_type, attr, objectUID, 
+  : ExpLOBinsert(oper_type, numAttrs,attr, objectUID, 
 		 descSchNameLen, descSchName, space),
     llFlags_(0)
 {

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/3fcf1881/core/sql/exp/ExpLOB.h
----------------------------------------------------------------------
diff --git a/core/sql/exp/ExpLOB.h b/core/sql/exp/ExpLOB.h
index cf58f8d..de74b4a 100644
--- a/core/sql/exp/ExpLOB.h
+++ b/core/sql/exp/ExpLOB.h
@@ -430,7 +430,15 @@ class ExpLOBiud : public ExpLOBoper {
   {
     (v) ? liudFlags_ |= FROM_STRING: liudFlags_ &= ~FROM_STRING;
   };
+  NA_EIDPROC NABoolean fromBuffer()
+  {
+    return ((liudFlags_ & FROM_BUFFER) != 0);
+  };
 
+  NA_EIDPROC inline void setFromBuffer(NABoolean v)
+  {
+    (v) ? liudFlags_ |= FROM_BUFFER: liudFlags_ &= ~FROM_BUFFER;
+  };
   NA_EIDPROC NABoolean fromFile()
   {
     return ((liudFlags_ & FROM_FILE) != 0);
@@ -481,7 +489,8 @@ class ExpLOBiud : public ExpLOBoper {
     FROM_FILE          = 0x0004,
     FROM_LOAD          = 0x0008,
     FROM_LOB           = 0x0010,
-    FROM_EXTERNAL      = 0x0020
+    FROM_EXTERNAL      = 0x0020,
+    FROM_BUFFER        = 0x0040
   };
 
   Lng32 liudFlags_;
@@ -491,6 +500,7 @@ class ExpLOBiud : public ExpLOBoper {
 class ExpLOBinsert : public ExpLOBiud {
 public:
   ExpLOBinsert(OperatorTypeEnum oper_type,
+	       Lng32 numAttrs,
 	       Attributes ** attr, 
 	       Int64 objectUID,
 	       short descSchNameLen,
@@ -870,6 +880,7 @@ public:
 class ExpLOBload : public ExpLOBinsert {
 public:
   ExpLOBload(OperatorTypeEnum oper_type,
+	     Lng32 numAttrs,
 	     Attributes ** attr, 
 	     Int64 objectUID,
 	     short descSchNameLen,

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/3fcf1881/core/sql/exp/ExpLOBaccess.cpp
----------------------------------------------------------------------
diff --git a/core/sql/exp/ExpLOBaccess.cpp b/core/sql/exp/ExpLOBaccess.cpp
index b52f183..f16d48b 100644
--- a/core/sql/exp/ExpLOBaccess.cpp
+++ b/core/sql/exp/ExpLOBaccess.cpp
@@ -854,8 +854,12 @@ Ex_Lob_Error ExLob::append(char *data, Int64 size, LobsSubOper so, Int64 headDes
        return LOB_DESC_APPEND_ERROR;
     }
 
-   
-    err = writeLobData(data, sourceLen,so,dataOffset,operLen,lobMaxChunkMemSize);
+    char *inputAddr = data;
+    if (so == Lob_Buffer)
+      {
+	inputAddr = (char *)(*(long *)data);
+      }
+    err = writeLobData(inputAddr, sourceLen,so,dataOffset,operLen,lobMaxChunkMemSize);
     if (err != LOB_OPER_OK)
       return err;
     return LOB_OPER_OK;
@@ -882,6 +886,10 @@ Ex_Lob_Error ExLob::insertData(char *data, Int64 size, LobsSubOper so,Int64 head
     }
 
     char *inputAddr = data;
+    if (so == Lob_Buffer)
+      {
+	inputAddr = (char *)(*(long *)data);
+      }
     Int64 inputSize = desc.getSize();
     Int64 tgtOffset = desc.getOffset();
     err = writeLobData(inputAddr, inputSize,so, tgtOffset, 
@@ -926,9 +934,13 @@ Ex_Lob_Error ExLob::update(char *data, Int64 size, LobsSubOper so,Int64 headDesc
     if (cliErr < 0 || cliErr == 100) { // some error or EOD.
        return LOB_DESC_UPDATE_ERROR;
     }
-
+    char *inputAddr = data;
+    if (so == Lob_Buffer)
+      {
+	inputAddr = (char *)(*(long *)data);
+      }
    
-    err = writeLobData(data, sourceLen,so,dataOffset,operLen,lobMaxChunkMemSize);
+    err = writeLobData(inputAddr, sourceLen,so,dataOffset,operLen,lobMaxChunkMemSize);
     if (err != LOB_OPER_OK)
       return err;
     return LOB_OPER_OK;
@@ -2805,7 +2817,7 @@ Ex_Lob_Error ExLobsOper (
       break;
 
     case Lob_Append:
-      if (subOperation == Lob_Memory)
+      if ((subOperation == Lob_Memory) ||(subOperation == Lob_Buffer))
 	err = lobPtr->append(source, sourceLen, subOperation, descNumIn, retOperLen,lobMaxSize, lobMaxChunkMemSize);
       else if (subOperation == Lob_File)
 	err = lobPtr->append(source, -1, subOperation, descNumIn, retOperLen,lobMaxSize, lobMaxChunkMemSize);
@@ -2814,7 +2826,7 @@ Ex_Lob_Error ExLobsOper (
       break;
 
     case Lob_Update:
-      if (subOperation == Lob_Memory)
+      if ((subOperation == Lob_Memory)||(subOperation == Lob_Buffer))
 	err = lobPtr->update(source, sourceLen, subOperation, descNumIn, retOperLen, lobMaxSize, lobMaxChunkMemSize);
       else if (subOperation == Lob_File)
 	err = lobPtr->update(source, -1, subOperation,descNumIn, retOperLen,lobMaxSize, lobMaxChunkMemSize); 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/3fcf1881/core/sql/exp/ExpLOBinterface.cpp
----------------------------------------------------------------------
diff --git a/core/sql/exp/ExpLOBinterface.cpp b/core/sql/exp/ExpLOBinterface.cpp
index 1790a50..d55bab9 100644
--- a/core/sql/exp/ExpLOBinterface.cpp
+++ b/core/sql/exp/ExpLOBinterface.cpp
@@ -492,7 +492,11 @@ Lng32 ExpLOBInterfaceUpdateAppend(void * lobGlob,
   Int64 savedTgtLobLen = tgtLobLen;
   Ex_Lob_Error status;
   Int64 cliError = -1;
-
+  Int64 srcLen = 0;
+  if(so == Lob_Memory)
+    srcLen = strlen(srcLobData);
+  else if (so == Lob_Buffer)
+    srcLen = tgtLobLen;
   err = ExLobsOper(tgtLobName, 
                    lobHandle, handleLen, 
 		   lobHdfsServer, lobHdfsPort, // hdfs server/port
@@ -500,7 +504,7 @@ Lng32 ExpLOBInterfaceUpdateAppend(void * lobGlob,
 		   tgtDescSyskey, dummyParam, operLen,
                    0, dummyParam, status, cliError,
                    lobStorageLocation, Lob_HDFS_File,
-                   srcLobData, strlen(srcLobData), //strlen(srcLobData),
+                   srcLobData, srcLen, //strlen(srcLobData),
 		   0,NULL,
                    Lob_Append,
                    so,
@@ -570,6 +574,11 @@ Lng32 ExpLOBInterfaceUpdate(void * lobGlob,
   Int64 savedTgtLobLen = tgtLobLen;
   Ex_Lob_Error status;
   Int64 cliError = -1;
+  Int64 sourceLen = 0;
+  if(so == Lob_Memory)
+    sourceLen = strlen(srcLobData);
+  else if (so == Lob_Buffer)
+    sourceLen = tgtLobLen;
 
   err = ExLobsOper(tgtLobName, 
                    lobHandle, handleLen, 
@@ -578,7 +587,7 @@ Lng32 ExpLOBInterfaceUpdate(void * lobGlob,
 		   tgtDescSyskey, dummyParam, operLen,
                    0, dummyParam, status, cliError,
                    lobStorageLocation, Lob_HDFS_File,
-                   srcLobData, strlen(srcLobData), //strlen(srcLobData),
+                   srcLobData, sourceLen, 
 		   0,NULL,
                    Lob_Update,
                    so,

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/3fcf1881/core/sql/generator/GenItemFunc.cpp
----------------------------------------------------------------------
diff --git a/core/sql/generator/GenItemFunc.cpp b/core/sql/generator/GenItemFunc.cpp
index 94db476..c7e6748 100644
--- a/core/sql/generator/GenItemFunc.cpp
+++ b/core/sql/generator/GenItemFunc.cpp
@@ -2814,6 +2814,7 @@ short LOBinsert::codeGen(Generator * generator)
   ExpLOBinsert * li =
     new(generator->getSpace()) ExpLOBinsert
     (getOperatorType(), 
+     getArity()+1,
      attr, 
      objectUID_,
      (short)insertedTableSchemaName().length(),
@@ -2830,6 +2831,8 @@ short LOBinsert::codeGen(Generator * generator)
     li->setFromLob(TRUE);
   else if (obj_ == LOBoper::EXTERNAL_)
     li->setFromExternal(TRUE);
+  else if (obj_ ==LOBoper::BUFFER_)
+    li->setFromBuffer(TRUE);
 
   li->lobNum() = lobNum();
   li->setLobStorageType(lobStorageType());
@@ -2897,6 +2900,8 @@ short LOBupdate::codeGen(Generator * generator)
     lu->setFromLob(TRUE);
   else if (obj_ == LOBoper::EXTERNAL_)
     lu->setFromExternal(TRUE);
+  else if (obj_ == LOBoper::BUFFER_)
+    lu->setFromBuffer(TRUE);
 
   lu->lobNum() = lobNum();
   lu->setLobStorageType(lobStorageType());
@@ -2997,6 +3002,7 @@ short LOBload::codeGen(Generator * generator)
   ExpLOBload * ll =
     new(generator->getSpace()) ExpLOBload
     (getOperatorType(), 
+     getArity()+1,
      attr, 
      objectUID_,
      (short)insertedTableSchemaName().length(),
@@ -3011,6 +3017,7 @@ short LOBload::codeGen(Generator * generator)
     ll->setFromLoad(TRUE);
   else if (obj_ == LOBoper::LOB_)
     ll->setFromLob(TRUE);
+  
 
   ll->lobNum() = lobNum();
   ll->setLobStorageType(lobStorageType());

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/3fcf1881/core/sql/optimizer/ItemExpr.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/ItemExpr.cpp b/core/sql/optimizer/ItemExpr.cpp
index cde3298..41b6b76 100644
--- a/core/sql/optimizer/ItemExpr.cpp
+++ b/core/sql/optimizer/ItemExpr.cpp
@@ -12529,7 +12529,7 @@ ItemExpr * LOBoper::copyTopNode(ItemExpr *derivedNode, CollHeap* outHeap)
   LOBoper *result;
 
   if (derivedNode == NULL)
-    result = new (outHeap) LOBoper(getOperatorType(), NULL, NULL, obj_);
+    result = new (outHeap) LOBoper(getOperatorType(), NULL, NULL, NULL,obj_);
   else
     result = (LOBoper*)derivedNode;
 
@@ -12587,7 +12587,7 @@ ItemExpr * LOBupdate::copyTopNode(ItemExpr *derivedNode, CollHeap* outHeap)
   LOBupdate *result;
 
   if (derivedNode == NULL)
-    result = new (outHeap) LOBupdate(NULL, NULL, obj_, append_);
+    result = new (outHeap) LOBupdate(NULL, NULL, NULL,obj_, append_);
   else
     result = (LOBupdate*)derivedNode;
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/3fcf1881/core/sql/optimizer/ItemFunc.h
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/ItemFunc.h b/core/sql/optimizer/ItemFunc.h
index 7f77422..3bb7238 100644
--- a/core/sql/optimizer/ItemFunc.h
+++ b/core/sql/optimizer/ItemFunc.h
@@ -2700,10 +2700,10 @@ public:
  };
 
  LOBoper(OperatorTypeEnum otype,
-	 ItemExpr *val1Ptr, ItemExpr *val2Ptr = NULL, 
+	 ItemExpr *val1Ptr, ItemExpr *val2Ptr = NULL,ItemExpr *val3Ptr = NULL, 
 	 ObjectType obj = NOOP_)
    : BuiltinFunction(otype,  CmpCommon::statementHeap(),
-                     2, val1Ptr, val2Ptr),
+                     3, val1Ptr, val2Ptr,val3Ptr),
    obj_(obj),
    lobNum_(-1),
    lobStorageType_(Lob_Invalid_Storage),
@@ -2758,7 +2758,7 @@ class LOBinsert : public LOBoper
 	   ObjectType fromObj, 
 	   NABoolean isAppend = FALSE,
 	   OperatorTypeEnum otype = ITM_LOBINSERT)
-   : LOBoper(otype, val1Ptr, val2Ptr,fromObj),
+   : LOBoper(otype, val1Ptr, val2Ptr,NULL,fromObj),
     objectUID_(-1),
     append_(isAppend),
     lobSize_(0),
@@ -2814,7 +2814,7 @@ class LOBselect : public LOBoper
  public:
   
  LOBselect(ItemExpr *val1Ptr, ItemExpr *val2Ptr, ObjectType toObj)
-   : LOBoper(ITM_LOBSELECT, val1Ptr, val2Ptr, toObj)
+   : LOBoper(ITM_LOBSELECT, val1Ptr, val2Ptr,NULL,toObj)
     {
     };
   
@@ -2858,9 +2858,10 @@ class LOBupdate : public LOBoper
   
   LOBupdate(ItemExpr *val1Ptr,
 	    ItemExpr *val2Ptr,
+	    ItemExpr *val3Ptr,
 	    ObjectType fromObj, 
 	    NABoolean isAppend = FALSE)
-    : LOBoper(ITM_LOBUPDATE, val1Ptr, val2Ptr, fromObj),
+    : LOBoper(ITM_LOBUPDATE, val1Ptr, val2Ptr,val3Ptr,fromObj),
     objectUID_(-1),
     lobSize_(0),
     append_(isAppend)
@@ -2903,7 +2904,7 @@ class LOBconvert : public LOBoper
  public:
   
  LOBconvert(ItemExpr *val1Ptr, ObjectType toObj,  Lng32 tgtSize = 32000) 
-   : LOBoper(ITM_LOBCONVERT, val1Ptr, NULL,toObj),
+   : LOBoper(ITM_LOBCONVERT, val1Ptr, NULL,NULL,toObj),
     tgtSize_(tgtSize)     
     {};
   
@@ -2931,7 +2932,7 @@ class LOBconvertHandle : public LOBoper
  public:
   
  LOBconvertHandle(ItemExpr *val1Ptr, ObjectType toObj)
-   : LOBoper(ITM_LOBCONVERTHANDLE, val1Ptr, NULL,toObj)
+   : LOBoper(ITM_LOBCONVERTHANDLE, val1Ptr, NULL,NULL,toObj)
     {};
   
   // copyTopNode method
@@ -2970,7 +2971,7 @@ class LOBextract : public LOBoper
  public:
   
  LOBextract(ItemExpr *val1Ptr, Lng32 tgtSize = 1000)
-   : LOBoper(ITM_LOBEXTRACT, val1Ptr, NULL,EXTRACT_),
+   : LOBoper(ITM_LOBEXTRACT, val1Ptr, NULL,NULL,EXTRACT_),
     tgtSize_(tgtSize)
     {};
   

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/3fcf1881/core/sql/optimizer/SynthType.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/SynthType.cpp b/core/sql/optimizer/SynthType.cpp
index 8484247..b9d5518 100644
--- a/core/sql/optimizer/SynthType.cpp
+++ b/core/sql/optimizer/SynthType.cpp
@@ -6462,7 +6462,6 @@ const NAType *LOBinsert::synthesizeType()
 
   if ((obj_ == STRING_) ||
       (obj_ == FILE_) ||
-      (obj_ == BUFFER_) ||
       (obj_ == EXTERNAL_) ||
       (obj_ == LOAD_))
     {
@@ -6484,6 +6483,16 @@ const NAType *LOBinsert::synthesizeType()
 	  return NULL;
 	}
     }
+  else if (obj_ == BUFFER_)
+    {
+     if (typ1.getTypeQualifier() != NA_NUMERIC_TYPE)
+	{
+	  // 4043 The operand of a $0~String0 function must be blob
+	  *CmpCommon::diags() << DgSqlCode(-4221) << DgString0("LOBINSERT")
+			      << DgString1("LARGEINT");
+	  return NULL;
+	} 
+    }
   else 
     {
       // 4221 The operand of a $0~String0 function must be character.
@@ -6517,9 +6526,10 @@ const NAType *LOBupdate::synthesizeType()
   ValueId vid2 = child(1)->getValueId();
   const NAType &typ2 = (NAType&)vid2.getType();
 
+ 
+
   if ((obj_ == STRING_) ||
       (obj_ == FILE_) ||
-      (obj_ == BUFFER_) ||
       (obj_ == EXTERNAL_))
     {
       if (typ1.getTypeQualifier() != NA_CHARACTER_TYPE)
@@ -6540,6 +6550,25 @@ const NAType *LOBupdate::synthesizeType()
 	  return NULL;
 	}
     }
+  else if (obj_ == BUFFER_)
+    {
+     if (typ1.getTypeQualifier() != NA_NUMERIC_TYPE)
+	{
+	  // 4043 The operand of a $0~String0 function must be blob
+	  *CmpCommon::diags() << DgSqlCode(-4221) << DgString0("LOBUPDATE")
+			      << DgString1("LARGEINT");
+	  return NULL;
+	} 
+      ValueId vid3 = child(2)->getValueId();
+      const  NAType &typ3 = (NAType&)vid3.getType();
+      if (typ3.getTypeQualifier() != NA_NUMERIC_TYPE)
+	{
+	  // 4043 The operand of a $0~String0 function must be blob
+	  *CmpCommon::diags() << DgSqlCode(-4221) << DgString0("LOBUPDATE")
+			      << DgString1("LARGEINT");
+	  return NULL;
+	} 
+    }
   else 
     {
       // 4221 The operand of a $0~String0 function must be character.

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/3fcf1881/core/sql/parser/sqlparser.y
----------------------------------------------------------------------
diff --git a/core/sql/parser/sqlparser.y b/core/sql/parser/sqlparser.y
index 23883ec..eb6055f 100755
--- a/core/sql/parser/sqlparser.y
+++ b/core/sql/parser/sqlparser.y
@@ -12680,9 +12680,14 @@ insert_obj_to_lob_function :
 			        {
 				  $$ = new (PARSERHEAP()) LOBinsert( $3, NULL, LOBoper::STRING_, FALSE);
 				}			       
-			  | TOK_BUFFERTOLOB '(' TOK_LOCATION character_literal_sbyte ',' TOK_SIZE numeric_literal_exact ')'
+			  | TOK_BUFFERTOLOB '(' TOK_LOCATION  value_expression',' TOK_SIZE value_expression')'
 			        {
-				  $$ = new (PARSERHEAP()) LOBinsert( $4, $7, LOBoper::BUFFER_, FALSE);
+				  ItemExpr *bufAddr = $4;
+				  ItemExpr *bufSize = $7;
+				  bufAddr = new (PARSERHEAP())Cast(bufAddr, new (PARSERHEAP()) SQLLargeInt(TRUE,FALSE));
+				  bufSize = new (PARSERHEAP())
+				    Cast(bufSize, new (PARSERHEAP()) SQLLargeInt(TRUE, FALSE));
+				  $$ = new (PARSERHEAP()) LOBinsert( bufAddr, bufSize, LOBoper::BUFFER_, FALSE);
 				}
                           | TOK_FILETOLOB '(' character_literal_sbyte ')'
 			        {
@@ -12708,45 +12713,55 @@ insert_obj_to_lob_function :
 update_obj_to_lob_function : 
 			    TOK_STRINGTOLOB '(' value_expression ')'
 			        {
-				  $$ = new (PARSERHEAP()) LOBupdate( $3, NULL, LOBoper::STRING_, FALSE);
+				  $$ = new (PARSERHEAP()) LOBupdate( $3, NULL, NULL,LOBoper::STRING_, FALSE);
 				}
 			  | TOK_STRINGTOLOB '(' value_expression ',' TOK_APPEND ')'
 			        {
-				  $$ = new (PARSERHEAP()) LOBupdate( $3, NULL, LOBoper::STRING_, TRUE);
+				  $$ = new (PARSERHEAP()) LOBupdate( $3, NULL,NULL, LOBoper::STRING_, TRUE);
 				}
                           | TOK_FILETOLOB '('character_literal_sbyte ')'
 			        {
 				 
-				  $$ = new (PARSERHEAP()) LOBupdate( $3, NULL,LOBoper::FILE_, FALSE);
+				  $$ = new (PARSERHEAP()) LOBupdate( $3, NULL,NULL,LOBoper::FILE_, FALSE);
 				}
                           | TOK_FILETOLOB '('character_literal_sbyte ',' TOK_APPEND ')'
 			        {
 				 
-				  $$ = new (PARSERHEAP()) LOBupdate( $3,NULL, LOBoper::FILE_, TRUE);
+				  $$ = new (PARSERHEAP()) LOBupdate( $3,NULL, NULL,LOBoper::FILE_, TRUE);
 				}
-			  | TOK_BUFFERTOLOB '(' TOK_LOCATION character_literal_sbyte ',' TOK_SIZE numeric_literal_exact ')'
+			  | TOK_BUFFERTOLOB '(' TOK_LOCATION  value_expression ',' TOK_SIZE value_expression ')'
 			        {
-				  $$ = new (PARSERHEAP()) LOBinsert( $4, $7, LOBoper::BUFFER_, FALSE);
+				  ItemExpr *bufAddr = $4;
+				  ItemExpr *bufSize = $7;
+				  bufAddr = new (PARSERHEAP())Cast(bufAddr, new (PARSERHEAP()) SQLLargeInt(TRUE,FALSE));
+				  bufSize = new (PARSERHEAP())
+				    Cast(bufSize, new (PARSERHEAP()) SQLLargeInt(TRUE, FALSE));
+				  $$ = new (PARSERHEAP()) LOBupdate( bufAddr, NULL,bufSize, LOBoper::BUFFER_, FALSE);
 				}
-			  | TOK_BUFFERTOLOB '(' TOK_LOCATION character_literal_sbyte ',' TOK_SIZE numeric_literal_exact ',' TOK_APPEND')'
+			  | TOK_BUFFERTOLOB '(' TOK_LOCATION value_expression ',' TOK_SIZE value_expression ',' TOK_APPEND')'
 			        {
-				  $$ = new (PARSERHEAP()) LOBinsert( $4, $7, LOBoper::BUFFER_, TRUE);
+				  ItemExpr *bufAddr = $4;
+				  ItemExpr *bufSize = $7;
+				  bufAddr = new (PARSERHEAP())Cast(bufAddr, new (PARSERHEAP()) SQLLargeInt(TRUE,FALSE));
+				  bufSize = new (PARSERHEAP())
+				    Cast(bufSize, new (PARSERHEAP()) SQLLargeInt(TRUE, FALSE));
+				  $$ = new (PARSERHEAP()) LOBupdate( bufAddr, NULL,bufSize, LOBoper::BUFFER_, TRUE);
 				}
 
 			  | TOK_EXTERNALTOLOB '(' literal ')'
 			        {
                                   YYERROR;
-				  $$ = new (PARSERHEAP()) LOBupdate( $3, NULL, LOBoper::EXTERNAL_, FALSE);
+				  $$ = new (PARSERHEAP()) LOBupdate( $3, NULL, NULL,LOBoper::EXTERNAL_, FALSE);
 				}
 			  | TOK_EXTERNALTOLOB '(' literal ',' literal ')'
 			        {
                                   YYERROR;
-				  $$ = new (PARSERHEAP()) LOBupdate( $3, $5, LOBoper::EXTERNAL_, FALSE);
+				  $$ = new (PARSERHEAP()) LOBupdate( $3, $5, NULL,LOBoper::EXTERNAL_, FALSE);
 				}
 			  | TOK_LOADTOLOB '(' literal ',' TOK_APPEND ')'
 			        {
 				  YYERROR;
-				  $$ = new (PARSERHEAP()) LOBupdate( $3, NULL, LOBoper::LOAD_, TRUE);
+				  $$ = new (PARSERHEAP()) LOBupdate( $3, NULL, NULL,LOBoper::LOAD_, TRUE);
 				}
 
 select_lob_to_obj_function : TOK_LOBTOFILE '(' value_expression ',' literal ')'
@@ -19720,7 +19735,7 @@ set_clause : identifier '=' value_expression
 					ColReference(new (PARSERHEAP()) ColRefName(*$1, PARSERHEAP()));
 				      
 				      LOBupdate * nlu = 
-					new (PARSERHEAP()) LOBupdate(lu->child(0), cr, 
+					new (PARSERHEAP()) LOBupdate(lu->child(0), cr, lu->child(2),
 								     lu->getObj(), lu->isAppend());
 				      
 				      rc = nlu;


[09/13] incubator-trafodion git commit: Additional fixes to deal with new Ansi blob datatype.

Posted by sa...@apache.org.
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 <sa...@apache.org>
Authored: Tue Jan 5 18:04:41 2016 +0000
Committer: Sandhya Sundaresan <sa...@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 ')'
                {


[04/13] incubator-trafodion git commit: Changed output param for SIZE to be an input/output address.

Posted by sa...@apache.org.
Changed output param for SIZE to be an input/output address.


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

Branch: refs/heads/master
Commit: 781682afe4ee662e06e9e9da6b0753e4f3d9d673
Parents: 353e1f3
Author: Sandhya Sundaresan <sa...@apache.org>
Authored: Fri Dec 11 19:25:39 2015 +0000
Committer: Sandhya Sundaresan <sa...@apache.org>
Committed: Fri Dec 11 19:25:39 2015 +0000

----------------------------------------------------------------------
 core/sql/bin/clitest.cpp             | 80 +++++++++++++++++++++++++++----
 core/sql/bin/vprocclitestdriver.cpp  | 51 ++++++++++++++++++++
 core/sql/clitest/blobtest.cpp        | 47 +++++++++++++++++-
 core/sql/clitest/blobtest.h          |  2 +
 core/sql/comexe/ComTdbExeUtil.cpp    |  6 +--
 core/sql/comexe/ComTdbExeUtil.h      |  6 +--
 core/sql/executor/ExExeUtilLoad.cpp  | 14 ++++--
 core/sql/generator/GenRelExeUtil.cpp |  2 +-
 core/sql/optimizer/RelExeUtil.cpp    |  2 +-
 core/sql/optimizer/RelExeUtil.h      |  6 +--
 core/sql/parser/sqlparser.y          | 25 ++--------
 11 files changed, 193 insertions(+), 48 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/781682af/core/sql/bin/clitest.cpp
----------------------------------------------------------------------
diff --git a/core/sql/bin/clitest.cpp b/core/sql/bin/clitest.cpp
index e88ee9d..37baf68 100644
--- a/core/sql/bin/clitest.cpp
+++ b/core/sql/bin/clitest.cpp
@@ -75,9 +75,10 @@ int main(int argc, const char * argv[])
     {
       cout << "Error -  provide an option: " << endl;
       cout << "Usage : clitestdriver <option number>" << endl;
-      cout << "TEST            : OPTION        "<<endl;
-      cout << "--------------------------------"<<endl;
-      cout << "Blob test          1 "<< endl;
+      cout << "TEST                                OPTION        "<<endl;
+      cout << "-------------------------------------------"<<endl;
+      cout << "Blob test extract to buffer         1      "<< endl;
+      cout << "Blob test extract to file in chunks 2      "<< endl;
       return 0;
     }
   Int32 retcode = 0;
@@ -93,13 +94,69 @@ int main(int argc, const char * argv[])
   CliGlobals * cliGlob = GetCliGlobals();
   char tablename[50] = {'\0'};
   char columnname[50] = {'\0'};
- 
+  char filename[50] = {'\0'};
   switch (option) 
     {
     case 1:
       {
 	cout <<"***********"  <<endl;
-	cout << "Blob test " << endl;
+	cout << "   Blob test extract to user buffer " << endl;
+	cout <<"***********"  <<endl;
+	cout << "Extract from a lob column in a lob table" << endl << endl;
+	cout << "Input lob table name :" << endl;
+	cin.getline(tablename,40);
+	cout << "Table name : " << tablename << endl;
+	cout << "Input lob column name to extract from :" << endl;
+	cin.getline(columnname,40); 
+	cout << "Column Name : " << columnname << endl;
+
+      //extract lob handle
+      
+      char *lobHandle = new char[1024];
+      str_cpy_all(lobHandle," ",1024);
+      cout << "Extracting  lob handle for column " << columnname << "..." << endl;
+      retcode = extractLobHandle(cliGlob, lobHandle, (char *)columnname,(char *)tablename);
+      if (retcode)
+	{
+	  cout << "extractLobHandle returned " << retcode <<endl;
+	
+	  delete lobHandle;
+	  return retcode;
+	}
+      cout << "LOB handle for "<< columnname << ": " << lobHandle << endl;
+      //extract length of lob column from a table with 1 lob column.
+
+      cout << "Extracting LOB data length for the above handle..." << endl;
+      Int64 lengthOfLob= 0;
+      retCode = extractLengthOfLobColumn(cliGlob, lobHandle, lengthOfLob,columnname,(char *)tablename);
+      if (retcode)
+	{
+	  cout << "extractLengthOfLobColumn returned " << retcode <<endl;
+	 
+	  delete lobHandle;
+	  return retcode;
+	}
+      cout << "LOB data length :" << lengthOfLob << endl;
+      //extract lob data to buffer
+      cout << "Extracting lob data into user buffer in a loop ..." << endl;
+      retCode = extractLobToBuffer(cliGlob,lobHandle, lengthOfLob,columnname,tablename);
+      if (retcode)
+	{
+	  cout << "extractLobToBuffer returned " << retcode <<endl;
+
+	  delete lobHandle;
+	  return retcode;
+	}
+      delete lobHandle;
+      return retcode;
+      }
+     
+      break;
+    
+     case 2:
+      {
+	cout <<"***********"  <<endl;
+	cout << "Blob test extract to file in chunks " << endl;
 	cout <<"***********"  <<endl;
 	cout << " Extract from a lob column in a lob table" << endl << endl;
 	cout << " Input lob table name :" << endl;
@@ -108,13 +165,16 @@ int main(int argc, const char * argv[])
 	cout << "Input lob column name to extract from :" << endl;
 	cin.getline(columnname,40); 
 	cout << "Column Name : " << columnname << endl;
+	cout <<"Input a filename to extract to : " << endl;
+	cin.getline(filename,40); 
+	cout << "Output File Name : " << filename << endl;
 
       //extract lob handle
       
       char *lobHandle = new char[1024];
       str_cpy_all(lobHandle," ",1024);
       cout << "Extracting  lob handle for column " << columnname << "..." << endl;
-      retcode = extractLobHandle(cliGlob, lobHandle, (char *)"c2",(char *)"tlob1");
+      retcode = extractLobHandle(cliGlob, lobHandle, (char *)columnname,tablename);
       if (retcode)
 	{
 	  cout << "extractLobHandle returned " << retcode <<endl;
@@ -127,7 +187,7 @@ int main(int argc, const char * argv[])
 
       cout << "Extracting LOB data length for the above handle..." << endl;
       Int64 lengthOfLob= 0;
-      retCode = extractLengthOfLobColumn(cliGlob, lobHandle, lengthOfLob,(char *)"c2",(char *)"tlob1");
+      retCode = extractLengthOfLobColumn(cliGlob, lobHandle, lengthOfLob,columnname,tablename);
       if (retcode)
 	{
 	  cout << "extractLengthOfLobColumn returned " << retcode <<endl;
@@ -137,11 +197,11 @@ int main(int argc, const char * argv[])
 	}
       cout << "LOB data length :" << lengthOfLob << endl;
       //extract lob data to buffer
-      cout << "Extracting lob data into user buffer in a loop ..." << endl;
-      retCode = extractLobToBuffer(cliGlob,lobHandle, lengthOfLob,(char *)"c2",(char *)"tlob1");
+      cout << "Extracting lob data into file in chunks of 1000 ..." << endl;
+      retCode = extractLobToFileInChunks(cliGlob,lobHandle, filename, lengthOfLob,columnname,tablename);
       if (retcode)
 	{
-	  cout << "extractLobToBuffer returned " << retcode <<endl;
+	  cout << "extractLobToFileInChunks returned " << retcode <<endl;
 
 	  delete lobHandle;
 	  return retcode;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/781682af/core/sql/bin/vprocclitestdriver.cpp
----------------------------------------------------------------------
diff --git a/core/sql/bin/vprocclitestdriver.cpp b/core/sql/bin/vprocclitestdriver.cpp
new file mode 100644
index 0000000..60a11fb
--- /dev/null
+++ b/core/sql/bin/vprocclitestdriver.cpp
@@ -0,0 +1,51 @@
+/**********************************************************************
+// @@@ START COPYRIGHT @@@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+// @@@ END COPYRIGHT @@@
+**********************************************************************/
+/* -*-C++-*-
+ *****************************************************************************
+ *
+ * File:         vproctestdriver.CPP
+ * Created:      02/26/99
+ * Language:     C++
+ *
+ *
+//=============================================================================
+//
+*
+*****************************************************************************
+*/
+
+#include "vproc.h"
+#include <stdio.h>
+
+extern "C" { void
+VPROC (PRODNUMMXCI,DATE1MXCI,MXCI_CC_LABEL)
+() {} }
+
+#include "SCMVersHelp.h"
+
+#define VERS_CV_MAJ 1
+#define VERS_CV_MIN 0
+#define VERS_CV_UPD 1
+
+VERS_BIN (clitestdriver)
+

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/781682af/core/sql/clitest/blobtest.cpp
----------------------------------------------------------------------
diff --git a/core/sql/clitest/blobtest.cpp b/core/sql/clitest/blobtest.cpp
index d7d700d..6abc04f 100644
--- a/core/sql/clitest/blobtest.cpp
+++ b/core/sql/clitest/blobtest.cpp
@@ -50,7 +50,7 @@ Int32 extractLobToBuffer(CliGlobals *cliglob, char * lobHandle, Int64 &lengthOfL
   char *lobFinalBuf = new char[lengthOfLob];
   char statusBuf[200] = {'\0'};
   Int32 statusBufLen = 0;
-  Int64 lobExtractLen = 10;
+  Int64 lobExtractLen = 1000;
   char *lobDataBuf = new char[lobExtractLen];
   
   str_sprintf(query,"extract lobtobuffer(lob '%s', LOCATION %Ld, SIZE %Ld) ", lobHandle, (Int64)lobDataBuf, lobExtractLen);
@@ -72,7 +72,7 @@ Int32 extractLobToBuffer(CliGlobals *cliglob, char * lobHandle, Int64 &lengthOfL
       FILE * lobFileId = fopen("lob_output_file","w");
   
       int byteCount=fwrite(lobFinalBuf,sizeof(char),lengthOfLob, lobFileId);
-      cout << "Wrote " << byteCount << " bytes to file lob_output_file" << endl;
+      cout << "Writing " << byteCount << " bytes from user buffer to file lob_output_file in current directory" << endl;
 
       fclose(lobFileId);
     }
@@ -86,3 +86,46 @@ Int32 extractLobToBuffer(CliGlobals *cliglob, char * lobHandle, Int64 &lengthOfL
 }
 
 
+Int32 extractLobToFileInChunks(CliGlobals *cliglob,  char * lobHandle, char *filename,Int64 &lengthOfLob, 
+				char *lobColumnName, char *tableName)
+{
+  Int32 retcode = 0;
+  ExeCliInterface cliInterface((cliglob->currContext())->exHeap(), (Int32)SQLCHARSETCODE_UTF8, cliglob->currContext(),NULL);
+  // Extract lob data into a buffer.
+  char * query = new char [500];
+  
+  
+  char statusBuf[200] = {'\0'};
+  Int32 statusBufLen = 0;
+  Int64 lobExtractLen = 1000;
+  char *lobDataBuf = new char[lobExtractLen];
+  Int64 *inputOutputAddr = &lobExtractLen;
+
+  str_sprintf(query,"extract lobtobuffer(lob '%s', LOCATION %Ld, SIZE %Ld) ", lobHandle, (Int64)lobDataBuf, inputOutputAddr);
+ 
+ 
+  retcode = cliInterface.executeImmediatePrepare(query);
+  short i = 0;
+  FILE * lobFileId = fopen(filename,"a+");
+  int byteCount = 0;
+  while ((retcode != 100) && !(retcode<0))
+    {    
+      retcode = cliInterface.clearExecFetchClose(NULL,NULL,statusBuf, &statusBufLen);
+      if (!retcode)
+	{
+	  byteCount=fwrite(lobDataBuf,sizeof(char),*inputOutputAddr, lobFileId);
+	 cout << "Wrote " << byteCount << " bytes to file : " << filename << endl;
+	}
+    }
+  
+
+  fclose(lobFileId);
+
+ 
+  delete query;
+  delete lobDataBuf;
+    
+
+  return retcode;
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/781682af/core/sql/clitest/blobtest.h
----------------------------------------------------------------------
diff --git a/core/sql/clitest/blobtest.h b/core/sql/clitest/blobtest.h
index 4ec96dc..da34fa7 100644
--- a/core/sql/clitest/blobtest.h
+++ b/core/sql/clitest/blobtest.h
@@ -35,3 +35,5 @@ Int32 extractLengthOfLobColumn(CliGlobals *cliglob, char * lobHandle, Int64 &len
 
 Int32 extractLobToBuffer(CliGlobals *cliglob, char * lobHandle, Int64 &lengthOfLob, 
 			 char *lobColumnName, char *tableName);
+Int32 extractLobToFileInChunks(CliGlobals *cliglob, char * lobHandle, char *filename, Int64 &lengthOfLob, 
+			 char *lobColumnName, char *tableName);

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/781682af/core/sql/comexe/ComTdbExeUtil.cpp
----------------------------------------------------------------------
diff --git a/core/sql/comexe/ComTdbExeUtil.cpp b/core/sql/comexe/ComTdbExeUtil.cpp
index 773df33..1cb64a8 100644
--- a/core/sql/comexe/ComTdbExeUtil.cpp
+++ b/core/sql/comexe/ComTdbExeUtil.cpp
@@ -2201,7 +2201,7 @@ ComTdbExeUtilLobExtract::ComTdbExeUtilLobExtract
  Lng32 handleLen,
  ExtractToType toType,
  Int64 bufAddr,
- Int64 extractSize,
+ Int64 extractSizeAddr,
  Int64 intParam1,
  Int64 intParam2,
  Lng32 lobStorageType,
@@ -2234,7 +2234,7 @@ ComTdbExeUtilLobExtract::ComTdbExeUtilLobExtract
     handleLen_(handleLen),
     toType_((short)toType),
     bufAddr_(bufAddr),
-    extractSize_(extractSize),
+    extractSizeIOAddr_(extractSizeAddr),
     lobStorageType_(lobStorageType),
     stringParam1_(stringParam1),
     stringParam2_(stringParam2),
@@ -2257,7 +2257,7 @@ ComTdbExeUtilLobExtract::ComTdbExeUtilLobExtract
       {
 	// extractSize_ is irrelevant since the whole lob will be read into the output file
 	// bufAddr_ is not passed in by user. It is a CQD value LOB_OUTPUT_SIZE
-	extractSize_ = 0;
+	extractSizeIOAddr_ = 0;
 	bufAddr_ = 0;
 	
       }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/781682af/core/sql/comexe/ComTdbExeUtil.h
----------------------------------------------------------------------
diff --git a/core/sql/comexe/ComTdbExeUtil.h b/core/sql/comexe/ComTdbExeUtil.h
index afe1a69..99f80f8 100644
--- a/core/sql/comexe/ComTdbExeUtil.h
+++ b/core/sql/comexe/ComTdbExeUtil.h
@@ -2753,8 +2753,8 @@ public:
   {(v ? flags_ |= APPEND_OR_CREATE : flags_ &= ~APPEND_OR_CREATE); };
   NABoolean appendOrCreate() { return (flags_ & APPEND_OR_CREATE) != 0; };
 
-  void setExtractSize(Int64 extractSize) { extractSize_ = extractSize; };
-  Int64 getExtractSize() { return extractSize_;}
+  void setExtractSizeIOAddr(Int64 ext_addr){ extractSizeIOAddr_ = ext_addr;};
+  Int64 dataExtractSizeIOAddr() { return extractSizeIOAddr_;}
   void setTotalBufSize(Int64 bufSize) { totalBufSize_ = bufSize;};
   Int64 getTotalBufSize() { return totalBufSize_;};
   void setBufAddr(Int64 bufAddr) {bufAddr_ = bufAddr;};
@@ -2779,7 +2779,7 @@ private:
   short toType_;                                           // 08-09
   Int32 flags_;    
   Lng32 handleLen_;
-  Int64 extractSize_; // as passed in via syntax size
+  Int64 extractSizeIOAddr_; // as passed in via syntax size
   Int64 totalBufSize_; // buf size
   Int64 bufAddr_ ; //buffer addressed as passed in by user via syntax
   Int64 intParam1_;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/781682af/core/sql/executor/ExExeUtilLoad.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExExeUtilLoad.cpp b/core/sql/executor/ExExeUtilLoad.cpp
index 07d7902..b4e32d9 100644
--- a/core/sql/executor/ExExeUtilLoad.cpp
+++ b/core/sql/executor/ExExeUtilLoad.cpp
@@ -3029,6 +3029,7 @@ short ExExeUtilLobExtractTcb::work()
 	      {
 		so = Lob_Buffer;
 		lobData_ =  (char *)lobTdb().getBufAddr();
+		lobDataSpecifiedExtractLen_ = *((Int64 *)(lobTdb().dataExtractSizeIOAddr()));
 		step_ = OPEN_CURSOR_;
 	      }
 	  }
@@ -3080,7 +3081,7 @@ short ExExeUtilLobExtractTcb::work()
 	  {
 	    if (lobTdb().getToType() == ComTdbExeUtilLobExtract::TO_BUFFER_)
 	      so = Lob_Buffer;
-	    lobDataSpecifiedExtractLen_ = lobTdb().getExtractSize();
+	    lobDataSpecifiedExtractLen_ = *((Int64 *)(lobTdb().dataExtractSizeIOAddr()));
 	    retcode = ExpLOBInterfaceSelectCursor
 	      (lobGlobs,
 	       lobName_, 
@@ -3131,6 +3132,9 @@ short ExExeUtilLobExtractTcb::work()
             if (lobTdb().getToType() == ComTdbExeUtilLobExtract::TO_BUFFER_)
 	      {
 		str_sprintf(statusString_," Success: LOB data length returned : %d", lobDataOutputLen);
+	       
+		//lobTdb().setExtractSizeIOAddr((Int64)(&lobDataOutputLen));
+		memcpy((char *)lobTdb().dataExtractSizeIOAddr(), (char *)&lobDataOutputLen,sizeof(Int64));
 		step_ = RETURN_STATUS_;
 	      }
 	  }
@@ -3182,7 +3186,7 @@ short ExExeUtilLobExtractTcb::work()
 	    if (qparent_.up->isFull())
 	      return WORK_OK;
 
-	    Lng32 size = MINOF((Lng32)lobTdb().extractSize_, (Lng32)remainingBytes_);
+	    Lng32 size = MINOF((Lng32)lobTdb().dataExtractSizeIOAddr(), (Lng32)remainingBytes_);
 
 	    moveRowToUpQueue(&lobData_[currPos_], size);
 
@@ -3487,12 +3491,12 @@ short ExExeUtilFileExtractTcb::work()
 	  break;
 
 
-	case RETURN_STRING_:
+	  /*case RETURN_STRING_:
 	  {
 	    if (qparent_.up->isFull())
 	      return WORK_OK;
 
-	    Lng32 size = MINOF((Lng32)lobTdb().extractSize_, (Lng32)remainingBytes_);
+	    Lng32 size = MINOF((Lng32)lobTdb().dataExtractSizeIOAddr(), (Lng32)remainingBytes_);
 
 	    // eval expression to convert lob data to sql row.
 	    // TBD.
@@ -3507,7 +3511,7 @@ short ExExeUtilFileExtractTcb::work()
 
 	    return WORK_RESCHEDULE_AND_RETURN;
 	  }
-	  break;
+	  break;*/
 
 	case HANDLE_ERROR_:
 	  {

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/781682af/core/sql/generator/GenRelExeUtil.cpp
----------------------------------------------------------------------
diff --git a/core/sql/generator/GenRelExeUtil.cpp b/core/sql/generator/GenRelExeUtil.cpp
index d1b73e2..80bd5aa 100644
--- a/core/sql/generator/GenRelExeUtil.cpp
+++ b/core/sql/generator/GenRelExeUtil.cpp
@@ -3687,7 +3687,7 @@ short ExeUtilLobExtract::codeGen(Generator * generator)
 	 (toType_ == TO_EXTERNAL_FROM_FILE_ ? ComTdbExeUtilLobExtract::TO_EXTERNAL_FROM_FILE_ :
 	  ComTdbExeUtilLobExtract::NOOP_)))))),
      bufAddr_,
-     extractSize_,
+     extractSizeAddr_,
      intParam_,
      intParam2_,
      lst,

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/781682af/core/sql/optimizer/RelExeUtil.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/RelExeUtil.cpp b/core/sql/optimizer/RelExeUtil.cpp
index 3690c6f..dfff976 100644
--- a/core/sql/optimizer/RelExeUtil.cpp
+++ b/core/sql/optimizer/RelExeUtil.cpp
@@ -5205,7 +5205,7 @@ RelExpr * ExeUtilLobExtract::copyTopNode(RelExpr *derivedNode, CollHeap* outHeap
   result->handle_ = handle_;
   result->toType_ = toType_;
   result->bufAddr_ = bufAddr_;
-  result->extractSize_ = extractSize_;
+  result->extractSizeAddr_ = extractSizeAddr_;
   result->intParam_ = intParam_;
   result->intParam2_ = intParam2_;
   result->stringParam_ = stringParam_;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/781682af/core/sql/optimizer/RelExeUtil.h
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/RelExeUtil.h b/core/sql/optimizer/RelExeUtil.h
index 28edeba..07a6c31 100644
--- a/core/sql/optimizer/RelExeUtil.h
+++ b/core/sql/optimizer/RelExeUtil.h
@@ -1871,7 +1871,7 @@ public:
  ExeUtilLobExtract(ItemExpr * handle, 
 		   ExtractToType toType,
 		   Int64 bufaddr=0,
-		   Int64 extractSize=0,
+		   Int64 extractSizeAddr=0,
 		   Int64 intParam = 0,
 		   Int64 intParam2 = 0,
 		   char * stringParam = NULL,
@@ -1885,7 +1885,7 @@ public:
     handle_(handle),
     toType_(toType),
     bufAddr_(bufaddr),
-    extractSize_(extractSize),
+    extractSizeAddr_(extractSizeAddr),
     intParam_(intParam),
     intParam2_(intParam2),
     handleInStringFormat_(TRUE),
@@ -1942,7 +1942,7 @@ public:
   ExtractToType toType_;
   
   Int64 bufAddr_;
-  Int64 extractSize_;
+  Int64 extractSizeAddr_;
   
   Int64 intParam_;   // options for create or size limit
   Int64 intParam2_;// options for file behavior

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/781682af/core/sql/parser/sqlparser.y
----------------------------------------------------------------------
diff --git a/core/sql/parser/sqlparser.y b/core/sql/parser/sqlparser.y
index 6c686b4..7baa141 100755
--- a/core/sql/parser/sqlparser.y
+++ b/core/sql/parser/sqlparser.y
@@ -15616,34 +15616,19 @@ exe_util_lob_extract : TOK_EXTRACT TOK_LOBLENGTH '(' TOK_LOB QUOTED_STRING  ')'
 
               | TOK_EXTRACT TOK_LOBTOBUFFER '(' TOK_LOB QUOTED_STRING ',' TOK_LOCATION NUMERIC_LITERAL_EXACT_NO_SCALE ',' TOK_SIZE NUMERIC_LITERAL_EXACT_NO_SCALE ')'
                {
-		 /* if (NOT (($8->getOperatorType() == ITM_DYN_PARAM) ||
-                          ($8->getOperatorType() == ITM_CONSTANT)))
-                   {
-                     YYERROR;
-                   }
+		 /* TOK_LOCATION points to a user allocated data buffer ehich needs to be enough to hold alreast TOK_SIZE worth of data .
+TOK_SIZE points to the address of an Int64 container This size is the input specified by user for length to extract. One return, it will give the caller the size that was extracted */
 
-                 if (NOT (($11->getOperatorType() == ITM_DYN_PARAM) ||
-                          ($11->getOperatorType() == ITM_CONSTANT)))
-                   {
-                     YYERROR;
-		     }*/
 		 Int64 bufAddr = atoInt64($8->data());
-		 Int64 bufSize = atoInt64($11->data());
-		 /* ItemExpr * bufaddr = $8;
-		 bufaddr = new (PARSERHEAP()) 
-		   Cast(bufaddr, new (PARSERHEAP()) SQLLargeInt(TRUE, FALSE));
-
-		 ItemExpr * bufsize = $11;
-		 bufsize = new (PARSERHEAP()) 
-		   Cast(bufsize, new (PARSERHEAP()) SQLLargeInt(TRUE, FALSE));
-		 */
+		 Int64 sizeAddr = atoInt64($11->data());
+		 
 		 ConstValue * handle = new(PARSERHEAP()) ConstValue(*$5);
 
 		 ExeUtilLobExtract * lle =
 		   new (PARSERHEAP ()) ExeUtilLobExtract
 		   (handle, 
 		    ExeUtilLobExtract::TO_BUFFER_,
-		    bufAddr, bufSize, 0, 0);
+		    bufAddr, sizeAddr, 0, 0);
 
 		 $$ = lle;
 	       }


[07/13] incubator-trafodion git commit: More adjustments to lob regress test

Posted by sa...@apache.org.
More adjustments to lob regress test


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

Branch: refs/heads/master
Commit: 96ac8ebdb8b7df9f4da42352511a1c4411ada2bb
Parents: 2ba37e8
Author: Sandhya Sundaresan <sa...@apache.org>
Authored: Mon Dec 21 20:47:30 2015 +0000
Committer: Sandhya Sundaresan <sa...@apache.org>
Committed: Mon Dec 21 20:47:30 2015 +0000

----------------------------------------------------------------------
 core/sql/regress/executor/EXPECTED130     | 130 +++++++++++++++++--------
 core/sql/regress/executor/TEST130         |   1 +
 core/sql/regress/executor/TEST130_argfile |   2 +-
 3 files changed, 94 insertions(+), 39 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/96ac8ebd/core/sql/regress/executor/EXPECTED130
----------------------------------------------------------------------
diff --git a/core/sql/regress/executor/EXPECTED130 b/core/sql/regress/executor/EXPECTED130
index 670abdf..342c076 100644
--- a/core/sql/regress/executor/EXPECTED130
+++ b/core/sql/regress/executor/EXPECTED130
@@ -53,9 +53,10 @@ C1
 C1           C2
 -----------  ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 ----------------------------------------
 
-          1  LOBH00000200010279963438587423229119541341101965990251118212316399994956986020"TRAFODION"."LOB130"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                         
-          2  LOBH00000200010279963438587423229119541341101966300063218212316400003010310020"TRAFODION"."LOB130"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                         
-          3  LOBH00000200010279963438587423229119541341101966584793118212316400005859531020"TRAFODION"."LOB130"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                         
+          1  LOBH00000200010520117997292580853919884121437179977294818212317485757218627020"TRAFODION"."LOB130"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                         
+          2  LOBH00000200010520117997292580853919884121437180341874318212317485760955694020"TRAFODION"."LOB130"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                         
+          3  LOBH00000200010520117997292580853919884121437180704085518212317485764542640020"TRAFODION"."LOB130"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                         
+
 --- 3 row(s) selected.
 >>
 >>
@@ -332,7 +333,7 @@ And the dish ran away with the fork !
 >>sh grep "^LOBH" TMP130 | sed "s/^/extract lobtofile(LOB '/g" | sed "s/$/' , 'tlob130_txt1.txt');/g" >> t130_extract_command;
 >>
 >>obey t130_extract_command;
->>extract lobtofile(LOB 'LOBH00000200010264088298048327963619185106419612837158218212316881718299730017"TRAFODION"."LOB"     ' , 'tlob130_txt1.txt');
+>>extract lobtofile(LOB 'LOBH00000200010520117997292583625519884121437206093184618212317486018305654020"TRAFODION"."LOB130"  ' , 'tlob130_txt1.txt');
 Success. Targetfile :tlob130_txt1.txt  Length : 19
 
 --- SQL operation complete.
@@ -348,8 +349,7 @@ Success. Targetfile :tlob130_txt1.txt  Length : 19
 >>sh rm t130_extract_command;
 >>sh grep "^LOBH" TMP130 | sed "s/^/extract lobtofile(LOB '/g" | sed "s/$/' , 'tlob130_deep.jpg');/g" >> t130_extract_command;
 >>obey t130_extract_command;
->>extract lobtofile(LOB 'LOBH00000200010264088298048328007319185106419616794479618212316881757900747017"TRAFODION"."LOB"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
                                                     ' , 'tlob130_deep.jpg');
-
+>>extract lobtofile(LOB 'LOBH00000200010520117997292583681719884121437210516812518212317486062586654020"TRAFODION"."LOB130"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
                                                     ' , 'tlob130_deep.jpg');
 Success. Targetfile :tlob130_deep.jpg  Length : 159018
 
 --- SQL operation complete.
@@ -365,8 +365,7 @@ Success. Targetfile :tlob130_deep.jpg  Length : 159018
 >>sh grep "^LOBH" TMP130 | sed "s/^/extract lobtofile(LOB '/g" | sed "s/$/' , 'tlob130_anoush.jpg');/g" >> t130_extract_command;
 >>
 >>obey t130_extract_command;
-
->>extract lobtofile(LOB 'LOBH00000200010264088298048328007319185106419616794479618212316881757900747017"TRAFODION"."LOB"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
                                                     ' , 'tlob130_anoush.jpg');
+>>extract lobtofile(LOB 'LOBH00000200010520117997292583681719884121437210516812518212317486062586654020"TRAFODION"."LOB130"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
                                                     ' , 'tlob130_anoush.jpg');
 Success. Targetfile :tlob130_anoush.jpg  Length : 230150
 
 --- SQL operation complete.
@@ -485,9 +484,7 @@ And the dish ran away with the fork !
 >>sh grep "^LOBH" TMP130 | sed "s/^/extract lobtofile(LOB '/g" | sed "s/$/' , 'hdfs:\/\/\/lobs\/tlob130_txt2.txt');/g" >> t130_extract_command;
 >>
 >>obey t130_extract_command;
-
->>extract lobtofile(LOB 'LOBH00000200010264088298048328671219185106419621427223118212316881804234960017"TRAFODION"."LOB"     ' , 'hdfs:///lobs/tlob130_txt2.txt');
-
+>>extract lobtofile(LOB 'LOBH00000200010520117997292584465719884121437216347907218212317486120465668020"TRAFODION"."LOB130"  ' , 'hdfs:///lobs/tlob130_txt2.txt');
 Success. Targetfile :hdfs:///lobs/tlob130_txt2.txt  Length : 19
 
 --- SQL operation complete.
@@ -503,9 +500,7 @@ Success. Targetfile :hdfs:///lobs/tlob130_txt2.txt  Length : 19
 >>sh rm t130_extract_command;
 >>sh grep "^LOBH" TMP130 | sed "s/^/extract lobtofile(LOB '/g" | sed "s/$/' , 'hdfs:\/\/\/lobs\/tlob130_deep.jpg');/g" >> t130_extract_command;
 >>obey t130_extract_command;
-
->>extract lobtofile(LOB 'LOBH00000200010264088298048328721819185106419625378358018212316881843769708017"TRAFODION"."LOB"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
                                                     ' , 'hdfs:///lobs/tlob130_deep.jpg');
-
+>>extract lobtofile(LOB 'LOBH00000200010520117997292584531219884121437220235037418212317486159808683020"TRAFODION"."LOB130"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
                                                     ' , 'hdfs:///lobs/tlob130_deep.jpg');
 Success. Targetfile :hdfs:///lobs/tlob130_deep.jpg  Length : 159018
 
 --- SQL operation complete.
@@ -521,28 +516,28 @@ Success. Targetfile :hdfs:///lobs/tlob130_deep.jpg  Length : 159018
 >>sh grep "^LOBH" TMP130 | sed "s/^/extract lobtofile(LOB '/g" | sed "s/$/' , 'hdfs:\/\/\/lobs\/tlob130_anoush.jpg');/g" >> t130_extract_command;
 >>
 >>obey t130_extract_command;
->>extract lobtofile(LOB 'LOBH00000200010264088298048328007319185106419616794479618212316881757900747017"TRAFODION"."LOB"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
                                                     ' , 'hdfs:///lobs/tlob130_anoush.jpg');
+>>extract lobtofile(LOB 'LOBH00000200010520117997292583681719884121437210516812518212317486062586654020"TRAFODION"."LOB130"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
                                                     ' , 'hdfs:///lobs/tlob130_anoush.jpg');
 Success. Targetfile :hdfs:///lobs/tlob130_anoush.jpg  Length : 230150
 
 --- SQL operation complete.
 >>
 >>
 >>sh clitestdriver 2 < TEST130_argfile 2>&1 | tee -a LOG130;
-***********
+*************************************
 Blob test extract to file in chunks 
-***********
- Extract from a lob column in a lob table
+************************************
+Extract from a lob column in a lob table
 
- Input lob table name :
- Table name : tlob130bin1
+Input lob table name :
+Table name : TRAFODION.LOB130.tlob130bin1
 Input lob column name to extract from :
 Column Name : c2
 Input a filename to extract to : 
 Output File Name : lobc2out.jpg
 Extracting  lob handle for column c2...
-LOB handle for c2: LOBH00000200010476207798336764109119336145849975710857618212316460311278020021"TRAFODION"."SEABASE"
+LOB handle for c2: LOBH00000200010520117997292583681719884121437210516812518212317486062586654020"TRAFODION"."LOB130"
 Extracting LOB data length for the above handle...
-LOB data length :159018
+LOB data length :230150
 Extracting lob data into file in chunks of 1000 ...
 Wrote 1000 bytes to file : lobc2out.jpg
 Wrote 1000 bytes to file : lobc2out.jpg
@@ -703,7 +698,78 @@ Wrote 1000 bytes to file : lobc2out.jpg
 Wrote 1000 bytes to file : lobc2out.jpg
 Wrote 1000 bytes to file : lobc2out.jpg
 Wrote 1000 bytes to file : lobc2out.jpg
-Wrote 18 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 1000 bytes to file : lobc2out.jpg
+Wrote 150 bytes to file : lobc2out.jpg
 >>
 >>------------------------------------------------------------------------------
 >>obey TEST130(lob_misc_cleanup);
@@ -747,11 +813,7 @@ And the dish ran away with the spoon.
 >>sh rm t130_extract_command;
 >>sh grep "^LOBH" TMP130 | sed "s/^/extract lobtofile(LOB '/g" | sed "s/$/' , 'tlob130_deep2.jpg');/g" >> t130_extract_command;
 >>obey t130_extract_command;
-<<<<<<< HEAD
->>extract lobtofile(LOB 'LOBH00000200020264088298048330075619185106419633949770818212316881929446626017"TRAFODION"."LOB"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
                                                     ' , 'tlob130_deep2.jpg');
-=======
->>extract lobtofile(LOB 'LOBH00000200020279963438587427046219541341102002085013918212316400360882889020"TRAFODION"."LOB130"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
                                                     ' , 'tlob130_deep2.jpg');
->>>>>>> origin/master
+>>extract lobtofile(LOB 'LOBH00000200020520117997292585982119884121437229332169918212317486250825302020"TRAFODION"."LOB130"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
                                                     ' , 'tlob130_deep2.jpg');
 Success. Targetfile :tlob130_deep2.jpg  Length : 159018
 
 --- SQL operation complete.
@@ -760,11 +822,7 @@ Success. Targetfile :tlob130_deep2.jpg  Length : 159018
 >>sh rm t130_extract_command;
 >>sh grep "^LOBH" TMP130 | sed "s/^/extract lobtofile(LOB '/g" | sed "s/$/' , 'hdfs:\/\/\/lobs\/tlob130_anoush2.jpg');/g" >> t130_extract_command;
 >>obey t130_extract_command;
-<<<<<<< HEAD
->>extract lobtofile(LOB 'LOBH00000200030264088298048330075619185106419634292903818212316881932962861017"TRAFODION"."LOB"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
                                                     ' , 'hdfs:///lobs/tlob130_anoush2.jpg');
-=======
->>extract lobtofile(LOB 'LOBH00000200030279963438587427046219541341102002340817618212316400363467910020"TRAFODION"."LOB130"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
                                                     ' , 'hdfs:///lobs/tlob130_anoush2.jpg');
->>>>>>> origin/master
+>>extract lobtofile(LOB 'LOBH00000200030520117997292585982119884121437229667368718212317486254205249020"TRAFODION"."LOB130"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
                                                     ' , 'hdfs:///lobs/tlob130_anoush2.jpg');
 Success. Targetfile :hdfs:///lobs/tlob130_anoush2.jpg  Length : 230150
 
 --- SQL operation complete.
@@ -791,11 +849,7 @@ Hey diddle diddle,
 >>sh rm t130_extract_command;
 >>sh grep "^LOBH" TMP130 | sed "s/^/extract lobtofile(LOB '/g" | sed "s/$/' , 'tlob130_anoush3.jpg',create,truncate);/g" >> t130_extract_command;
 >>obey t130_extract_command;
-<<<<<<< HEAD
->>extract lobtofile(LOB 'LOBH00000200030264088298048330340419185106419636881198218212316881958805296017"TRAFODION"."LOB"     ' , 'tlob130_anoush3.jpg',create,truncate);
-=======
->>extract lobtofile(LOB 'LOBH00000200030279963438587427288519541341102004608530918212316400386132885020"TRAFODION"."LOB130"  ' , 'tlob130_anoush3.jpg',create,truncate);
->>>>>>> origin/master
+>>extract lobtofile(LOB 'LOBH00000200030520117997292586250119884121437232179272218212317486279303189020"TRAFODION"."LOB130"  ' , 'tlob130_anoush3.jpg',create,truncate);
 Success. Targetfile :tlob130_anoush3.jpg  Length : 230150
 
 --- SQL operation complete.

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/96ac8ebd/core/sql/regress/executor/TEST130
----------------------------------------------------------------------
diff --git a/core/sql/regress/executor/TEST130 b/core/sql/regress/executor/TEST130
index 0941e78..87ca365 100755
--- a/core/sql/regress/executor/TEST130
+++ b/core/sql/regress/executor/TEST130
@@ -427,6 +427,7 @@ drop table tlob130txt2;
 drop table tlob130bin2; 
 sh rm TMP130;
 sh rm tlob130txt2;
+sh rm lobc2out.jpg;
 sh rm TEST130_argfile;
 drop schema trafodion.lob130 cascade;
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/96ac8ebd/core/sql/regress/executor/TEST130_argfile
----------------------------------------------------------------------
diff --git a/core/sql/regress/executor/TEST130_argfile b/core/sql/regress/executor/TEST130_argfile
index 2ea2426..4e8939f 100644
--- a/core/sql/regress/executor/TEST130_argfile
+++ b/core/sql/regress/executor/TEST130_argfile
@@ -1,3 +1,3 @@
-tlob130bin1
+TRAFODION.LOB130.tlob130bin1
 c2
 lobc2out.jpg