ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From isap...@apache.org
Subject ignite git commit: IGNITE-6841: Increased ODBC protocol version for multiple statements. This closes #2995
Date Fri, 10 Nov 2017 10:13:15 GMT
Repository: ignite
Updated Branches:
  refs/heads/master c11fc4117 -> 954e47b9c


IGNITE-6841: Increased ODBC protocol version for multiple statements.
This closes #2995


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

Branch: refs/heads/master
Commit: 954e47b9cf37dc24a7c859f7eda9af41b6d7d1e7
Parents: c11fc41
Author: Igor Sapego <isapego@gridgain.com>
Authored: Fri Nov 10 13:12:24 2017 +0300
Committer: Igor Sapego <isapego@gridgain.com>
Committed: Fri Nov 10 13:12:24 2017 +0300

----------------------------------------------------------------------
 .../processors/odbc/odbc/OdbcConnectionContext.java         | 6 +++++-
 .../internal/processors/odbc/odbc/OdbcMessageParser.java    | 2 +-
 modules/platforms/cpp/odbc-test/src/queries_test.cpp        | 8 ++++++++
 .../cpp/odbc/include/ignite/odbc/protocol_version.h         | 9 ++++++++-
 modules/platforms/cpp/odbc/src/message.cpp                  | 2 +-
 modules/platforms/cpp/odbc/src/protocol_version.cpp         | 4 +++-
 6 files changed, 26 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/954e47b9/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/odbc/OdbcConnectionContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/odbc/OdbcConnectionContext.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/odbc/OdbcConnectionContext.java
