Repository: trafodion
Updated Branches:
  refs/heads/master f38ade8de -> affc9dbfa


[TRAFODION-3173] enhance ExeCliInterface fetchAllRows to save the data type


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

Branch: refs/heads/master
Commit: f75ea3f7f101f67089a4874b750c58e8a3f24b39
Parents: 88388c7
Author: Liu Ming <ovis_p...@sina.com>
Authored: Mon Aug 6 00:30:29 2018 -0400
Committer: Liu Ming <ovis_p...@sina.com>
Committed: Mon Aug 6 00:30:29 2018 -0400

----------------------------------------------------------------------
 core/sql/executor/ExExeUtilCli.cpp | 26 ++++++++++++++++++++++++--
 core/sql/executor/ExExeUtilCli.h   |  3 +++
 2 files changed, 27 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/f75ea3f7/core/sql/executor/ExExeUtilCli.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExExeUtilCli.cpp 
b/core/sql/executor/ExExeUtilCli.cpp
index d10ef19..d39f21b 100644
--- a/core/sql/executor/ExExeUtilCli.cpp
+++ b/core/sql/executor/ExExeUtilCli.cpp
@@ -64,6 +64,13 @@ void OutputInfo::insert(Lng32 index, char * data, Lng32 len)
   len_[index] = len;
 }
 
+void OutputInfo::insert(Lng32 index, char * data, Lng32 len, Lng32 type, Lng32 
*indOffset , Lng32 *varOffset )
+{
+  data_[index] = data;
+  len_[index] = len;
+  type_[index] = type;
+}
+
 char * OutputInfo::get(Lng32 index)
 {
   if (index < numEntries_)
@@ -84,6 +91,19 @@ short OutputInfo::get(Lng32 index, char* &data, Lng32 &len)
   return -1;
 }
 
+short OutputInfo::get(Lng32 index, char* &data, Lng32 &len, Lng32 &type, Lng32 
*indOffset , Lng32 *varOffset )
+{
+  if (index < numEntries_)
+    {
+      data = data_[index];
+      len = len_[index];
+      type = type_[index];
+      return 0;
+    }
+
+  return -1;
+}
+
 void OutputInfo::dealloc(CollHeap * heap)
 {
   for (Int32 i = 0; i < numEntries_; i++)
@@ -1278,8 +1298,9 @@ short ExeCliInterface::fetchAllRows(Queue * &infoList,
        {
          char * ptr;
          Lng32   len;
+          Lng32   type;
+          getAttributes(j+1, FALSE, type, len, NULL, NULL);
          getPtrAndLen(j+1, ptr, len);
-
          NABoolean nullTerminate = 
            DFS2REC::is8bitCharacter(outputAttrs_[j].fsDatatype_);
 
@@ -1301,7 +1322,8 @@ short ExeCliInterface::fetchAllRows(Queue * &infoList,
            if (nullTerminate)
              r[len] = 0;
          }
-         oi->insert(j, r, len);
+//comehere add type
+         oi->insert(j, r, len, type);
        }
        
        infoList->insert(oi);

http://git-wip-us.apache.org/repos/asf/trafodion/blob/f75ea3f7/core/sql/executor/ExExeUtilCli.h
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExExeUtilCli.h b/core/sql/executor/ExExeUtilCli.h
index 62fff82..09eb41e 100644
--- a/core/sql/executor/ExExeUtilCli.h
+++ b/core/sql/executor/ExExeUtilCli.h
@@ -33,13 +33,16 @@ class OutputInfo
   void dealloc(CollHeap * heap);
   void insert(Lng32 index, char * data);
   void insert(Lng32 index, char * data, Lng32 len);
+  void insert(Lng32 index, char * data, Lng32 len,Lng32 type,Lng32 *indOffset 
= NULL, Lng32 *varOffset = NULL);
   char * get(Lng32 index);
   short get(Lng32 index, char* &data, Lng32 &len);
+  short get(Lng32 index, char* &data, Lng32 &len, Lng32 &type,Lng32 
*indOffset, Lng32 *varOffset);
 
  private:
   Lng32 numEntries_;
   char * data_[MAX_OUTPUT_ENTRIES];
   Lng32 len_[MAX_OUTPUT_ENTRIES];
+  Lng32 type_[MAX_OUTPUT_ENTRIES];
 };
 
 class ExeCliInterface : public NABasicObject

Reply via email to