trafodion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject [5/6] incubator-trafodion git commit: fix feedback comments
Date Mon, 28 Nov 2016 22:32:21 GMT
fix feedback comments


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

Branch: refs/heads/master
Commit: 5dbf5ff2a824a22d9e1cbaf3d046402291ca2142
Parents: b22097b
Author: Prashant Vasudev <prashanth.vasudev@esgyn.com>
Authored: Wed Nov 23 00:45:24 2016 +0000
Committer: Prashant Vasudev <prashanth.vasudev@esgyn.com>
Committed: Wed Nov 23 00:45:24 2016 +0000

----------------------------------------------------------------------
 core/sqf/src/seatrans/tm/hbasetmlib2/hbasetm.cpp | 17 +++++++++--------
 core/sqf/src/tm/tmddlrequests.cpp                | 10 ++++++----
 2 files changed, 15 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/5dbf5ff2/core/sqf/src/seatrans/tm/hbasetmlib2/hbasetm.cpp
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/tm/hbasetmlib2/hbasetm.cpp b/core/sqf/src/seatrans/tm/hbasetmlib2/hbasetm.cpp
index 683d181..326ba50 100644
--- a/core/sqf/src/seatrans/tm/hbasetmlib2/hbasetm.cpp
+++ b/core/sqf/src/seatrans/tm/hbasetmlib2/hbasetm.cpp
@@ -863,9 +863,9 @@ int CHbaseTM::createTable(int64 pv_transid,
                     j_keys);
   if (getExceptionDetails(NULL)) {
      int errMsgLen = (int)_tlp_error_msg->length();
-	 errstrlen = ((errMsgLen < errstrlen) && (errMsgLen > 0)) ? errMsgLen : errstrlen;
+	 errstrlen = ((errMsgLen < errstrlen) && (errMsgLen > 0)) ? errMsgLen  : errstrlen
-1;
 	 strncpy(errstr, _tlp_error_msg->c_str(), errstrlen);
-	 errstr[errstrlen -1] = '\0';
+	 errstr[errstrlen] = '\0';
 	 tm_log_write(DTM_TM_JNI_ERROR, SQ_LOG_ERR, (char *)"CHbaseTM::createTable()", (char *)_tlp_error_msg->c_str(),
pv_transid);
      return RET_EXCEPTION;
   }
@@ -922,9 +922,9 @@ int CHbaseTM::alterTable(int64 pv_transid,
                     j_tblopts);
    if (getExceptionDetails(NULL)) {
       int errMsgLen = (int)_tlp_error_msg->length();
-      errstrlen = ((errMsgLen < errstrlen) && (errMsgLen > 0)) ? errMsgLen
: errstrlen;
+      errstrlen = ((errMsgLen < errstrlen) && (errMsgLen > 0)) ? errMsgLen
: errstrlen -1;
       strncpy(errstr, _tlp_error_msg->c_str(), errstrlen);
-      errstr[errstrlen -1] = '\0';
+      errstr[errstrlen] = '\0';
       tm_log_write(DTM_TM_JNI_ERROR, SQ_LOG_ERR, (char *)"CHbaseTM::alterTable()", (char
*)_tlp_error_msg->c_str(), pv_transid);
       return RET_EXCEPTION;
    }
@@ -975,8 +975,9 @@ int CHbaseTM::regTruncateOnAbort(int64 pv_transid,
                     jba_tblname);
    if (getExceptionDetails(NULL)) {
       int errMsgLen = (int)_tlp_error_msg->length();
-      errstrlen = ((errMsgLen < errstrlen) && (errMsgLen > 0)) ? errMsgLen
: errstrlen;      strncpy(errstr, _tlp_error_msg->c_str(), errstrlen);
-      errstr[errstrlen -1] = '\0';
+      errstrlen = ((errMsgLen < errstrlen) && (errMsgLen > 0)) ? errMsgLen
: errstrlen -1;
+      strncpy(errstr, _tlp_error_msg->c_str(), errstrlen);
+      errstr[errstrlen] = '\0';
       tm_log_write(DTM_TM_JNI_ERROR, SQ_LOG_ERR, (char *)"CHbaseTM::regTruncateOnAbort()",
(char *)_tlp_error_msg->c_str(), pv_transid);
       return RET_EXCEPTION;
    }
@@ -1025,9 +1026,9 @@ int CHbaseTM::dropTable(int64 pv_transid,
                     jba_tblname);
    if (getExceptionDetails(NULL)) {
       int errMsgLen = (int)_tlp_error_msg->length();
-      errstrlen = ((errMsgLen < errstrlen) && (errMsgLen > 0)) ? errMsgLen
: errstrlen;
+      errstrlen = ((errMsgLen < errstrlen) && (errMsgLen > 0)) ? errMsgLen
: errstrlen -1;
       strncpy(errstr, _tlp_error_msg->c_str(), errstrlen);
-      errstr[errstrlen -1] = '\0';
+      errstr[errstrlen] = '\0';
       tm_log_write(DTM_TM_JNI_ERROR, SQ_LOG_ERR, (char *)"CHbaseTM::dropTable()", (char *)_tlp_error_msg->c_str(),
pv_transid);
       return RET_EXCEPTION;
    }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/5dbf5ff2/core/sqf/src/tm/tmddlrequests.cpp
----------------------------------------------------------------------
diff --git a/core/sqf/src/tm/tmddlrequests.cpp b/core/sqf/src/tm/tmddlrequests.cpp
index 58ed0d6..93f699b 100644
--- a/core/sqf/src/tm/tmddlrequests.cpp
+++ b/core/sqf/src/tm/tmddlrequests.cpp
@@ -206,9 +206,8 @@ JNIEXPORT jstring JNICALL Java_org_apache_hadoop_hbase_client_transactional_RMIn
    char *la_err_str = 0;
    int la_err_len = 0;
 
-   char** tbl_options;
-   tbl_options = new char *[TM_MAX_DDLREQUEST_STRING];
-
+   char** tbl_options = 0;
+   
    int lv_tblname_len = pp_env->GetArrayLength(pv_tblName);
    if(lv_tblname_len > TM_MAX_DDLREQUEST_STRING)
    {
@@ -218,6 +217,8 @@ JNIEXPORT jstring JNICALL Java_org_apache_hadoop_hbase_client_transactional_RMIn
    jbyte *lp_tblname = pp_env->GetByteArrayElements(pv_tblName, 0);
    
    int tbloptions_cnt = pp_env->GetArrayLength(pv_tableOptions);
+   if(tbloptions_cnt)
+     tbl_options = new char *[tbloptions_cnt];
 
    for (int i=0; i<tbloptions_cnt; i++) {
 
@@ -245,7 +246,8 @@ JNIEXPORT jstring JNICALL Java_org_apache_hadoop_hbase_client_transactional_RMIn
                           tblopts_len, tbloptions_cnt, lv_transid,
                           la_err_str, la_err_len);
    pp_env->ReleaseByteArrayElements(pv_tblName, lp_tblname, 0);
-   
+   if(tbl_options)
+     delete [] tbl_options;
    if(lv_error)
    {
      jstring lv_err_str;


Mime
View raw message