index 88a2e0f..6a922bf 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/odbc/OdbcConnectionContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/odbc/OdbcConnectionContext.java
@@ -40,8 +40,11 @@ public class OdbcConnectionContext implements ClientListenerConnectionContext
{
     /** Version 2.3.0: added "skipReducerOnUpdate" flag. */
     public static final ClientListenerProtocolVersion VER_2_3_0 = ClientListenerProtocolVersion.create(2,
3, 0);
 
+    /** Version 2.3.2: added multiple statements support. */
+    public static final ClientListenerProtocolVersion VER_2_3_2 = ClientListenerProtocolVersion.create(2,
3, 2);
+
     /** Current version. */
-    private static final ClientListenerProtocolVersion CURRENT_VER = VER_2_3_0;
+    private static final ClientListenerProtocolVersion CURRENT_VER = VER_2_3_2;
 
     /** Supported versions. */
     private static final Set<ClientListenerProtocolVersion> SUPPORTED_VERS = new HashSet<>();
@@ -63,6 +66,7 @@ public class OdbcConnectionContext implements ClientListenerConnectionContext
{
 
     static {
         SUPPORTED_VERS.add(CURRENT_VER);
+        SUPPORTED_VERS.add(VER_2_3_0);
         SUPPORTED_VERS.add(VER_2_1_5);
         SUPPORTED_VERS.add(VER_2_1_0);
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/954e47b9/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/odbc/OdbcMessageParser.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/odbc/OdbcMessageParser.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/odbc/OdbcMessageParser.java
index bf74bc5..fb17d2a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/odbc/OdbcMessageParser.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/odbc/OdbcMessageParser.java
@@ -362,7 +362,7 @@ public class OdbcMessageParser implements ClientListenerMessageParser
{
      * @param affectedRows Affected rows.
      */
     private void writeAffectedRows(BinaryWriterExImpl writer, Collection<Long> affectedRows)
{
-        if (ver.compareTo(OdbcConnectionContext.VER_2_3_0) < 0) {
+        if (ver.compareTo(OdbcConnectionContext.VER_2_3_2) < 0) {
             long summ = 0;
 
             for (Long value : affectedRows)

http://git-wip-us.apache.org/repos/asf/ignite/blob/954e47b9/modules/platforms/cpp/odbc-test/src/queries_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc-test/src/queries_test.cpp b/modules/platforms/cpp/odbc-test/src/queries_test.cpp
index 0b0bf82..6fcf7c9 100644
--- a/modules/platforms/cpp/odbc-test/src/queries_test.cpp
+++ b/modules/platforms/cpp/odbc-test/src/queries_test.cpp
@@ -771,6 +771,14 @@ BOOST_AUTO_TEST_CASE(TestConnectionProtocolVersion_2_3_0)
     InsertTestBatch(11, 20, 9);
 }
 
+BOOST_AUTO_TEST_CASE(TestConnectionProtocolVersion_2_3_2)
+{
+    Connect("DRIVER={Apache Ignite};ADDRESS=127.0.0.1:11110;SCHEMA=cache;PROTOCOL_VERSION=2.3.2");
+
+    InsertTestStrings(10, false);
+    InsertTestBatch(11, 20, 9);
+}
+
 BOOST_AUTO_TEST_CASE(TestTwoRowsInt8)
 {
     CheckTwoRowsInt<signed char>(SQL_C_STINYINT);

http://git-wip-us.apache.org/repos/asf/ignite/blob/954e47b9/modules/platforms/cpp/odbc/include/ignite/odbc/protocol_version.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/protocol_version.h b/modules/platforms/cpp/odbc/include/ignite/odbc/protocol_version.h
index e6088a7..f39c11e 100644
--- a/modules/platforms/cpp/odbc/include/ignite/odbc/protocol_version.h
+++ b/modules/platforms/cpp/odbc/include/ignite/odbc/protocol_version.h
@@ -31,11 +31,18 @@ namespace ignite
         class ProtocolVersion
         {
         public:
-            /** Current protocol version. */
+            /** Version 2.1.0. */
             static const ProtocolVersion VERSION_2_1_0;
+
+            /** Version 2.1.5: added "lazy" flag. */
             static const ProtocolVersion VERSION_2_1_5;
+
+            /** Version 2.3.0: added "skipReducerOnUpdate" flag. */
             static const ProtocolVersion VERSION_2_3_0;
 
+            /** Version 2.3.2: added multiple statements support. */
+            static const ProtocolVersion VERSION_2_3_2;
+
             typedef std::set<ProtocolVersion> VersionSet;
 
             /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/954e47b9/modules/platforms/cpp/odbc/src/message.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/message.cpp b/modules/platforms/cpp/odbc/src/message.cpp
index 5595ddb..32a5d91 100644
--- a/modules/platforms/cpp/odbc/src/message.cpp
+++ b/modules/platforms/cpp/odbc/src/message.cpp
@@ -28,7 +28,7 @@ namespace
     {
         affectedRows.clear();
 
-        if (protocolVersion < ProtocolVersion::VERSION_2_3_0)
+        if (protocolVersion < ProtocolVersion::VERSION_2_3_2)
             affectedRows.push_back(reader.ReadInt64());
         else
         {

http://git-wip-us.apache.org/repos/asf/ignite/blob/954e47b9/modules/platforms/cpp/odbc/src/protocol_version.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/protocol_version.cpp b/modules/platforms/cpp/odbc/src/protocol_version.cpp
index b0b9121..d7d85ad 100644
--- a/modules/platforms/cpp/odbc/src/protocol_version.cpp
+++ b/modules/platforms/cpp/odbc/src/protocol_version.cpp
@@ -29,11 +29,13 @@ namespace ignite
         const ProtocolVersion ProtocolVersion::VERSION_2_1_0(2, 1, 0);
         const ProtocolVersion ProtocolVersion::VERSION_2_1_5(2, 1, 5);
         const ProtocolVersion ProtocolVersion::VERSION_2_3_0(2, 3, 0);
+        const ProtocolVersion ProtocolVersion::VERSION_2_3_2(2, 3, 2);
 
         ProtocolVersion::VersionSet::value_type supportedArray[] = {
             ProtocolVersion::VERSION_2_1_0,
             ProtocolVersion::VERSION_2_1_5,
             ProtocolVersion::VERSION_2_3_0,
+            ProtocolVersion::VERSION_2_3_2,
         };
 
         const ProtocolVersion::VersionSet ProtocolVersion::supported(supportedArray,
@@ -62,7 +64,7 @@ namespace ignite
 
         const ProtocolVersion& ProtocolVersion::GetCurrent()
         {
-            return VERSION_2_3_0;
+            return VERSION_2_3_2;
         }
 
         void ThrowParseError()


Mime
View raw message