Return-Path: X-Original-To: apmail-trafodion-commits-archive@www.apache.org Delivered-To: apmail-trafodion-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4B62F18FAA for ; Sat, 16 Jan 2016 09:11:56 +0000 (UTC) Received: (qmail 61812 invoked by uid 500); 16 Jan 2016 09:11:56 -0000 Delivered-To: apmail-trafodion-commits-archive@trafodion.apache.org Received: (qmail 61780 invoked by uid 500); 16 Jan 2016 09:11:56 -0000 Mailing-List: contact commits-help@trafodion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: commits@trafodion.apache.org Delivered-To: mailing list commits@trafodion.apache.org Received: (qmail 61771 invoked by uid 99); 16 Jan 2016 09:11:56 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 16 Jan 2016 09:11:56 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id C2BCD18044D for ; Sat, 16 Jan 2016 09:11:55 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.227 X-Spam-Level: * X-Spam-Status: No, score=1.227 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.554, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id b7l8_wN9H-Tv for ; Sat, 16 Jan 2016 09:11:49 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with SMTP id 87DA5206C9 for ; Sat, 16 Jan 2016 09:11:49 +0000 (UTC) Received: (qmail 61662 invoked by uid 99); 16 Jan 2016 09:11:49 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 16 Jan 2016 09:11:49 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 263D4DFA3E; Sat, 16 Jan 2016 09:11:49 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: arvindn@apache.org To: commits@trafodion.incubator.apache.org Date: Sat, 16 Jan 2016 09:11:49 -0000 Message-Id: <7a1bc61402a7402cbd007c28149ce6b2@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/2] incubator-trafodion git commit: [TRAFODION-1682]MT-DCS protocol issue fix Repository: incubator-trafodion Updated Branches: refs/heads/master acb7f2b6f -> 9409c8ea0 [TRAFODION-1682]MT-DCS protocol issue fix This commit will fix following issues. 1. [TRAFODION-1682][MTDCS] ODBC: SQLFetch returned invalid cursor state. It's caused by the length of descriptor2List is not correct and the sqlQueryType is not correct either. For sqlQueryType, SqlUtils.getSqlStmtType(String str) will be used instead of SqlUtils.getSqlStmtType(int stmtType) since it can't return the correct value. 2. [TRAFODION-1653][MTDCS] coast tests core dumped at 'operator new' when Multithread DCS is on. It's caused by the EndTransaction message missing a int which indicate 0 excaption when there is no exception. 3. [TRAFODION-1658][MTDCS] with MultiThread DCS on, coast core dumped at memcpy when there is parameter in prepare statement. It's caused by the length of the descriptor2List is not correct. Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/e06b2640 Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/e06b2640 Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/e06b2640 Branch: refs/heads/master Commit: e06b2640e6f83556217405f81f8f211db1fedac0 Parents: fc9651f Author: Weiqing Xu Authored: Thu Jan 14 02:57:32 2016 +0000 Committer: Weiqing Xu Committed: Thu Jan 14 02:57:32 2016 +0000 ---------------------------------------------------------------------- .../serverDriverInputOutput/Descriptor2List.java | 2 +- .../serverHandler/ServerApiSqlEndTransact.java | 14 +++++++++++++- .../serverHandler/ServerApiSqlExecDirect.java | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/e06b2640/dcs/src/main/java/org/trafodion/dcs/servermt/serverDriverInputOutput/Descriptor2List.java ---------------------------------------------------------------------- diff --git a/dcs/src/main/java/org/trafodion/dcs/servermt/serverDriverInputOutput/Descriptor2List.java b/dcs/src/main/java/org/trafodion/dcs/servermt/serverDriverInputOutput/Descriptor2List.java index df8c749..53de87a 100644 --- a/dcs/src/main/java/org/trafodion/dcs/servermt/serverDriverInputOutput/Descriptor2List.java +++ b/dcs/src/main/java/org/trafodion/dcs/servermt/serverDriverInputOutput/Descriptor2List.java @@ -80,7 +80,7 @@ public class Descriptor2List { if (descCount == descNumber){ Descriptor2 desc = null; if (oldFormat == false) - descLength = 3 * ServerConstants.INT_FIELD_SIZE; + descLength = 2 * ServerConstants.INT_FIELD_SIZE; else descLength = ServerConstants.INT_FIELD_SIZE; varLength = 0; http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/e06b2640/dcs/src/main/java/org/trafodion/dcs/servermt/serverHandler/ServerApiSqlEndTransact.java ---------------------------------------------------------------------- diff --git a/dcs/src/main/java/org/trafodion/dcs/servermt/serverHandler/ServerApiSqlEndTransact.java b/dcs/src/main/java/org/trafodion/dcs/servermt/serverHandler/ServerApiSqlEndTransact.java index dc1a323..22cc97e 100644 --- a/dcs/src/main/java/org/trafodion/dcs/servermt/serverHandler/ServerApiSqlEndTransact.java +++ b/dcs/src/main/java/org/trafodion/dcs/servermt/serverHandler/ServerApiSqlEndTransact.java @@ -127,6 +127,13 @@ public class ServerApiSqlEndTransact { dataLength = serverException.lengthOfData(); availableBuffer = bbBody.capacity() - bbBody.position(); + // If there is no Exception, serverException.lengthOfData() will return 8; + // The driver still need read a int will indicate the number of the exception, + // which should be 0; + // So here, we add extra 4 bytes for it. + if (dataLength == 2 * ServerConstants.INT_FIELD_SIZE) { + dataLength = dataLength + ServerConstants.INT_FIELD_SIZE; + } if(LOG.isDebugEnabled()) LOG.debug(serverWorkerName + ". dataLength :" + dataLength + " availableBuffer :" + availableBuffer); @@ -138,6 +145,11 @@ public class ServerApiSqlEndTransact { //===================== build output ============================================== serverException.insertIntoByteBuffer(bbBody); + // if there is no exception, we add a extra 4 bytes which indicate the number of + // the exception which should be 0; + if (serverException.lengthOfData() == 2 * ServerConstants.INT_FIELD_SIZE) { + bbBody.putInt(0); + } bbBody.flip(); //=========================Update header================================ hdr.setTotalLength(bbBody.limit()); @@ -161,4 +173,4 @@ public class ServerApiSqlEndTransact { reset(); return clientData; } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/e06b2640/dcs/src/main/java/org/trafodion/dcs/servermt/serverHandler/ServerApiSqlExecDirect.java ---------------------------------------------------------------------- diff --git a/dcs/src/main/java/org/trafodion/dcs/servermt/serverHandler/ServerApiSqlExecDirect.java b/dcs/src/main/java/org/trafodion/dcs/servermt/serverHandler/ServerApiSqlExecDirect.java index d2c8448..c0eff71 100644 --- a/dcs/src/main/java/org/trafodion/dcs/servermt/serverHandler/ServerApiSqlExecDirect.java +++ b/dcs/src/main/java/org/trafodion/dcs/servermt/serverHandler/ServerApiSqlExecDirect.java @@ -215,7 +215,7 @@ public class ServerApiSqlExecDirect { throw new SQLException(serverWorkerName + ". Wrong dialogueId sent by the Client [sent/expected] : [" + dialogueId + "/" + clientData.getDialogueId() + "]"); } //============================================================================= - sqlQueryType = SqlUtils.getSqlStmtType(sqlStmtType); + sqlQueryType = SqlUtils.getSqlStmtType(sqlString); try { trafConn = clientData.getTrafConnection();