You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2016/01/25 12:55:03 UTC

[01/50] ignite git commit: IGNITE-1786: Fix for CacheQueryExample.

Repository: ignite
Updated Branches:
  refs/heads/ignite-1786 [created] 1138cf8c7


IGNITE-1786: Fix for CacheQueryExample.


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

Branch: refs/heads/ignite-1786
Commit: 15a5834e0f9cf81abfc02b66af7153319696ccfd
Parents: 7cd80c5
Author: isapego <is...@gridgain.com>
Authored: Wed Dec 30 16:56:33 2015 +0300
Committer: isapego <is...@gridgain.com>
Committed: Wed Dec 30 16:56:33 2015 +0300

----------------------------------------------------------------------
 .../examples/datagrid/CacheQueryExample.java    | 24 +++++---------------
 1 file changed, 6 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/15a5834e/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryExample.java
index 95d661b..98af93c 100644
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryExample.java
@@ -63,10 +63,10 @@ import org.apache.ignite.lang.IgniteBiPredicate;
  */
 public class CacheQueryExample {
     /** Organizations cache name. */
-    private static final String ORG_CACHE = "Organizations";
+    private static final String ORG_CACHE = CacheQueryExample.class.getSimpleName() + "Organizations";
 
     /** Persons cache name. */
-    private static final String PERSON_CACHE = "Persons";
+    private static final String PERSON_CACHE = CacheQueryExample.class.getSimpleName() + "Persons";
 
     /**
      * Executes example.
@@ -117,10 +117,6 @@ public class CacheQueryExample {
 
                 // Example for SQL-based fields queries that uses joins.
                 sqlFieldsQueryWithJoin();
-
-                synchronized (CacheQueryExample.class) {
-                    CacheQueryExample.class.wait();
-                }
             }
 
             print("Cache query example finished.");
@@ -286,14 +282,10 @@ public class CacheQueryExample {
         personCache.clear();
 
         // People.
-        Person p1 = new Person(org1, "John", "Doe", 2000, "Master Degree.");
-        Person p2 = new Person(org1, "Jane", "Doe", 1000, "Bachelor Degree.");
-        Person p3 = new Person(org2, "John", "Smith", 1000, "Bachelor Degree.");
-        Person p4 = new Person(org2, "Jane", "Smith", 2000, "Master Degree.");
-        Person p5 = new Person(org2, "John", "Roe", 1500, "Bachelor Degree.");
-        Person p6 = new Person(org2, "Jane", "Roe", 1000, "Bachelor Degree.");
-        Person p7 = new Person(org1, "Richard", "Miles", 2500, "Master Degree.");
-        Person p8 = new Person(org2, "Mary", "Major", 900, "Bachelor Degree.");
+        Person p1 = new Person(org1, "John", "Doe", 2000, "John Doe has Master Degree.");
+        Person p2 = new Person(org1, "Jane", "Doe", 1000, "Jane Doe has Bachelor Degree.");
+        Person p3 = new Person(org2, "John", "Smith", 1000, "John Smith has Bachelor Degree.");
+        Person p4 = new Person(org2, "Jane", "Smith", 2000, "Jane Smith has Master Degree.");
 
         // Note that in this example we use custom affinity key for Person objects
         // to ensure that all persons are collocated with their organizations.
@@ -301,10 +293,6 @@ public class CacheQueryExample {
         personCache.put(p2.key(), p2);
         personCache.put(p3.key(), p3);
         personCache.put(p4.key(), p4);
-        personCache.put(p5.key(), p5);
-        personCache.put(p6.key(), p6);
-        personCache.put(p7.key(), p7);
-        personCache.put(p8.key(), p8);
     }
 
     /**


[42/50] ignite git commit: IGNITE-2248: Refactoring of simple API calls that are always succesessfull.

Posted by vo...@apache.org.
IGNITE-2248: Refactoring of simple API calls that are always
succesessfull.


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

Branch: refs/heads/ignite-1786
Commit: a5d824c03110f996c780f3e6ab87ade7a5ca8722
Parents: bf566a8
Author: isapego <is...@gridgain.com>
Authored: Thu Jan 21 16:21:07 2016 +0300
Committer: isapego <is...@gridgain.com>
Committed: Thu Jan 21 16:21:07 2016 +0300

----------------------------------------------------------------------
 .../odbc/diagnostic/diagnosable_adapter.h       |  4 +++
 .../cpp/odbc/odbc-driver/src/statement.cpp      | 32 +++++---------------
 2 files changed, 12 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/a5d824c0/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/diagnostic/diagnosable_adapter.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/diagnostic/diagnosable_adapter.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/diagnostic/diagnosable_adapter.h
index ce9b7cd..5b01f49 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/diagnostic/diagnosable_adapter.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/diagnostic/diagnosable_adapter.h
@@ -25,6 +25,10 @@
         SqlResult result = (__VA_ARGS__);           \
         diagnosticRecords.SetHeaderRecord(result)
 
+#define IGNITE_ODBC_API_CALL_ALWAYS_SUCCESS                     \
+        diagnosticRecords.Reset();                              \
+        diagnosticRecords.SetHeaderRecord(SQL_RESULT_SUCCESS)
+
 namespace ignite
 {
     namespace odbc

http://git-wip-us.apache.org/repos/asf/ignite/blob/a5d824c0/modules/platforms/cpp/odbc/odbc-driver/src/statement.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/statement.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/statement.cpp
index 4fd0294..d23c276 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/statement.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/statement.cpp
@@ -45,31 +45,25 @@ namespace ignite
 
         void Statement::BindColumn(uint16_t columnIdx, const app::ApplicationDataBuffer& buffer)
         {
-            diagnosticRecords.Reset();
+            IGNITE_ODBC_API_CALL_ALWAYS_SUCCESS;
 
             columnBindings[columnIdx] = buffer;
 
             columnBindings[columnIdx].SetPtrToOffsetPtr(&columnBindOffset);
-
-            diagnosticRecords.SetHeaderRecord(SQL_RESULT_SUCCESS);
         }
 
         void Statement::UnbindColumn(uint16_t columnIdx)
         {
-            diagnosticRecords.Reset();
+            IGNITE_ODBC_API_CALL_ALWAYS_SUCCESS;
 
             columnBindings.erase(columnIdx);
-
-            diagnosticRecords.SetHeaderRecord(SQL_RESULT_SUCCESS);
         }
 
         void Statement::UnbindAllColumns()
         {
-            diagnosticRecords.Reset();
+            IGNITE_ODBC_API_CALL_ALWAYS_SUCCESS;
 
             columnBindings.clear();
-
-            diagnosticRecords.SetHeaderRecord(SQL_RESULT_SUCCESS);
         }
 
         void Statement::SetColumnBindOffsetPtr(size_t * ptr)
@@ -109,49 +103,39 @@ namespace ignite
 
         void Statement::BindParameter(uint16_t paramIdx, const app::Parameter& param)
         {
-            diagnosticRecords.Reset();
+            IGNITE_ODBC_API_CALL_ALWAYS_SUCCESS;
 
             paramBindings[paramIdx] = param;
 
             paramBindings[paramIdx].GetBuffer().SetPtrToOffsetPtr(&paramBindOffset);
-
-            diagnosticRecords.SetHeaderRecord(SQL_RESULT_SUCCESS);
         }
 
         void Statement::UnbindParameter(uint16_t paramIdx)
         {
-            diagnosticRecords.Reset();
+            IGNITE_ODBC_API_CALL_ALWAYS_SUCCESS;
 
             paramBindings.erase(paramIdx);
-
-            diagnosticRecords.SetHeaderRecord(SQL_RESULT_SUCCESS);
         }
 
         void Statement::UnbindAllParameters()
         {
-            diagnosticRecords.Reset();
+            IGNITE_ODBC_API_CALL_ALWAYS_SUCCESS;
 
             paramBindings.clear();
-
-            diagnosticRecords.SetHeaderRecord(SQL_RESULT_SUCCESS);
         }
 
         uint16_t Statement::GetParametersNumber()
         {
-            diagnosticRecords.Reset();
+            IGNITE_ODBC_API_CALL_ALWAYS_SUCCESS;
 
             return static_cast<uint16_t>(paramBindings.size());
-
-            diagnosticRecords.SetHeaderRecord(SQL_RESULT_SUCCESS);
         }
 
         void Statement::SetParamBindOffsetPtr(size_t* ptr)
         {
-            diagnosticRecords.Reset();
+            IGNITE_ODBC_API_CALL_ALWAYS_SUCCESS;
 
             paramBindOffset = ptr;
-
-            diagnosticRecords.SetHeaderRecord(SQL_RESULT_SUCCESS);
         }
 
         size_t * Statement::GetParamBindOffsetPtr()


[10/50] ignite git commit: IGNITE-2223: Basic decimal type cast implemented.

Posted by vo...@apache.org.
IGNITE-2223: Basic decimal type cast implemented.


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

Branch: refs/heads/ignite-1786
Commit: d4547246a5d74588a76677ab3af31563d6e87cdc
Parents: 9c904bf
Author: isapego <is...@gridgain.com>
Authored: Tue Jan 12 15:36:31 2016 +0300
Committer: isapego <is...@gridgain.com>
Committed: Tue Jan 12 15:36:31 2016 +0300

----------------------------------------------------------------------
 .../ignite/odbc/app/application_data_buffer.h   |  8 +++
 .../odbc-driver/include/ignite/odbc/decimal.h   | 19 ++++++
 .../src/app/application_data_buffer.cpp         | 68 ++++++++++++++++++--
 .../cpp/odbc/odbc-driver/src/decimal.cpp        | 36 ++++++++++-
 .../platforms/cpp/odbc/odbc-driver/src/row.cpp  | 25 ++++++-
 5 files changed, 147 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/d4547246/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/app/application_data_buffer.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/app/application_data_buffer.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/app/application_data_buffer.h
index 5b7d539..c2d4d1b 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/app/application_data_buffer.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/app/application_data_buffer.h
@@ -24,6 +24,7 @@
 
 #include <ignite/guid.h>
 
+#include "ignite/odbc/decimal.h"
 #include "ignite/odbc/type_traits.h"
 
 namespace ignite
@@ -154,6 +155,13 @@ namespace ignite
                 void PutNull();
 
                 /**
+                 * Put decimal value to buffer.
+                 *
+                 * @param value Value to put.
+                 */
+                void PutDecimal(const Decimal& value);
+
+                /**
                  * Get string.
                  *
                  * @return String value of buffer.

http://git-wip-us.apache.org/repos/asf/ignite/blob/d4547246/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/decimal.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/decimal.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/decimal.h
index 7b5188b..abf7f34 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/decimal.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/decimal.h
@@ -62,6 +62,11 @@ namespace ignite
         Decimal& operator=(const Decimal& other);
 
         /**
+         * Convert to double.
+         */
+        operator double() const;
+
+        /**
          * Get scale.
          *
          * @return Scale.
@@ -69,6 +74,20 @@ namespace ignite
         int32_t GetScale() const;
 
         /**
+         * Get sign.
+         *
+         * @return Sign: -1 if negative and 1 if positive.
+         */
+        int32_t GetSign() const;
+
+        /**
+         * Check if the value is negative.
+         * 
+         * @return True if negative and false otherwise.
+         */
+        bool IsNegative() const;
+
+        /**
          * Get magnitude length.
          *
          * @return Magnitude length.

http://git-wip-us.apache.org/repos/asf/ignite/blob/d4547246/modules/platforms/cpp/odbc/odbc-driver/src/app/application_data_buffer.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/app/application_data_buffer.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/app/application_data_buffer.cpp
index e3e4400..3a3d061 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/app/application_data_buffer.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/app/application_data_buffer.cpp
@@ -446,9 +446,9 @@ namespace ignite
                         for (size_t i = 0; i < len; ++i)
                         {
                             converter << std::hex
-                                << std::setfill('0')
-                                << std::setw(2)
-                                << (unsigned)dataBytes[i];
+                                      << std::setfill('0')
+                                      << std::setw(2)
+                                      << static_cast<unsigned>(dataBytes[i]);
                         }
 
                         PutStrToStrBuffer<char>(converter.str());
@@ -467,7 +467,7 @@ namespace ignite
                             converter << std::hex
                                       << std::setfill<wchar_t>('0')
                                       << std::setw(2)
-                                      << (unsigned)dataBytes[i];
+                                      << static_cast<unsigned>(dataBytes[i]);
                         }
 
                         PutStrToStrBuffer<wchar_t>(converter.str());
@@ -489,6 +489,66 @@ namespace ignite
                     *GetResLen() = SQL_NULL_DATA;
             }
 
+            void ApplicationDataBuffer::PutDecimal(const Decimal& value)
+            {
+                using namespace type_traits;
+                switch (type)
+                {
+                    case IGNITE_ODBC_C_TYPE_SIGNED_TINYINT:
+                    case IGNITE_ODBC_C_TYPE_BIT:
+                    case IGNITE_ODBC_C_TYPE_UNSIGNED_TINYINT:
+                    case IGNITE_ODBC_C_TYPE_SIGNED_SHORT:
+                    case IGNITE_ODBC_C_TYPE_UNSIGNED_SHORT:
+                    case IGNITE_ODBC_C_TYPE_SIGNED_LONG:
+                    case IGNITE_ODBC_C_TYPE_UNSIGNED_LONG:
+                    case IGNITE_ODBC_C_TYPE_SIGNED_BIGINT:
+                    case IGNITE_ODBC_C_TYPE_UNSIGNED_BIGINT:
+                    case IGNITE_ODBC_C_TYPE_FLOAT:
+                    case IGNITE_ODBC_C_TYPE_DOUBLE:
+                    case IGNITE_ODBC_C_TYPE_CHAR:
+                    case IGNITE_ODBC_C_TYPE_WCHAR:
+                    {
+                        PutNum<double>(static_cast<double>(value));
+
+                        break;
+                    }
+
+                    case IGNITE_ODBC_C_TYPE_NUMERIC:
+                    {
+                        if (GetData())
+                        {
+                            SQL_NUMERIC_STRUCT* numeric =
+                                reinterpret_cast<SQL_NUMERIC_STRUCT*>(GetData());
+
+                            numeric->sign = value.IsNegative() ? 1 : 0;
+                            numeric->precision = 0;
+                            numeric->scale = value.GetScale();
+                            memcpy(numeric->val, value.GetMagnitude(), std::min<size_t>(SQL_MAX_NUMERIC_LEN, value.GetLength()));
+                        }
+
+                        break;
+                    }
+
+                    case IGNITE_ODBC_C_TYPE_DEFAULT:
+                    {
+                        if (GetData())
+                            memcpy(GetData(), &value, std::min<size_t>(buflen, sizeof(value)));
+
+                        if (GetResLen())
+                            *GetResLen() = sizeof(value);
+
+                        break;
+                    }
+
+                    case IGNITE_ODBC_C_TYPE_BINARY:
+                    default:
+                    {
+                        if (GetResLen())
+                            *GetResLen() = SQL_NO_TOTAL;
+                    }
+                }
+            }
+
             std::string ApplicationDataBuffer::GetString(size_t maxLen) const
             {
                 using namespace type_traits;

http://git-wip-us.apache.org/repos/asf/ignite/blob/d4547246/modules/platforms/cpp/odbc/odbc-driver/src/decimal.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/decimal.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/decimal.cpp
index af16747..128fb97 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/decimal.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/decimal.cpp
@@ -22,10 +22,10 @@
 
 namespace ignite
 {
-
     Decimal::Decimal() : 
         scale(0), len(0), magnitude(0)
     {
+        // No-op.
     }
 
     Decimal::Decimal(int32_t scale, const int8_t* mag, int32_t len) :
@@ -59,9 +59,40 @@ namespace ignite
         return *this;
     }
 
+    Decimal::operator double() const
+    {
+        double res = 1;
+
+        int32_t localScale = GetScale();
+        
+        for (size_t i = 0; i < len; ++i)
+        {
+            res = (res * 256) + magnitude[i];
+
+            while (localScale && res > 10.0)
+            {
+                res /= 10.0;
+
+                --localScale;
+            }
+        }
+
+        return res * GetSign();
+    }
+
     int32_t Decimal::GetScale() const
     {
-        return scale;
+        return scale & 0x7FFFFFFF;
+    }
+
+    int32_t Decimal::GetSign() const
+    {
+        return IsNegative() ? -1 : 1;
+    }
+
+    bool Decimal::IsNegative() const
+    {
+        return (scale & 0x80000000) != 0;
     }
 
     int32_t Decimal::GetLength() const
@@ -83,3 +114,4 @@ namespace ignite
         std::swap(first.magnitude, second.magnitude);
     }
 }
+

http://git-wip-us.apache.org/repos/asf/ignite/blob/d4547246/modules/platforms/cpp/odbc/odbc-driver/src/row.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/row.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/row.cpp
index 3a81b0a..c1ddcb1 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/row.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/row.cpp
@@ -186,7 +186,8 @@ namespace ignite
 
                 case IGNITE_HDR_NULL:
                 {
-                    // TODO: clear buffer here.
+                    dataBuf.PutNull();
+
                     break;
                 }
 
@@ -207,10 +208,20 @@ namespace ignite
                 }
 
                 case IGNITE_TYPE_DECIMAL:
+                {
+                    Decimal res;
+
+                    utility::ReadDecimal(reader, res);
+
+                    //dataBuf.putDecimal(res);
+
+                    break;
+                }
+
                 case IGNITE_TYPE_DATE:
                 default:
                 {
-                    // TODO: This is a fail case. Process it somehow.
+                    // This is a fail case. Return false.
                     return false;
                 }
             }
@@ -307,10 +318,18 @@ namespace ignite
                 }
 
                 case IGNITE_TYPE_DECIMAL:
+                {
+                    Decimal res;
+
+                    utility::ReadDecimal(reader, res);
+
+                    break;
+                }
+
                 case IGNITE_TYPE_DATE:
                 default:
                 {
-                    // TODO: This is a fail case. Process it somehow.
+                    // This is a fail case. Return false.
                     return false;
                 }
             }


[28/50] ignite git commit: IGNITE-1786: Fix for ODBC tests.

Posted by vo...@apache.org.
IGNITE-1786: Fix for ODBC tests.


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

Branch: refs/heads/ignite-1786
Commit: f132bad08f3d0650aca61a2704f573ac4ea562e2
Parents: 1877ace
Author: isapego <is...@gridgain.com>
Authored: Mon Jan 18 16:54:28 2016 +0300
Committer: isapego <is...@gridgain.com>
Committed: Mon Jan 18 16:54:28 2016 +0300

----------------------------------------------------------------------
 .../odbc/odbc-test/src/connection_info_test.cpp | 70 ++++++++++++++++++++
 1 file changed, 70 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/f132bad0/modules/platforms/cpp/odbc/odbc-test/src/connection_info_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-test/src/connection_info_test.cpp b/modules/platforms/cpp/odbc/odbc-test/src/connection_info_test.cpp
index b94996d..dd8d1f6 100644
--- a/modules/platforms/cpp/odbc/odbc-test/src/connection_info_test.cpp
+++ b/modules/platforms/cpp/odbc/odbc-test/src/connection_info_test.cpp
@@ -40,110 +40,180 @@ BOOST_AUTO_TEST_CASE(TestConnectionInfoSupportedInfo)
 
     SqlResult result;
 
+#ifdef SQL_DRIVER_NAME
     result = info.GetInfo(SQL_DRIVER_NAME, buffer, sizeof(buffer), &reslen);
     BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+#endif //SQL_DRIVER_NAME
 
+#ifdef SQL_DBMS_NAME
     result = info.GetInfo(SQL_DBMS_NAME, buffer, sizeof(buffer), &reslen);
     BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+#endif //SQL_DBMS_NAME
 
+#ifdef SQL_DRIVER_ODBC_VER
     result = info.GetInfo(SQL_DRIVER_ODBC_VER, buffer, sizeof(buffer), &reslen);
     BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+#endif //SQL_DRIVER_ODBC_VER
 
+#ifdef SQL_DBMS_VER
     result = info.GetInfo(SQL_DBMS_VER, buffer, sizeof(buffer), &reslen);
     BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+#endif //SQL_DBMS_VER
 
+#ifdef SQL_DRIVER_VER
     result = info.GetInfo(SQL_DRIVER_VER, buffer, sizeof(buffer), &reslen);
     BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+#endif //SQL_DRIVER_VER
 
+#ifdef SQL_COLUMN_ALIAS
     result = info.GetInfo(SQL_COLUMN_ALIAS, buffer, sizeof(buffer), &reslen);
     BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+#endif //SQL_COLUMN_ALIAS
 
+#ifdef SQL_IDENTIFIER_QUOTE_CHAR
     result = info.GetInfo(SQL_IDENTIFIER_QUOTE_CHAR, buffer, sizeof(buffer), &reslen);
     BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+#endif //SQL_IDENTIFIER_QUOTE_CHAR
 
+#ifdef SQL_CATALOG_NAME_SEPARATOR
     result = info.GetInfo(SQL_CATALOG_NAME_SEPARATOR, buffer, sizeof(buffer), &reslen);
     BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+#endif //SQL_CATALOG_NAME_SEPARATOR
 
+#ifdef SQL_SPECIAL_CHARACTERS
     result = info.GetInfo(SQL_SPECIAL_CHARACTERS, buffer, sizeof(buffer), &reslen);
     BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+#endif //SQL_SPECIAL_CHARACTERS
 
+#ifdef SQL_CATALOG_TERM
     result = info.GetInfo(SQL_CATALOG_TERM, buffer, sizeof(buffer), &reslen);
     BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+#endif //SQL_CATALOG_TERM
 
+#ifdef SQL_TABLE_TERM
     result = info.GetInfo(SQL_TABLE_TERM, buffer, sizeof(buffer), &reslen);
     BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+#endif //SQL_TABLE_TERM
 
+#ifdef SQL_SCHEMA_TERM
     result = info.GetInfo(SQL_SCHEMA_TERM, buffer, sizeof(buffer), &reslen);
     BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+#endif //SQL_SCHEMA_TERM
 
+#ifdef SQL_ASYNC_DBC_FUNCTIONS
     result = info.GetInfo(SQL_ASYNC_DBC_FUNCTIONS, buffer, sizeof(buffer), &reslen);
     BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+#endif //SQL_ASYNC_DBC_FUNCTIONS
 
+#ifdef SQL_GETDATA_EXTENSIONS
     result = info.GetInfo(SQL_GETDATA_EXTENSIONS, buffer, sizeof(buffer), &reslen);
     BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+#endif //SQL_GETDATA_EXTENSIONS
 
+#ifdef SQL_ODBC_INTERFACE_CONFORMANCE
     result = info.GetInfo(SQL_ODBC_INTERFACE_CONFORMANCE, buffer, sizeof(buffer), &reslen);
     BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+#endif //SQL_ODBC_INTERFACE_CONFORMANCE
 
+#ifdef SQL_SQL_CONFORMANCE
     result = info.GetInfo(SQL_SQL_CONFORMANCE, buffer, sizeof(buffer), &reslen);
     BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+#endif //SQL_SQL_CONFORMANCE
 
+#ifdef SQL_CATALOG_USAGE
     result = info.GetInfo(SQL_CATALOG_USAGE, buffer, sizeof(buffer), &reslen);
     BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+#endif //SQL_CATALOG_USAGE
 
+#ifdef SQL_SCHEMA_USAGE
     result = info.GetInfo(SQL_SCHEMA_USAGE, buffer, sizeof(buffer), &reslen);
     BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+#endif //SQL_SCHEMA_USAGE
 
+#ifdef SQL_MAX_IDENTIFIER_LEN
     result = info.GetInfo(SQL_MAX_IDENTIFIER_LEN, buffer, sizeof(buffer), &reslen);
     BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+#endif //SQL_MAX_IDENTIFIER_LEN
 
+#ifdef SQL_AGGREGATE_FUNCTIONS
     result = info.GetInfo(SQL_AGGREGATE_FUNCTIONS, buffer, sizeof(buffer), &reslen);
     BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+#endif //SQL_AGGREGATE_FUNCTIONS
 
+#ifdef SQL_AGGREGATE_FUNCTIONS
     result = info.GetInfo(SQL_NUMERIC_FUNCTIONS, buffer, sizeof(buffer), &reslen);
     BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+#endif //SQL_AGGREGATE_FUNCTIONS
 
+#ifdef SQL_STRING_FUNCTIONS
     result = info.GetInfo(SQL_STRING_FUNCTIONS, buffer, sizeof(buffer), &reslen);
     BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+#endif //SQL_STRING_FUNCTIONS
 
+#ifdef SQL_TIMEDATE_FUNCTIONS
     result = info.GetInfo(SQL_TIMEDATE_FUNCTIONS, buffer, sizeof(buffer), &reslen);
     BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+#endif //SQL_TIMEDATE_FUNCTIONS
 
+#ifdef SQL_TIMEDATE_ADD_INTERVALS
     result = info.GetInfo(SQL_TIMEDATE_ADD_INTERVALS, buffer, sizeof(buffer), &reslen);
     BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+#endif //SQL_TIMEDATE_ADD_INTERVALS
 
+#ifdef SQL_TIMEDATE_DIFF_INTERVALS
     result = info.GetInfo(SQL_TIMEDATE_DIFF_INTERVALS, buffer, sizeof(buffer), &reslen);
     BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+#endif //SQL_TIMEDATE_DIFF_INTERVALS
 
+#ifdef SQL_DATETIME_LITERALS
     result = info.GetInfo(SQL_DATETIME_LITERALS, buffer, sizeof(buffer), &reslen);
     BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+#endif //SQL_DATETIME_LITERALS
 
+#ifdef SQL_SYSTEM_FUNCTIONS
     result = info.GetInfo(SQL_SYSTEM_FUNCTIONS, buffer, sizeof(buffer), &reslen);
     BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+#endif //SQL_SYSTEM_FUNCTIONS
 
+#ifdef SQL_CONVERT_FUNCTIONS
     result = info.GetInfo(SQL_CONVERT_FUNCTIONS, buffer, sizeof(buffer), &reslen);
     BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+#endif //SQL_CONVERT_FUNCTIONS
 
+#ifdef SQL_OJ_CAPABILITIES
     result = info.GetInfo(SQL_OJ_CAPABILITIES, buffer, sizeof(buffer), &reslen);
     BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+#endif //SQL_OJ_CAPABILITIES
 
+#ifdef SQL_POS_OPERATIONS
     result = info.GetInfo(SQL_POS_OPERATIONS, buffer, sizeof(buffer), &reslen);
     BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+#endif //SQL_POS_OPERATIONS
 
+#ifdef SQL_MAX_CONCURRENT_ACTIVITIES
     result = info.GetInfo(SQL_MAX_CONCURRENT_ACTIVITIES, buffer, sizeof(buffer), &reslen);
     BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+#endif //SQL_MAX_CONCURRENT_ACTIVITIES
 
+#ifdef SQL_CURSOR_COMMIT_BEHAVIOR
     result = info.GetInfo(SQL_CURSOR_COMMIT_BEHAVIOR, buffer, sizeof(buffer), &reslen);
     BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+#endif //SQL_CURSOR_COMMIT_BEHAVIOR
 
+#ifdef SQL_CURSOR_ROLLBACK_BEHAVIOR
     result = info.GetInfo(SQL_CURSOR_ROLLBACK_BEHAVIOR, buffer, sizeof(buffer), &reslen);
     BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+#endif //SQL_CURSOR_ROLLBACK_BEHAVIOR
 
+#ifdef SQL_TXN_CAPABLE
     result = info.GetInfo(SQL_TXN_CAPABLE, buffer, sizeof(buffer), &reslen);
     BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+#endif //SQL_TXN_CAPABLE
 
+#ifdef SQL_QUOTED_IDENTIFIER_CASE
     result = info.GetInfo(SQL_QUOTED_IDENTIFIER_CASE, buffer, sizeof(buffer), &reslen);
     BOOST_REQUIRE(result == SQL_RESULT_SUCCESS);
+#endif //SQL_QUOTED_IDENTIFIER_CASE
 }
 
 BOOST_AUTO_TEST_SUITE_END()
\ No newline at end of file


[07/50] ignite git commit: IGNITE-2223: Implementation of Decimal type.

Posted by vo...@apache.org.
IGNITE-2223: Implementation of Decimal type.


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

Branch: refs/heads/ignite-1786
Commit: e5a2bfb62ea5ce3f8027ca55a15b3a516f845172
Parents: 2a1f1c0
Author: isapego <is...@gridgain.com>
Authored: Mon Jan 11 21:08:54 2016 +0300
Committer: isapego <is...@gridgain.com>
Committed: Mon Jan 11 21:08:54 2016 +0300

----------------------------------------------------------------------
 .../include/ignite/odbc/common_types.h          |  47 ++++++++
 .../odbc-driver/include/ignite/odbc/decimal.h   | 107 +++++++++++++++++++
 .../odbc-driver/project/vs/odbc-driver.vcxproj  |   2 +
 .../project/vs/odbc-driver.vcxproj.filters      |   6 ++
 .../cpp/odbc/odbc-driver/src/decimal.cpp        |  85 +++++++++++++++
 5 files changed, 247 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/e5a2bfb6/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/common_types.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/common_types.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/common_types.h
index f503654..c656fae 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/common_types.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/common_types.h
@@ -44,6 +44,9 @@ namespace ignite
 
         /**
          * Convert internal Ignite type into ODBC SQL return code.
+         *
+         * @param result Internal result type.
+         * @return ODBC result type.
          */
         int SqlResultToReturnCode(SqlResult result);
 
@@ -110,28 +113,72 @@ namespace ignite
             SQL_STATE_HYT01_CONNECTIOIN_TIMEOUT
         };
 
+        /**
+         * Diagnostic field type.
+         */
         enum DiagnosticField
         {
+            /** Header record field: Count of rows in the cursor. */
             IGNITE_SQL_DIAG_HEADER_CURSOR_ROW_COUNT,
+
+            /**
+             * Header record field: String that describes the SQL statement
+             * that the underlying function executed.
+             */
             IGNITE_SQL_DIAG_HEADER_DYNAMIC_FUNCTION,
+
+            /**
+             * Header record field: Numeric code that describes the SQL
+             * statement that was executed by the underlying function.
+             */
             IGNITE_SQL_DIAG_HEADER_DYNAMIC_FUNCTION_CODE,
+
+            /** Header record field: Number of status records. */
             IGNITE_SQL_DIAG_HEADER_NUMBER,
+
+            /** Header record field: Last operation return code. */
             IGNITE_SQL_DIAG_HEADER_RETURNCODE,
+
+            /** Header record field: Row count. */
             IGNITE_SQL_DIAG_HEADER_ROW_COUNT,
 
+            /** Status record field: Class origin. */
             IGNITE_SQL_DIAG_STATUS_CLASS_ORIGIN,
+
+            /** Status record field: Column number. */
             IGNITE_SQL_DIAG_STATUS_COLUMN_NUMBER,
+
+            /** Status record field: Connection name. */
             IGNITE_SQL_DIAG_STATUS_CONNECTION_NAME,
+
+            /** Status record field: Message text. */
             IGNITE_SQL_DIAG_STATUS_MESSAGE_TEXT,
+
+            /** Status record field: Native result code. */
             IGNITE_SQL_DIAG_STATUS_NATIVE,
+
+            /** Status record field: Row number. */
             IGNITE_SQL_DIAG_STATUS_ROW_NUMBER,
+
+            /** Status record field: Server name. */
             IGNITE_SQL_DIAG_STATUS_SERVER_NAME,
+
+            /** Status record field: SQLSTATE. */
             IGNITE_SQL_DIAG_STATUS_SQLSTATE,
+
+            /** Status record field: Subclass origin. */
             IGNITE_SQL_DIAG_STATUS_SUBCLASS_ORIGIN,
 
+            /** Field type is unknown to the driver. */
             IGNITE_SQL_DIAG_UNKNOWN
         };
 
+        /**
+         * Convert ODBC field type to internal DiagnosticField type value.
+         *
+         * @param field ODBC field type.
+         * @return Internal DiagnosticField type value.
+         */
         DiagnosticField DiagnosticFieldToInternal(int16_t field);
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/e5a2bfb6/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/decimal.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/decimal.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/decimal.h
new file mode 100644
index 0000000..7b5188b
--- /dev/null
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/decimal.h
@@ -0,0 +1,107 @@
+/*
+ * 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.
+ */
+
+#ifndef _IGNITE_DECIMAL
+#define _IGNITE_DECIMAL
+
+#include <stdint.h>
+
+namespace ignite
+{
+    //TODO: move to binary or common library.
+    class Decimal
+    {
+        friend void swap(Decimal& first, Decimal& second);
+    public:
+        /**
+         * Default constructor.
+         */
+        Decimal();
+
+        /**
+         * Constructor.
+         *
+         * @param scale Scale.
+         * @param mag Magnitude. Value is copied.
+         * @param len Magnitude length in bytes.
+         */
+        Decimal(int32_t scale, const int8_t* mag, int32_t len);
+
+        /**
+         * Copy constructor.
+         *
+         * @param other Other instance.
+         */
+        Decimal(const Decimal& other);
+
+        /**
+         * Destructor.
+         */
+        ~Decimal();
+
+        /**
+         * Copy operator.
+         *
+         * @param other Other instance.
+         * @return This.
+         */
+        Decimal& operator=(const Decimal& other);
+
+        /**
+         * Get scale.
+         *
+         * @return Scale.
+         */
+        int32_t GetScale() const;
+
+        /**
+         * Get magnitude length.
+         *
+         * @return Magnitude length.
+         */
+        int32_t GetLength() const;
+
+        /**
+         * Get magnitude pointer.
+         *
+         * @return Magnitude pointer.
+         */
+        const int8_t* GetMagnitude() const;
+
+    private:
+        /** Scale. */
+        int32_t scale;
+
+        /** Magnitude lenght. */
+        int32_t len;
+
+        /** Magnitude. */
+        int8_t* magnitude;
+    };
+
+    /**
+     * Swap function for the Decimal type.
+     *
+     * @param first First instance.
+     * @param second Second instance.
+     */
+    void swap(Decimal& first, Decimal& second);
+}
+
+
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/e5a2bfb6/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj b/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj
index 55587df..a85adf3 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj
+++ b/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj
@@ -157,6 +157,7 @@
     <ClCompile Include="..\..\src\config\connection_info.cpp" />
     <ClCompile Include="..\..\src\connection.cpp" />
     <ClCompile Include="..\..\src\cursor.cpp" />
+    <ClCompile Include="..\..\src\decimal.cpp" />
     <ClCompile Include="..\..\src\diagnostic\diagnosable_adapter.cpp" />
     <ClCompile Include="..\..\src\diagnostic\diagnostic_record.cpp" />
     <ClCompile Include="..\..\src\diagnostic\diagnostic_record_storage.cpp" />
@@ -186,6 +187,7 @@
     <ClInclude Include="..\..\include\ignite\odbc\config\connection_info.h" />
     <ClInclude Include="..\..\include\ignite\odbc\connection.h" />
     <ClInclude Include="..\..\include\ignite\odbc\cursor.h" />
+    <ClInclude Include="..\..\include\ignite\odbc\decimal.h" />
     <ClInclude Include="..\..\include\ignite\odbc\diagnostic\diagnosable.h" />
     <ClInclude Include="..\..\include\ignite\odbc\diagnostic\diagnosable_adapter.h" />
     <ClInclude Include="..\..\include\ignite\odbc\diagnostic\diagnostic_record.h" />

http://git-wip-us.apache.org/repos/asf/ignite/blob/e5a2bfb6/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj.filters
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj.filters b/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj.filters
index 9631946..650bfe4 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj.filters
+++ b/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj.filters
@@ -103,6 +103,9 @@
     <ClCompile Include="..\..\os\win\src\system\socket_client.cpp">
       <Filter>Code\system</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\src\decimal.cpp">
+      <Filter>Code</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <None Include="module.def">
@@ -201,5 +204,8 @@
     <ClInclude Include="..\..\include\ignite\odbc\system\socket_client.h">
       <Filter>Code\system</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\include\ignite\odbc\decimal.h">
+      <Filter>Code</Filter>
+    </ClInclude>
   </ItemGroup>
 </Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/e5a2bfb6/modules/platforms/cpp/odbc/odbc-driver/src/decimal.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/decimal.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/decimal.cpp
new file mode 100644
index 0000000..2df48d8
--- /dev/null
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/decimal.cpp
@@ -0,0 +1,85 @@
+/*
+ * 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.
+ */
+
+#include <cstring>
+#include <utility>
+
+#include "ignite/odbc/decimal.h"
+
+namespace ignite
+{
+
+    Decimal::Decimal() : 
+        scale(0), len(0), magnitude(0)
+    {
+    }
+
+    Decimal::Decimal(int32_t scale, const int8_t * mag, int32_t len) :
+        scale(scale), len(len), magnitude(0)
+    {
+        magnitude = new int8_t[len];
+
+        memcpy(magnitude, mag, len);
+    }
+
+    Decimal::Decimal(const Decimal & other) :
+        scale(other.scale), len(other.len), magnitude(0)
+    {
+        magnitude = new int8_t[len];
+
+        memcpy(magnitude, other.magnitude, len);
+    }
+
+    Decimal::~Decimal()
+    {
+        if (magnitude)
+            delete[] magnitude;
+    }
+
+    Decimal& Decimal::operator=(const Decimal& other)
+    {
+        Decimal tmp(other);
+
+        swap(tmp, *this);
+
+        return *this;
+    }
+
+    int32_t Decimal::GetScale() const
+    {
+        return scale;
+    }
+
+    int32_t Decimal::GetLength() const
+    {
+        return scale;
+    }
+
+    const int8_t * Decimal::GetMagnitude() const
+    {
+        return magnitude;
+    }
+
+    void swap(Decimal & first, Decimal & second)
+    {
+        using std::swap;
+
+        std::swap(first.scale, second.scale);
+        std::swap(first.len, second.len);
+        std::swap(first.magnitude, second.magnitude);
+    }
+}


[22/50] ignite git commit: IGNITE-1786: Better support for the x86.

Posted by vo...@apache.org.
IGNITE-1786: Better support for the x86.


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

Branch: refs/heads/ignite-1786
Commit: b0b2c907cb6cf31c5ba3f9d99dd365e6a4bf4026
Parents: 37de912
Author: isapego <is...@gridgain.com>
Authored: Fri Jan 15 16:26:57 2016 +0300
Committer: isapego <is...@gridgain.com>
Committed: Fri Jan 15 16:26:57 2016 +0300

----------------------------------------------------------------------
 .../ignite/odbc/app/application_data_buffer.h   | 13 ++---
 .../include/ignite/odbc/app/parameter.h         |  4 +-
 .../include/ignite/odbc/common_types.h          | 15 ++++--
 .../include/ignite/odbc/meta/column_meta.h      |  3 +-
 .../odbc-driver/include/ignite/odbc/statement.h |  4 +-
 .../odbc-driver/project/vs/odbc-driver.vcxproj  |  6 +--
 .../src/app/application_data_buffer.cpp         | 30 +++++------
 .../cpp/odbc/odbc-driver/src/app/parameter.cpp  |  2 +-
 .../cpp/odbc/odbc-driver/src/decimal.cpp        |  2 +-
 .../diagnostic/diagnostic_record_storage.cpp    |  2 +-
 .../odbc/odbc-driver/src/meta/column_meta.cpp   |  2 +-
 .../platforms/cpp/odbc/odbc-driver/src/odbc.cpp | 13 ++---
 .../src/query/column_metadata_query.cpp         |  2 +-
 .../odbc/odbc-driver/src/query/data_query.cpp   |  2 +-
 .../src/query/table_metadata_query.cpp          |  2 +-
 .../cpp/odbc/odbc-driver/src/statement.cpp      |  4 +-
 .../src/application_data_buffer_test.cpp        | 55 ++++++++++----------
 .../cpp/odbc/odbc-test/src/row_test.cpp         |  4 +-
 18 files changed, 88 insertions(+), 77 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/b0b2c907/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/app/application_data_buffer.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/app/application_data_buffer.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/app/application_data_buffer.h
index c2d4d1b..d77f598 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/app/application_data_buffer.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/app/application_data_buffer.h
@@ -25,6 +25,7 @@
 #include <ignite/guid.h>
 
 #include "ignite/odbc/decimal.h"
+#include "ignite/odbc/common_types.h"
 #include "ignite/odbc/type_traits.h"
 
 namespace ignite
@@ -53,7 +54,7 @@ namespace ignite
                  * @param reslen Resulting data length.
                  * @param offset Pointer to buffer and reslen offset pointer.
                  */
-                ApplicationDataBuffer(type_traits::IgniteSqlType type, void* buffer, int64_t buflen, int64_t* reslen, size_t** offset = 0);
+                ApplicationDataBuffer(type_traits::IgniteSqlType type, void* buffer, SqlLen buflen, SqlLen* reslen, size_t** offset = 0);
 
                 /**
                  * Copy constructor.
@@ -222,14 +223,14 @@ namespace ignite
                  *
                  * @return Data length pointer.
                  */
-                const int64_t* GetResLen() const;
+                const SqlLen* GetResLen() const;
 
                 /**
                  * Get buffer size in bytes.
                  *
                  * @return Buffer size.
                  */
-                int64_t GetSize() const
+                SqlLen GetSize() const
                 {
                     return buflen;
                 }
@@ -247,7 +248,7 @@ namespace ignite
                  *
                  * @return Data length pointer.
                  */
-                int64_t* GetResLen();
+                SqlLen* GetResLen();
 
                 /**
                  * Put value of numeric type in the buffer.
@@ -321,10 +322,10 @@ namespace ignite
                 void* buffer;
 
                 /** Buffer length. */
-                int64_t buflen;
+                SqlLen buflen;
 
                 /** Result length. */
-                int64_t* reslen;
+                SqlLen* reslen;
 
                 /** Pointer to implementation pointer to application offset */
                 size_t** offset;

http://git-wip-us.apache.org/repos/asf/ignite/blob/b0b2c907/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/app/parameter.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/app/parameter.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/app/parameter.h
index 2a274e1..8756f48 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/app/parameter.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/app/parameter.h
@@ -55,7 +55,7 @@ namespace ignite
                  * @param decDigits IPD decimal digits.
                  */
                 Parameter(const ApplicationDataBuffer& buffer, int16_t sqlType,
-                    uint64_t columnSize, int16_t decDigits);
+                    size_t columnSize, int16_t decDigits);
 
                 /**
                  * Copy constructor.
@@ -98,7 +98,7 @@ namespace ignite
                 int16_t sqlType;
 
                 /** IPD column size. */
-                uint64_t columnSize;
+                size_t columnSize;
 
                 /** IPD decimal digits. */
                 int16_t decDigits;

http://git-wip-us.apache.org/repos/asf/ignite/blob/b0b2c907/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/common_types.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/common_types.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/common_types.h
index 80562c5..1d007fb 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/common_types.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/common_types.h
@@ -24,6 +24,13 @@ namespace ignite
 {
     namespace odbc
     {
+
+#ifdef _WIN64
+        typedef long long SqlLen;
+#else
+        typedef long SqlLen;
+#endif
+
         /**
          * SQL result.
          */
@@ -43,8 +50,8 @@ namespace ignite
         };
 
         /**
-        * Provides detailed information about the cause of a warning or error.
-        */
+         * Provides detailed information about the cause of a warning or error.
+         */
         enum SqlState
         {
             /** Undefined state. Internal, should never be exposed to user. */
@@ -106,8 +113,8 @@ namespace ignite
         };
 
         /**
-        * Diagnostic field type.
-        */
+         * Diagnostic field type.
+         */
         enum DiagnosticField
         {
             /** Header record field: Count of rows in the cursor. */

http://git-wip-us.apache.org/repos/asf/ignite/blob/b0b2c907/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/meta/column_meta.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/meta/column_meta.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/meta/column_meta.h
index ccea0ae..e90070e 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/meta/column_meta.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/meta/column_meta.h
@@ -23,6 +23,7 @@
 
 #include "ignite/impl/binary/binary_reader_impl.h"
 
+#include "ignite/odbc/common_types.h"
 #include "ignite/odbc/utility.h"
 
 namespace ignite
@@ -174,7 +175,7 @@ namespace ignite
                  * @param value Output attribute value.
                  * @return True if the attribute supported and false otherwise.
                  */
-                bool GetAttribute(uint16_t fieldId, int64_t& value) const;
+                bool GetAttribute(uint16_t fieldId, SqlLen& value) const;
 
             private:
                 /** Schema name. */

http://git-wip-us.apache.org/repos/asf/ignite/blob/b0b2c907/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/statement.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/statement.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/statement.h
index a42da26..2449e07 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/statement.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/statement.h
@@ -268,7 +268,7 @@ namespace ignite
              * @param numbuf Numeric value buffer.
              */
             void GetColumnAttribute(uint16_t colIdx, uint16_t attrId, char* strbuf,
-                int16_t buflen, int16_t* reslen, int64_t* numbuf);
+                int16_t buflen, int16_t* reslen, SqlLen* numbuf);
 
             /**
              * Get number of rows affected by the statement.
@@ -429,7 +429,7 @@ namespace ignite
              * @return Operation result.
              */
             SqlResult InternalGetColumnAttribute(uint16_t colIdx, uint16_t attrId,
-                char* strbuf, int16_t buflen, int16_t* reslen, int64_t* numbuf);
+                char* strbuf, int16_t buflen, int16_t* reslen, SqlLen* numbuf);
 
             /**
              * Get number of rows affected by the statement.

http://git-wip-us.apache.org/repos/asf/ignite/blob/b0b2c907/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj b/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj
index 925b1b9..2f48e8d 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj
+++ b/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj
@@ -25,13 +25,13 @@
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <PlatformToolset>v100</PlatformToolset>
     <CharacterSet>MultiByte</CharacterSet>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
     <PlatformToolset>v100</PlatformToolset>
     <WholeProgramOptimization>true</WholeProgramOptimization>
@@ -44,7 +44,7 @@
     <CharacterSet>MultiByte</CharacterSet>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
     <PlatformToolset>v100</PlatformToolset>
     <WholeProgramOptimization>true</WholeProgramOptimization>

http://git-wip-us.apache.org/repos/asf/ignite/blob/b0b2c907/modules/platforms/cpp/odbc/odbc-driver/src/app/application_data_buffer.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/app/application_data_buffer.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/app/application_data_buffer.cpp
index 3a3d061..5096820 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/app/application_data_buffer.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/app/application_data_buffer.cpp
@@ -36,7 +36,7 @@ namespace ignite
             }
 
             ApplicationDataBuffer::ApplicationDataBuffer(type_traits::IgniteSqlType type, 
-                void* buffer, int64_t buflen, int64_t* reslen, size_t** offset) :
+                void* buffer, SqlLen buflen, SqlLen* reslen, size_t** offset) :
                 type(type), buffer(buffer), buflen(buflen), reslen(reslen), offset(offset)
             {
                 // No-op.
@@ -178,7 +178,7 @@ namespace ignite
                             }
                             else
                             {
-                                memcpy(GetData(), &value, buflen);
+                                memcpy(GetData(), &value, static_cast<size_t>(buflen));
 
                                 if (GetResLen())
                                     *GetResLen() = SQL_NO_TOTAL;
@@ -236,7 +236,7 @@ namespace ignite
             template<typename OutCharT, typename InCharT>
             void ApplicationDataBuffer::PutStrToStrBuffer(const std::basic_string<InCharT>& value)
             {
-                int64_t charSize = static_cast<int64_t>(sizeof(OutCharT));
+                SqlLen charSize = static_cast<SqlLen>(sizeof(OutCharT));
 
                 if (GetData())
                 {
@@ -244,11 +244,11 @@ namespace ignite
                     {
                         OutCharT* out = reinterpret_cast<OutCharT*>(GetData());
 
-                        int64_t outLen = (buflen / charSize) - 1;
+                        SqlLen outLen = (buflen / charSize) - 1;
 
-                        int64_t toCopy = std::min<int64_t>(outLen, value.size());
+                        SqlLen toCopy = std::min<size_t>(outLen, value.size());
 
-                        for (int64_t i = 0; i < toCopy; ++i)
+                        for (SqlLen i = 0; i < toCopy; ++i)
                             out[i] = value[i];
 
                         out[toCopy] = 0;
@@ -256,8 +256,8 @@ namespace ignite
 
                     if (GetResLen())
                     {
-                        if (buflen >= static_cast<int64_t>((value.size() + 1) * charSize))
-                            *GetResLen() = value.size();
+                        if (buflen >= static_cast<SqlLen>((value.size() + 1) * charSize))
+                            *GetResLen() = static_cast<SqlLen>(value.size());
                         else
                             *GetResLen() = SQL_NO_TOTAL;
                     }
@@ -268,11 +268,11 @@ namespace ignite
 
             void ApplicationDataBuffer::PutRawDataToBuffer(void *data, size_t len)
             {
-                int64_t ilen = static_cast<int64_t>(len);
+                SqlLen ilen = static_cast<SqlLen>(len);
 
                 if (GetData())
                 {
-                    int64_t toCopy = std::min(buflen, ilen);
+                    size_t toCopy = static_cast<size_t>(std::min(buflen, ilen));
 
                     memcpy(GetData(), data, toCopy);
 
@@ -532,7 +532,7 @@ namespace ignite
                     case IGNITE_ODBC_C_TYPE_DEFAULT:
                     {
                         if (GetData())
-                            memcpy(GetData(), &value, std::min<size_t>(buflen, sizeof(value)));
+                            memcpy(GetData(), &value, std::min(static_cast<size_t>(buflen), sizeof(value)));
 
                         if (GetResLen())
                             *GetResLen() = sizeof(value);
@@ -559,7 +559,7 @@ namespace ignite
                     case IGNITE_ODBC_C_TYPE_CHAR:
                     {
                         res.assign(reinterpret_cast<const char*>(GetData()),
-                                   std::min<size_t>(maxLen, buflen));
+                                   std::min(maxLen, static_cast<size_t>(buflen)));
                         break;
                     }
 
@@ -657,7 +657,7 @@ namespace ignite
                 return ApplyOffset(buffer);
             }
 
-            const int64_t* ApplicationDataBuffer::GetResLen() const
+            const SqlLen* ApplicationDataBuffer::GetResLen() const
             {
                 return ApplyOffset(reslen);
             }
@@ -667,7 +667,7 @@ namespace ignite
                 return ApplyOffset(buffer);
             }
 
-            int64_t* ApplicationDataBuffer::GetResLen()
+            SqlLen* ApplicationDataBuffer::GetResLen()
             {
                 return ApplyOffset(reslen);
             }
@@ -683,7 +683,7 @@ namespace ignite
                 {
                     case IGNITE_ODBC_C_TYPE_CHAR:
                     {
-                        std::string str = GetString(buflen);
+                        std::string str = GetString(static_cast<size_t>(buflen));
 
                         std::stringstream converter(str);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/b0b2c907/modules/platforms/cpp/odbc/odbc-driver/src/app/parameter.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/app/parameter.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/app/parameter.cpp
index d390569..dbe33e1 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/app/parameter.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/app/parameter.cpp
@@ -39,7 +39,7 @@ namespace ignite
             }
 
             Parameter::Parameter(const ApplicationDataBuffer& buffer, int16_t sqlType, 
-                uint64_t columnSize, int16_t decDigits) :
+                size_t columnSize, int16_t decDigits) :
                 buffer(buffer),
                 sqlType(sqlType),
                 columnSize(columnSize),

http://git-wip-us.apache.org/repos/asf/ignite/blob/b0b2c907/modules/platforms/cpp/odbc/odbc-driver/src/decimal.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/decimal.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/decimal.cpp
index f88534b..0fa37fb 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/decimal.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/decimal.cpp
@@ -65,7 +65,7 @@ namespace ignite
 
         int32_t localScale = GetScale();
         
-        for (size_t i = 0; i < len; ++i)
+        for (int32_t i = 0; i < len; ++i)
         {
             res = (res * 256) + magnitude[i];
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/b0b2c907/modules/platforms/cpp/odbc/odbc-driver/src/diagnostic/diagnostic_record_storage.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/diagnostic/diagnostic_record_storage.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/diagnostic/diagnostic_record_storage.cpp
index 52ac414..90c0a4f 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/diagnostic/diagnostic_record_storage.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/diagnostic/diagnostic_record_storage.cpp
@@ -159,7 +159,7 @@ namespace ignite
                         break;
                 }
 
-                if (recNum < 1 || recNum > statusRecords.size())
+                if (recNum < 1 || static_cast<size_t>(recNum) > statusRecords.size())
                     return SQL_RESULT_NO_DATA;
 
                 // Status record.

http://git-wip-us.apache.org/repos/asf/ignite/blob/b0b2c907/modules/platforms/cpp/odbc/odbc-driver/src/meta/column_meta.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/meta/column_meta.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/meta/column_meta.cpp
index b0d5015..ab12aad 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/meta/column_meta.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/meta/column_meta.cpp
@@ -143,7 +143,7 @@ namespace ignite
                 }
             }
 
-            bool ColumnMeta::GetAttribute(uint16_t fieldId, int64_t& value) const
+            bool ColumnMeta::GetAttribute(uint16_t fieldId, SqlLen& value) const
             {
                 using namespace ignite::impl::binary;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/b0b2c907/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp
index b819744..6b2f4ae 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp
@@ -781,6 +781,7 @@ SQLRETURN SQL_API SQLDescribeCol(SQLHSTMT       stmt,
                                  SQLSMALLINT*   nullable)
 {
     using ignite::odbc::Statement;
+    using ignite::odbc::SqlLen;
 
     LOG_MSG("SQLDescribeCol called\n");
 
@@ -792,10 +793,10 @@ SQLRETURN SQL_API SQLDescribeCol(SQLHSTMT       stmt,
     statement->GetColumnAttribute(columnNum, SQL_DESC_NAME,
         reinterpret_cast<char*>(columnNameBuf), columnNameBufLen, columnNameLen, 0);
 
-    int64_t dataTypeRes;
-    int64_t columnSizeRes;
-    int64_t decimalDigitsRes;
-    int64_t nullableRes;
+    SqlLen dataTypeRes;
+    SqlLen columnSizeRes;
+    SqlLen decimalDigitsRes;
+    SqlLen nullableRes;
 
     statement->GetColumnAttribute(columnNum, SQL_DESC_TYPE, 0, 0, 0, &dataTypeRes);
     statement->GetColumnAttribute(columnNum, SQL_DESC_PRECISION, 0, 0, 0, &columnSizeRes);
@@ -1102,7 +1103,7 @@ SQLRETURN SQL_API SQLGetDiagField(SQLSMALLINT   handleType,
 
     LOG_MSG("SQLGetDiagField called: %d\n", recNum);
 
-    int64_t outResLen;
+    SqlLen outResLen;
     ApplicationDataBuffer outBuffer(IGNITE_ODBC_C_TYPE_DEFAULT, buffer, bufferLen, &outResLen);
 
     SqlResult result;
@@ -1183,7 +1184,7 @@ SQLRETURN SQL_API SQLGetDiagRec(SQLSMALLINT     handleType,
     if (nativeError)
         *nativeError = 0;
 
-    int64_t outResLen;
+    SqlLen outResLen;
     ApplicationDataBuffer outBuffer(IGNITE_ODBC_C_TYPE_CHAR, msgBuffer, msgBufferLen, &outResLen);
 
     outBuffer.PutString(record.GetMessage());

http://git-wip-us.apache.org/repos/asf/ignite/blob/b0b2c907/modules/platforms/cpp/odbc/odbc-driver/src/query/column_metadata_query.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/query/column_metadata_query.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/query/column_metadata_query.cpp
index a4db450..083b367 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/query/column_metadata_query.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/query/column_metadata_query.cpp
@@ -286,7 +286,7 @@ namespace ignite
 
                 meta = rsp.GetMeta();
 
-                for (int i = 0; i < meta.size(); ++i)
+                for (size_t i = 0; i < meta.size(); ++i)
                 {
                     LOG_MSG("[%d] SchemaName:     %s\n", i, meta[i].GetSchemaName().c_str());
                     LOG_MSG("[%d] TableName:      %s\n", i, meta[i].GetTableName().c_str());

http://git-wip-us.apache.org/repos/asf/ignite/blob/b0b2c907/modules/platforms/cpp/odbc/odbc-driver/src/query/data_query.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/query/data_query.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/query/data_query.cpp
index 187ed65..b630993 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/query/data_query.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/query/data_query.cpp
@@ -174,7 +174,7 @@ namespace ignite
 
                 LOG_MSG("Query id: %lld\n", cursor->GetQueryId());
 
-                for (int i = 0; i < rsp.GetMeta().size(); ++i)
+                for (size_t i = 0; i < rsp.GetMeta().size(); ++i)
                 {
                     LOG_MSG("[%d] SchemaName:     %s\n", i, rsp.GetMeta()[i].GetSchemaName().c_str());
                     LOG_MSG("[%d] TypeName:       %s\n", i, rsp.GetMeta()[i].GetTableName().c_str());

http://git-wip-us.apache.org/repos/asf/ignite/blob/b0b2c907/modules/platforms/cpp/odbc/odbc-driver/src/query/table_metadata_query.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/query/table_metadata_query.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/query/table_metadata_query.cpp
index d381ee4..5375515 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/query/table_metadata_query.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/query/table_metadata_query.cpp
@@ -212,7 +212,7 @@ namespace ignite
 
                 meta = rsp.GetMeta();
 
-                for (int i = 0; i < meta.size(); ++i)
+                for (size_t i = 0; i < meta.size(); ++i)
                 {
                     LOG_MSG("[%d] CatalogName: %s\n", i, meta[i].GetCatalogName().c_str());
                     LOG_MSG("[%d] SchemaName:  %s\n", i, meta[i].GetSchemaName().c_str());

http://git-wip-us.apache.org/repos/asf/ignite/blob/b0b2c907/modules/platforms/cpp/odbc/odbc-driver/src/statement.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/statement.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/statement.cpp
index 506afcd..e31d75a 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/statement.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/statement.cpp
@@ -393,7 +393,7 @@ namespace ignite
         }
 
         void Statement::GetColumnAttribute(uint16_t colIdx, uint16_t attrId,
-            char* strbuf, int16_t buflen, int16_t* reslen, int64_t* numbuf)
+            char* strbuf, int16_t buflen, int16_t* reslen, SqlLen* numbuf)
         {
             IGNITE_ODBC_API_CALL(InternalGetColumnAttribute(colIdx, attrId,
                 strbuf, buflen, reslen, numbuf));
@@ -401,7 +401,7 @@ namespace ignite
 
         SqlResult Statement::InternalGetColumnAttribute(uint16_t colIdx,
             uint16_t attrId, char* strbuf, int16_t buflen, int16_t* reslen,
-            int64_t* numbuf)
+            SqlLen* numbuf)
         {
             const meta::ColumnMetaVector *meta = GetMeta();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/b0b2c907/modules/platforms/cpp/odbc/odbc-test/src/application_data_buffer_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-test/src/application_data_buffer_test.cpp b/modules/platforms/cpp/odbc/odbc-test/src/application_data_buffer_test.cpp
index 8194dad..632f05f 100644
--- a/modules/platforms/cpp/odbc/odbc-test/src/application_data_buffer_test.cpp
+++ b/modules/platforms/cpp/odbc/odbc-test/src/application_data_buffer_test.cpp
@@ -28,6 +28,7 @@
 #define FLOAT_PRECISION 0.0000001f
 
 using namespace ignite;
+using namespace ignite::odbc;
 using namespace ignite::odbc::app;
 using namespace ignite::odbc::type_traits;
 
@@ -36,7 +37,7 @@ BOOST_AUTO_TEST_SUITE(ApplicationDataBufferTestSuite)
 BOOST_AUTO_TEST_CASE(TestPutIntToString)
 {
     char buffer[1024];
-    int64_t reslen;
+    SqlLen reslen;
     size_t* offset = 0;
 
     ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_CHAR, buffer, sizeof(buffer), &reslen, &offset);
@@ -69,7 +70,7 @@ BOOST_AUTO_TEST_CASE(TestPutIntToString)
 BOOST_AUTO_TEST_CASE(TestPutFloatToString)
 {
     char buffer[1024];
-    int64_t reslen;
+    SqlLen reslen;
     size_t* offset = 0;
 
     ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_CHAR, buffer, sizeof(buffer), &reslen, &offset);
@@ -94,7 +95,7 @@ BOOST_AUTO_TEST_CASE(TestPutFloatToString)
 BOOST_AUTO_TEST_CASE(TestPutGuidToString)
 {
     char buffer[1024];
-    int64_t reslen;
+    SqlLen reslen;
     size_t* offset = 0;
 
     ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_CHAR, buffer, sizeof(buffer), &reslen, &offset);
@@ -110,7 +111,7 @@ BOOST_AUTO_TEST_CASE(TestPutGuidToString)
 BOOST_AUTO_TEST_CASE(TestPutBinaryToString)
 {
     char buffer[1024];
-    int64_t reslen;
+    SqlLen reslen;
     size_t* offset = 0;
 
     ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_CHAR, buffer, sizeof(buffer), &reslen, &offset);
@@ -126,7 +127,7 @@ BOOST_AUTO_TEST_CASE(TestPutBinaryToString)
 BOOST_AUTO_TEST_CASE(TestPutStringToString)
 {
     char buffer[1024];
-    int64_t reslen;
+    SqlLen reslen;
     size_t* offset = 0;
 
     ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_CHAR, buffer, sizeof(buffer), &reslen, &offset);
@@ -142,7 +143,7 @@ BOOST_AUTO_TEST_CASE(TestPutStringToString)
 BOOST_AUTO_TEST_CASE(TestPutStringToWstring)
 {
     wchar_t buffer[1024];
-    int64_t reslen;
+    SqlLen reslen;
     size_t* offset = 0;
 
     ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_WCHAR, buffer, sizeof(buffer), &reslen, &offset);
@@ -156,7 +157,7 @@ BOOST_AUTO_TEST_CASE(TestPutStringToWstring)
 BOOST_AUTO_TEST_CASE(TestPutStringToLong)
 {
     long numBuf;
-    int64_t reslen;
+    SqlLen reslen;
     size_t* offset = 0;
 
     ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_SIGNED_LONG, &numBuf, sizeof(numBuf), &reslen, &offset);
@@ -171,7 +172,7 @@ BOOST_AUTO_TEST_CASE(TestPutStringToLong)
 BOOST_AUTO_TEST_CASE(TestPutStringToTiny)
 {
     int8_t numBuf;
-    int64_t reslen;
+    SqlLen reslen;
     size_t* offset = 0;
 
     ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_SIGNED_TINYINT, &numBuf, sizeof(numBuf), &reslen, &offset);
@@ -186,7 +187,7 @@ BOOST_AUTO_TEST_CASE(TestPutStringToTiny)
 BOOST_AUTO_TEST_CASE(TestPutStringToFloat)
 {
     float numBuf;
-    int64_t reslen;
+    SqlLen reslen;
     size_t* offset = 0;
 
     ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_FLOAT, &numBuf, sizeof(numBuf), &reslen, &offset);
@@ -201,7 +202,7 @@ BOOST_AUTO_TEST_CASE(TestPutStringToFloat)
 BOOST_AUTO_TEST_CASE(TestPutIntToFloat)
 {
     float numBuf;
-    int64_t reslen;
+    SqlLen reslen;
     size_t* offset = 0;
 
     ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_FLOAT, &numBuf, sizeof(numBuf), &reslen, &offset);
@@ -228,7 +229,7 @@ BOOST_AUTO_TEST_CASE(TestPutIntToFloat)
 BOOST_AUTO_TEST_CASE(TestPutFloatToShort)
 {
     short numBuf;
-    int64_t reslen;
+    SqlLen reslen;
     size_t* offset = 0;
 
     ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_SIGNED_SHORT, &numBuf, sizeof(numBuf), &reslen, &offset);
@@ -249,7 +250,7 @@ BOOST_AUTO_TEST_CASE(TestPutFloatToShort)
 BOOST_AUTO_TEST_CASE(TestPutDecimalToDouble)
 {
     double numBuf;
-    int64_t reslen;
+    SqlLen reslen;
 
     ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_DOUBLE, &numBuf, sizeof(numBuf), &reslen, 0);
 
@@ -278,7 +279,7 @@ BOOST_AUTO_TEST_CASE(TestPutDecimalToDouble)
 BOOST_AUTO_TEST_CASE(TestPutDecimalToLong)
 {
     long numBuf;
-    int64_t reslen;
+    SqlLen reslen;
 
     ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_SIGNED_LONG, &numBuf, sizeof(numBuf), &reslen, 0);
 
@@ -305,7 +306,7 @@ BOOST_AUTO_TEST_CASE(TestPutDecimalToLong)
 BOOST_AUTO_TEST_CASE(TestPutDecimalToString)
 {
     char strBuf[64];
-    int64_t reslen;
+    SqlLen reslen;
 
     ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_CHAR, &strBuf, sizeof(strBuf), &reslen, 0);
 
@@ -332,7 +333,7 @@ BOOST_AUTO_TEST_CASE(TestPutDecimalToString)
 BOOST_AUTO_TEST_CASE(TestGetStringFromLong)
 {
     long numBuf = 42;
-    int64_t reslen = sizeof(numBuf);
+    SqlLen reslen = sizeof(numBuf);
     size_t* offset = 0;
 
     ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_SIGNED_LONG, &numBuf, reslen, &reslen, &offset);
@@ -351,7 +352,7 @@ BOOST_AUTO_TEST_CASE(TestGetStringFromLong)
 BOOST_AUTO_TEST_CASE(TestGetStringFromDouble)
 {
     double numBuf = 43.36;
-    int64_t reslen = sizeof(numBuf);
+    SqlLen reslen = sizeof(numBuf);
     size_t* offset = 0;
 
     ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_DOUBLE, &numBuf, reslen, &reslen, &offset);
@@ -370,7 +371,7 @@ BOOST_AUTO_TEST_CASE(TestGetStringFromDouble)
 BOOST_AUTO_TEST_CASE(TestGetStringFromString)
 {
     char buf[] = "Some data 32d2d5hs";
-    int64_t reslen = sizeof(buf);
+    SqlLen reslen = sizeof(buf);
     size_t* offset = 0;
 
     ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_CHAR, &buf, reslen, &reslen, &offset);
@@ -383,7 +384,7 @@ BOOST_AUTO_TEST_CASE(TestGetStringFromString)
 BOOST_AUTO_TEST_CASE(TestGetFloatFromUshort)
 {
     unsigned short numBuf = 7162;
-    int64_t reslen = sizeof(numBuf);
+    SqlLen reslen = sizeof(numBuf);
     size_t* offset = 0;
 
     ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_UNSIGNED_SHORT, &numBuf, reslen, &reslen, &offset);
@@ -400,7 +401,7 @@ BOOST_AUTO_TEST_CASE(TestGetFloatFromUshort)
 BOOST_AUTO_TEST_CASE(TestGetFloatFromString)
 {
     char buf[] = "28.562";
-    int64_t reslen = sizeof(buf);
+    SqlLen reslen = sizeof(buf);
     size_t* offset = 0;
 
     ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_CHAR, &buf, reslen, &reslen, &offset);
@@ -417,7 +418,7 @@ BOOST_AUTO_TEST_CASE(TestGetFloatFromString)
 BOOST_AUTO_TEST_CASE(TestGetFloatFromFloat)
 {
     float buf = 207.49f;
-    int64_t reslen = sizeof(buf);
+    SqlLen reslen = sizeof(buf);
     size_t* offset = 0;
 
     ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_FLOAT, &buf, reslen, &reslen, &offset);
@@ -434,7 +435,7 @@ BOOST_AUTO_TEST_CASE(TestGetFloatFromFloat)
 BOOST_AUTO_TEST_CASE(TestGetFloatFromDouble)
 {
     double buf = 893.162;
-    int64_t reslen = sizeof(buf);
+    SqlLen reslen = sizeof(buf);
     size_t* offset = 0;
 
     ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_DOUBLE, &buf, reslen, &reslen, &offset);
@@ -451,7 +452,7 @@ BOOST_AUTO_TEST_CASE(TestGetFloatFromDouble)
 BOOST_AUTO_TEST_CASE(TestGetIntFromString)
 {
     char buf[] = "39";
-    int64_t reslen = sizeof(buf);
+    SqlLen reslen = sizeof(buf);
     size_t* offset = 0;
 
     ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_CHAR, &buf, reslen, &reslen, &offset);
@@ -476,7 +477,7 @@ BOOST_AUTO_TEST_CASE(TestGetIntFromString)
 BOOST_AUTO_TEST_CASE(TestGetIntFromFloat)
 {
     float buf = -107.49f;
-    int64_t reslen = sizeof(buf);
+    SqlLen reslen = sizeof(buf);
     size_t* offset = 0;
 
     ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_FLOAT, &buf, reslen, &reslen, &offset);
@@ -501,7 +502,7 @@ BOOST_AUTO_TEST_CASE(TestGetIntFromFloat)
 BOOST_AUTO_TEST_CASE(TestGetIntFromDouble)
 {
     double buf = 42.97f;
-    int64_t reslen = sizeof(buf);
+    SqlLen reslen = sizeof(buf);
     size_t* offset = 0;
 
     ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_DOUBLE, &buf, reslen, &reslen, &offset);
@@ -526,7 +527,7 @@ BOOST_AUTO_TEST_CASE(TestGetIntFromDouble)
 BOOST_AUTO_TEST_CASE(TestGetIntFromBigint)
 {
     uint64_t buf = 19;
-    int64_t reslen = sizeof(buf);
+    SqlLen reslen = sizeof(buf);
     size_t* offset = 0;
 
     ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_UNSIGNED_BIGINT, &buf, reslen, &reslen, &offset);
@@ -553,7 +554,7 @@ BOOST_AUTO_TEST_CASE(TestGetIntWithOffset)
     struct TestStruct
     {
         uint64_t val;
-        int64_t reslen;
+        SqlLen reslen;
     };
 
     TestStruct buf[2] = {
@@ -588,7 +589,7 @@ BOOST_AUTO_TEST_CASE(TestSetStringWithOffset)
     struct TestStruct
     {
         char val[64];
-        int64_t reslen;
+        SqlLen reslen;
     };
 
     TestStruct buf[2] = {

http://git-wip-us.apache.org/repos/asf/ignite/blob/b0b2c907/modules/platforms/cpp/odbc/odbc-test/src/row_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-test/src/row_test.cpp b/modules/platforms/cpp/odbc/odbc-test/src/row_test.cpp
index 031a8c6..a0eed39 100644
--- a/modules/platforms/cpp/odbc/odbc-test/src/row_test.cpp
+++ b/modules/platforms/cpp/odbc/odbc-test/src/row_test.cpp
@@ -75,7 +75,7 @@ void FillMemWithData(ignite::impl::interop::InteropUnpooledMemory& mem, size_t r
 
 void CheckRowData(Row& row, size_t rowIdx)
 {
-    int64_t reslen;
+    SqlLen reslen;
 
     long longBuf;
     char strBuf[1024];
@@ -158,7 +158,7 @@ BOOST_AUTO_TEST_CASE(TestRowSkip)
     {
         BOOST_REQUIRE(row.GetSize() == 4);
 
-        for (size_t j = 0; j < row.GetSize(); ++j)
+        for (int32_t j = 0; j < row.GetSize(); ++j)
             BOOST_REQUIRE(row.SkipColumn());
 
         BOOST_REQUIRE(row.MoveToNext());


[35/50] ignite git commit: IGNITE-2243: Implemented SQLSetEnvAttr.

Posted by vo...@apache.org.
IGNITE-2243: Implemented SQLSetEnvAttr.


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

Branch: refs/heads/ignite-1786
Commit: 6c18d64daeb82ceb62c2d1744dd4d2490657d922
Parents: 4b25500
Author: isapego <is...@gridgain.com>
Authored: Wed Jan 20 20:20:51 2016 +0300
Committer: isapego <is...@gridgain.com>
Committed: Wed Jan 20 20:20:51 2016 +0300

----------------------------------------------------------------------
 .../include/ignite/odbc/environment.h           | 19 ++++++++
 .../odbc-driver/include/ignite/odbc/utility.h   |  2 +-
 .../odbc-driver/project/vs/odbc-driver.vcxproj  |  8 ++--
 .../cpp/odbc/odbc-driver/src/environment.cpp    | 28 ++++++++----
 .../platforms/cpp/odbc/odbc-driver/src/odbc.cpp | 48 ++++++++++++--------
 5 files changed, 72 insertions(+), 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/6c18d64d/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/environment.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/environment.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/environment.h
index 14d3613..4fff8d2 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/environment.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/environment.h
@@ -59,6 +59,15 @@ namespace ignite
              */
             void TransactionRollback();
 
+            /**
+             * Set attribute.
+             *
+             * @param attr Attribute to set.
+             * @param value Value.
+             * @param len Value length if the attribute is of string type.
+             */
+            void SetAttribute(int32_t attr, void* value, int32_t len);
+
         private:
             IGNITE_NO_COPY_ASSIGNMENT(Environment);
 
@@ -86,6 +95,16 @@ namespace ignite
              * @return Operation result.
              */
             SqlResult InternalTransactionRollback();
+            
+            /**
+             * Set attribute.
+             *
+             * @param attr Attribute to set.
+             * @param value Value.
+             * @param len Value length if the attribute is of string type.
+             * @return Operation result.
+             */
+            SqlResult InternalSetAttribute(int32_t attr, void* value, int32_t len);
         };
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/6c18d64d/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/utility.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/utility.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/utility.h
index 922e5e2..4a2e928 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/utility.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/utility.h
@@ -41,7 +41,7 @@ void logInit(const char*);
 
 #   define LOG_MSG(fmt, ...)                                        \
     do {                                                            \
-        logInit(ODBC_LOG_PATH);                                    \
+        logInit(ODBC_LOG_PATH);                                     \
         fprintf(log_file, "%s: " fmt, __FUNCTION__, __VA_ARGS__);   \
         fflush(log_file);                                           \
     } while (false)

http://git-wip-us.apache.org/repos/asf/ignite/blob/6c18d64d/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj b/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj
index 5f151e4..cff9f3f 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj
+++ b/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj
@@ -90,7 +90,7 @@
       <Optimization>Disabled</Optimization>
       <SDLCheck>false</SDLCheck>
       <AdditionalIncludeDirectories>$(ProjectDir)\..\..\..\..\common\include;$(ProjectDir)\..\..\..\..\common\os\win\include;$(ProjectDir)\..\..\src;$(ProjectDir)\..\..\os\win;$(ProjectDir)\..\..\..\..\binary\include;$(ProjectDir)\..\..\..\..\binary\os\win\include;$(ProjectDir)\..\..\include</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;IGNITE_FRIEND;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;IGNITE_FRIEND;ODBC_DEBUG;ODBC_LOG_PATH="D:\\odbc.log";_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
     <Link>
       <GenerateDebugInformation>true</GenerateDebugInformation>
@@ -104,7 +104,7 @@
       <Optimization>Disabled</Optimization>
       <SDLCheck>false</SDLCheck>
       <AdditionalIncludeDirectories>$(ProjectDir)\..\..\..\..\common\include;$(ProjectDir)\..\..\..\..\common\os\win\include;$(ProjectDir)\..\..\src;$(ProjectDir)\..\..\os\win;$(ProjectDir)\..\..\..\..\binary\include;$(ProjectDir)\..\..\..\..\binary\os\win\include;$(ProjectDir)\..\..\include</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;IGNITE_FRIEND;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;IGNITE_FRIEND;ODBC_DEBUG;ODBC_LOG_PATH="D:\\odbc.log";_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
     <Link>
       <GenerateDebugInformation>true</GenerateDebugInformation>
@@ -120,7 +120,7 @@
       <IntrinsicFunctions>true</IntrinsicFunctions>
       <SDLCheck>false</SDLCheck>
       <AdditionalIncludeDirectories>$(ProjectDir)\..\..\..\..\common\include;$(ProjectDir)\..\..\..\..\common\os\win\include;$(ProjectDir)\..\..\src;$(ProjectDir)\..\..\os\win;$(ProjectDir)\..\..\..\..\binary\include;$(ProjectDir)\..\..\..\..\binary\os\win\include;$(ProjectDir)\..\..\include</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;IGNITE_FRIEND;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;IGNITE_FRIEND;ODBC_DEBUG;ODBC_LOG_PATH="D:\\odbc.log";%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
     <Link>
       <GenerateDebugInformation>true</GenerateDebugInformation>
@@ -138,7 +138,7 @@
       <IntrinsicFunctions>true</IntrinsicFunctions>
       <SDLCheck>false</SDLCheck>
       <AdditionalIncludeDirectories>$(ProjectDir)\..\..\..\..\common\include;$(ProjectDir)\..\..\..\..\common\os\win\include;$(ProjectDir)\..\..\src;$(ProjectDir)\..\..\os\win;$(ProjectDir)\..\..\..\..\binary\include;$(ProjectDir)\..\..\..\..\binary\os\win\include;$(ProjectDir)\..\..\include</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;IGNITE_FRIEND;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;IGNITE_FRIEND;ODBC_DEBUG;ODBC_LOG_PATH="D:\\odbc.log";%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
     <Link>
       <GenerateDebugInformation>true</GenerateDebugInformation>

http://git-wip-us.apache.org/repos/asf/ignite/blob/6c18d64d/modules/platforms/cpp/odbc/odbc-driver/src/environment.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/environment.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/environment.cpp
index 0063e87..58e018b 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/environment.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/environment.cpp
@@ -41,6 +41,20 @@ namespace ignite
             return connection;
         }
 
+        SqlResult Environment::InternalCreateConnection(Connection*& connection)
+        {
+            connection = new Connection;
+
+            if (!connection)
+            {
+                AddStatusRecord(SQL_STATE_HY001_MEMORY_ALLOCATION, "Not enough memory.");
+
+                return SQL_RESULT_ERROR;
+            }
+
+            return SQL_RESULT_SUCCESS;
+        }
+
         void Environment::TransactionCommit()
         {
             IGNITE_ODBC_API_CALL(InternalTransactionCommit());
@@ -64,17 +78,13 @@ namespace ignite
             return SQL_RESULT_ERROR;
         }
 
-        SqlResult Environment::InternalCreateConnection(Connection*& connection)
+        void Environment::SetAttribute(int32_t attr, void* value, int32_t len)
         {
-            connection = new Connection;
-
-            if (!connection)
-            {
-                AddStatusRecord(SQL_STATE_HY001_MEMORY_ALLOCATION, "Not enough memory.");
-
-                return SQL_RESULT_ERROR;
-            }
+            IGNITE_ODBC_API_CALL(InternalSetAttribute(attr, value, len));
+        }
 
+        SqlResult Environment::InternalSetAttribute(int32_t attr, void* value, int32_t len)
+        {
             return SQL_RESULT_SUCCESS;
         }
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/6c18d64d/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp
index 97b1569..2f206b4 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp
@@ -1290,6 +1290,35 @@ SQLRETURN SQL_API SQLGetData(SQLHSTMT       stmt,
     return statement->GetDiagnosticRecords().GetReturnCode();
 }
 
+SQLRETURN SQL_API SQLSetEnvAttr(SQLHENV     env,
+                                SQLINTEGER  attr,
+                                SQLPOINTER  value,
+                                SQLINTEGER  valueLen)
+{
+    using ignite::odbc::Environment;
+
+    LOG_MSG("SQLSetEnvAttr called\n");
+
+    Environment *environment = reinterpret_cast<Environment*>(env);
+
+    if (!environment)
+        return SQL_INVALID_HANDLE;
+
+    environment->SetAttribute(attr, value, valueLen);
+
+    return environment->GetDiagnosticRecords().GetReturnCode();
+}
+
+SQLRETURN SQL_API SQLGetEnvAttr(SQLHENV     env,
+                                SQLINTEGER  attr,
+                                SQLPOINTER  valueBuf,
+                                SQLINTEGER  valueBufLen,
+                                SQLINTEGER* valueResLen)
+{
+    LOG_MSG("SQLGetEnvAttr called\n");
+    return SQL_SUCCESS;
+}
+
 //
 // ==== Not implemented ====
 //
@@ -1479,16 +1508,6 @@ SQLRETURN SQL_API SQLGetConnectAttr(SQLHDBC     conn,
     return SQL_SUCCESS;
 }
 
-SQLRETURN SQL_API SQLGetEnvAttr(SQLHENV     env,
-                                SQLINTEGER  attr,
-                                SQLPOINTER  valueBuf,
-                                SQLINTEGER  valueBufLen,
-                                SQLINTEGER* valueResLen)
-{
-    LOG_MSG("SQLGetEnvAttr called\n");
-    return SQL_SUCCESS;
-}
-
 SQLRETURN SQL_API SQLSetConnectAttr(SQLHDBC     conn,
                                     SQLINTEGER  attr,
                                     SQLPOINTER  value,
@@ -1506,15 +1525,6 @@ SQLRETURN SQL_API SQLSetConnectAttr(SQLHDBC     conn,
     return SQL_SUCCESS;
 }
 
-SQLRETURN SQL_API SQLSetEnvAttr(SQLHENV     env,
-                                SQLINTEGER  attr,
-                                SQLPOINTER  value,
-                                SQLINTEGER  valueLen)
-{
-    LOG_MSG("SQLSetEnvAttr called\n");
-    return SQL_SUCCESS;
-}
-
 SQLRETURN SQL_API SQLBulkOperations(SQLHSTMT       stmt,
                                     SQLUSMALLINT   operation)
 {


[25/50] ignite git commit: IGNITE-1786: License fixes.

Posted by vo...@apache.org.
IGNITE-1786: License fixes.


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

Branch: refs/heads/ignite-1786
Commit: 4528863b7520aa9afc92ff8fc651419baf6f8ba7
Parents: 97c7f84
Author: isapego <is...@gridgain.com>
Authored: Mon Jan 18 13:05:16 2016 +0300
Committer: isapego <is...@gridgain.com>
Committed: Mon Jan 18 13:05:16 2016 +0300

----------------------------------------------------------------------
 .../processors/odbc/GridOdbcColumnMeta.java         | 16 ++++++++++++++++
 .../internal/processors/odbc/GridOdbcTableMeta.java | 16 ++++++++++++++++
 .../odbc/protocol/GridTcpOdbcNioListener.java       |  1 -
 .../odbc/request/QueryGetColumnsMetaRequest.java    | 16 ++++++++++++++++
 .../odbc/request/QueryGetTablesMetaRequest.java     | 16 ++++++++++++++++
 .../processors/odbc/response/QueryCloseResult.java  | 16 ++++++++++++++++
 .../odbc/response/QueryExecuteResult.java           | 16 ++++++++++++++++
 .../processors/odbc/response/QueryFetchResult.java  | 16 ++++++++++++++++
 .../odbc/response/QueryGetColumnsMetaResult.java    | 16 ++++++++++++++++
 .../odbc/response/QueryGetTablesMetaResult.java     | 16 ++++++++++++++++
 10 files changed, 144 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/4528863b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/GridOdbcColumnMeta.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/GridOdbcColumnMeta.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/GridOdbcColumnMeta.java
index 0668366..03a5dd8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/GridOdbcColumnMeta.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/GridOdbcColumnMeta.java
@@ -1,3 +1,19 @@
+/*
+ * 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.
+ */
 package org.apache.ignite.internal.processors.odbc;
 
 import org.apache.ignite.internal.binary.BinaryClassDescriptor;

http://git-wip-us.apache.org/repos/asf/ignite/blob/4528863b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/GridOdbcTableMeta.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/GridOdbcTableMeta.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/GridOdbcTableMeta.java
index 1664baf..1dd11b8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/GridOdbcTableMeta.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/GridOdbcTableMeta.java
@@ -1,3 +1,19 @@
+/*
+ * 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.
+ */
 package org.apache.ignite.internal.processors.odbc;
 
 import org.apache.ignite.internal.binary.BinaryRawWriterEx;

http://git-wip-us.apache.org/repos/asf/ignite/blob/4528863b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/protocol/GridTcpOdbcNioListener.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/protocol/GridTcpOdbcNioListener.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/protocol/GridTcpOdbcNioListener.java
index fa8655b..c53c2c0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/protocol/GridTcpOdbcNioListener.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/protocol/GridTcpOdbcNioListener.java
@@ -14,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.ignite.internal.processors.odbc.protocol;
 
 import org.apache.ignite.IgniteCheckedException;

http://git-wip-us.apache.org/repos/asf/ignite/blob/4528863b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/request/QueryGetColumnsMetaRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/request/QueryGetColumnsMetaRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/request/QueryGetColumnsMetaRequest.java
index 29ff8c0..255ef41 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/request/QueryGetColumnsMetaRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/request/QueryGetColumnsMetaRequest.java
@@ -1,3 +1,19 @@
+/*
+ * 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.
+ */
 package org.apache.ignite.internal.processors.odbc.request;
 
 /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/4528863b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/request/QueryGetTablesMetaRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/request/QueryGetTablesMetaRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/request/QueryGetTablesMetaRequest.java
index 2b98be6..c92dcd7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/request/QueryGetTablesMetaRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/request/QueryGetTablesMetaRequest.java
@@ -1,3 +1,19 @@
+/*
+ * 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.
+ */
 package org.apache.ignite.internal.processors.odbc.request;
 
 /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/4528863b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/QueryCloseResult.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/QueryCloseResult.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/QueryCloseResult.java
index 0efb60d..2d7521c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/QueryCloseResult.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/QueryCloseResult.java
@@ -1,3 +1,19 @@
+/*
+ * 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.
+ */
 package org.apache.ignite.internal.processors.odbc.response;
 
 /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/4528863b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/QueryExecuteResult.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/QueryExecuteResult.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/QueryExecuteResult.java
index 06b303c..aa4c928 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/QueryExecuteResult.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/QueryExecuteResult.java
@@ -1,3 +1,19 @@
+/*
+ * 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.
+ */
 package org.apache.ignite.internal.processors.odbc.response;
 
 import org.apache.ignite.internal.processors.odbc.GridOdbcColumnMeta;

http://git-wip-us.apache.org/repos/asf/ignite/blob/4528863b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/QueryFetchResult.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/QueryFetchResult.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/QueryFetchResult.java
index d3da101..17cf396 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/QueryFetchResult.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/QueryFetchResult.java
@@ -1,3 +1,19 @@
+/*
+ * 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.
+ */
 package org.apache.ignite.internal.processors.odbc.response;
 
 import java.util.Collection;

http://git-wip-us.apache.org/repos/asf/ignite/blob/4528863b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/QueryGetColumnsMetaResult.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/QueryGetColumnsMetaResult.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/QueryGetColumnsMetaResult.java
index 5158b39..d211862 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/QueryGetColumnsMetaResult.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/QueryGetColumnsMetaResult.java
@@ -1,3 +1,19 @@
+/*
+ * 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.
+ */
 package org.apache.ignite.internal.processors.odbc.response;
 
 import org.apache.ignite.internal.processors.odbc.GridOdbcColumnMeta;

http://git-wip-us.apache.org/repos/asf/ignite/blob/4528863b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/QueryGetTablesMetaResult.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/QueryGetTablesMetaResult.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/QueryGetTablesMetaResult.java
index 7b0c3d4..ae39538 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/QueryGetTablesMetaResult.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/response/QueryGetTablesMetaResult.java
@@ -1,3 +1,19 @@
+/*
+ * 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.
+ */
 package org.apache.ignite.internal.processors.odbc.response;
 
 import org.apache.ignite.internal.processors.odbc.GridOdbcTableMeta;


[04/50] ignite git commit: IGNITE-2061: SQL state for some errors added.

Posted by vo...@apache.org.
IGNITE-2061: SQL state for some errors added.


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

Branch: refs/heads/ignite-1786
Commit: d8692efdf1d3048a24fce607d045ddbb5a2e76af
Parents: b146144
Author: isapego <is...@gridgain.com>
Authored: Mon Jan 11 16:15:34 2016 +0300
Committer: isapego <is...@gridgain.com>
Committed: Mon Jan 11 16:15:34 2016 +0300

----------------------------------------------------------------------
 .../src/diagnostic/diagnostic_record.cpp        | 24 ++++++++++++++++++++
 1 file changed, 24 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/d8692efd/modules/platforms/cpp/odbc/odbc-driver/src/diagnostic/diagnostic_record.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/diagnostic/diagnostic_record.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/diagnostic/diagnostic_record.cpp
index 043e2e9..568c125 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/diagnostic/diagnostic_record.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/diagnostic/diagnostic_record.cpp
@@ -34,6 +34,12 @@ namespace
     /** SQL state 01004 constant. */
     const std::string STATE_01004 = "01004";
 
+    /** SQL state 01S01 constant. */
+    const std::string STATE_01S01 = "01S01";
+
+    /** SQL state 24000 constant. */
+    const std::string STATE_24000 = "24000";
+
     /** SQL state 08001 constant. */
     const std::string STATE_08001 = "08001";
 
@@ -49,8 +55,14 @@ namespace
     /** SQL state HY001 constant. */
     const std::string STATE_HY001 = "HY001";
 
+    /** SQL state HY010 constant. */
+    const std::string STATE_HY010 = "HY010";
+
     /** SQL state HYC00 constant. */
     const std::string STATE_HYC00 = "HYC00";
+
+    /** SQL state HYT01 constant. */
+    const std::string STATE_HYT01 = "HYT01";
 }
 
 namespace ignite
@@ -178,6 +190,12 @@ namespace ignite
                     case SQL_STATE_01004_DATA_TRUNCATED:
                         return STATE_01004;
 
+                    case SQL_STATE_01S01_ERROR_IN_ROW:
+                        return STATE_01S01;
+
+                    case SQL_STATE_24000_INVALID_CURSOR_STATE:
+                        return STATE_24000;
+
                     case SQL_STATE_08001_CANNOT_CONNECT:
                         return STATE_08001;
 
@@ -193,9 +211,15 @@ namespace ignite
                     case SQL_STATE_HY001_MEMORY_ALLOCATION:
                         return STATE_HY001;
 
+                    case SQL_STATE_HY010_SEQUENCE_ERROR:
+                        return STATE_HY010;
+
                     case SQL_STATE_HYC00_OPTIONAL_FEATURE_NOT_IMPLEMENTED:
                         return STATE_HYC00;
 
+                    case SQL_STATE_HYT01_CONNECTIOIN_TIMEOUT:
+                        return STATE_HYT01;
+
                     default:
                         break;
                 }


[30/50] ignite git commit: IGNITE-2242: Added check for the ConnectorConfiguration.

Posted by vo...@apache.org.
IGNITE-2242: Added check for the ConnectorConfiguration.


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

Branch: refs/heads/ignite-1786
Commit: 05cf1fdd804e54e5c2b703c23cd3f87ac21cfd7b
Parents: 8cd80ba
Author: isapego <is...@gridgain.com>
Authored: Mon Jan 18 19:29:49 2016 +0300
Committer: isapego <is...@gridgain.com>
Committed: Mon Jan 18 19:29:49 2016 +0300

----------------------------------------------------------------------
 .../internal/processors/odbc/protocol/GridTcpOdbcServer.java | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/05cf1fdd/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/protocol/GridTcpOdbcServer.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/protocol/GridTcpOdbcServer.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/protocol/GridTcpOdbcServer.java
index 35ac6d6..01e4ef5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/protocol/GridTcpOdbcServer.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/protocol/GridTcpOdbcServer.java
@@ -18,6 +18,7 @@ package org.apache.ignite.internal.processors.odbc.protocol;
 
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteLogger;
+import org.apache.ignite.configuration.ConnectorConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.configuration.OdbcConfiguration;
 import org.apache.ignite.internal.GridKernalContext;
@@ -122,7 +123,12 @@ public class GridTcpOdbcServer {
      * @throws IOException If failed to resolve host.
      */
     private InetAddress resolveOdbcTcpHost(IgniteConfiguration cfg) throws IOException {
-        String host = cfg.getConnectorConfiguration().getHost();
+        String host = null;
+
+        ConnectorConfiguration connectionCfg = cfg.getConnectorConfiguration();
+
+        if (connectionCfg != null)
+            host = connectionCfg.getHost();
 
         if (host == null)
             host = cfg.getLocalHost();


[16/50] ignite git commit: IGNITE-2371: Minor style fix.

Posted by vo...@apache.org.
IGNITE-2371: Minor style fix.


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

Branch: refs/heads/ignite-1786
Commit: dd0ccaf07e820605b922463e58a3c4ce89ab2f8d
Parents: 03efe36
Author: isapego <is...@gridgain.com>
Authored: Wed Jan 13 15:13:58 2016 +0300
Committer: isapego <is...@gridgain.com>
Committed: Wed Jan 13 15:13:58 2016 +0300

----------------------------------------------------------------------
 .../ignite/internal/processors/odbc/GridOdbcCommandHandler.java   | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/dd0ccaf0/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/GridOdbcCommandHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/GridOdbcCommandHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/GridOdbcCommandHandler.java
index 4287319..2b19880 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/GridOdbcCommandHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/GridOdbcCommandHandler.java
@@ -260,8 +260,7 @@ public class GridOdbcCommandHandler {
             String cacheName;
             String tableName;
 
-            if (req.tableName().contains("."))
-            {
+            if (req.tableName().contains(".")) {
                 // Parsing two-part table name.
                 String[] parts = req.tableName().split("\\.");
 


[08/50] ignite git commit: IGNITE-2223: Reading of decimal value is implemented.

Posted by vo...@apache.org.
IGNITE-2223: Reading of decimal value is implemented.


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

Branch: refs/heads/ignite-1786
Commit: 7e32752feba55e6c8e88fe915c57ad22c4791e23
Parents: e5a2bfb
Author: isapego <is...@gridgain.com>
Authored: Mon Jan 11 21:29:28 2016 +0300
Committer: isapego <is...@gridgain.com>
Committed: Mon Jan 11 21:29:28 2016 +0300

----------------------------------------------------------------------
 .../odbc-driver/include/ignite/odbc/utility.h   | 10 +++++++++
 .../cpp/odbc/odbc-driver/src/utility.cpp        | 23 ++++++++++++++++++++
 2 files changed, 33 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/7e32752f/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/utility.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/utility.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/utility.h
index ddb7e51..dbaefc9 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/utility.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/utility.h
@@ -32,6 +32,8 @@
 #include "ignite/impl/binary/binary_reader_impl.h"
 #include "ignite/impl/binary/binary_writer_impl.h"
 
+#include "ignite/odbc/decimal.h"
+
 #ifdef ODBC_DEBUG
 
 extern FILE* log_file;
@@ -148,6 +150,14 @@ namespace ignite
         void WriteString(ignite::impl::binary::BinaryWriterImpl& writer, const std::string& str);
 
         /**
+         * Read decimal value using reader.
+         *
+         * @param reader Reader.
+         * @param decimal Decimal value.
+         */
+        void ReadDecimal(ignite::impl::binary::BinaryReaderImpl& reader, Decimal& decimal);
+
+        /**
          * Convert SQL string buffer to std::string.
          *
          * @param sqlStr SQL string buffer.

http://git-wip-us.apache.org/repos/asf/ignite/blob/7e32752f/modules/platforms/cpp/odbc/odbc-driver/src/utility.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/utility.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/utility.cpp
index 05347d8..3d30d43 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/utility.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/utility.cpp
@@ -15,6 +15,8 @@
  * limitations under the License.
  */
 
+#include <cassert>
+
 #include "ignite/odbc/utility.h"
 #include "ignite/odbc/system/odbc_constants.h"
 
@@ -59,6 +61,27 @@ namespace ignite
             writer.WriteString(str.data(), static_cast<int32_t>(str.size()));
         }
 
+        void ReadDecimal(ignite::impl::binary::BinaryReaderImpl& reader, Decimal& decimal)
+        {
+            int8_t hdr = reader.ReadInt8();
+
+            assert(hdr == ignite::impl::binary::IGNITE_TYPE_DECIMAL);
+
+            int32_t scale = reader.ReadInt32();
+
+            int32_t len = reader.ReadInt32();
+
+            std::vector<int8_t> mag;
+
+            mag.resize(len);
+
+            reader.ReadInt8Array(mag.data(), mag.size());
+
+            Decimal res(scale, mag.data(), mag.size());
+
+            swap(decimal, res);
+        }
+
         std::string SqlStringToString(const unsigned char* sqlStr, int32_t sqlStrLen)
         {
             std::string res;


[47/50] ignite git commit: Merge branch 'master' into ignite-1786

Posted by vo...@apache.org.
Merge branch 'master' into ignite-1786


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

Branch: refs/heads/ignite-1786
Commit: ad3de1c02d0053d3d9b9d8fe7a9d6d9fccb2a286
Parents: 9628396 1f5b202
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Mon Jan 25 14:14:21 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Mon Jan 25 14:14:21 2016 +0300

----------------------------------------------------------------------
 .../dht/atomic/GridDhtAtomicCache.java          |  11 +-
 .../IgniteCacheWriteBehindNoUpdateSelfTest.java | 178 +++++++++++++++++++
 .../testsuites/IgniteCacheTestSuite5.java       |   2 +
 .../processors/hadoop/v2/HadoopV2Context.java   |   2 +
 .../processors/hadoop/v2/HadoopV2MapTask.java   |  23 +--
 5 files changed, 194 insertions(+), 22 deletions(-)
----------------------------------------------------------------------



[32/50] ignite git commit: IGNITE-2242: Added tests for Column. Fixed found issues.

Posted by vo...@apache.org.
IGNITE-2242: Added tests for Column. Fixed found issues.


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

Branch: refs/heads/ignite-1786
Commit: 895901af259652bb0c9a6c61eeaec93ba7435977
Parents: c4df7fc
Author: isapego <is...@gridgain.com>
Authored: Wed Jan 20 18:04:47 2016 +0300
Committer: isapego <is...@gridgain.com>
Committed: Wed Jan 20 18:04:47 2016 +0300

----------------------------------------------------------------------
 .../cpp/odbc/odbc-driver/src/column.cpp         |   2 +-
 .../odbc/odbc-test/project/vs/odbc-test.vcxproj |   1 +
 .../project/vs/odbc-test.vcxproj.filters        |   3 +
 .../cpp/odbc/odbc-test/src/column_test.cpp      | 290 +++++++++++++++++++
 .../cpp/odbc/odbc-test/src/row_test.cpp         |  21 --
 5 files changed, 295 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/895901af/modules/platforms/cpp/odbc/odbc-driver/src/column.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/column.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/column.cpp
index 76cae95..27c413a 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/column.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/column.cpp
@@ -375,7 +375,7 @@ namespace ignite
 
                     dataBuf.PutString(str.substr(offset));
 
-                    IncreaseOffset(static_cast<int32_t>(dataBuf.GetSize()));
+                    IncreaseOffset(static_cast<int32_t>(dataBuf.GetSize() - 1));
 
                     break;
                 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/895901af/modules/platforms/cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj b/modules/platforms/cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj
index 5e5d636..a6a2ae3 100644
--- a/modules/platforms/cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj
+++ b/modules/platforms/cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj
@@ -162,6 +162,7 @@
     <ClCompile Include="..\..\..\odbc-driver\src\row.cpp" />
     <ClCompile Include="..\..\..\odbc-driver\src\utility.cpp" />
     <ClCompile Include="..\..\src\application_data_buffer_test.cpp" />
+    <ClCompile Include="..\..\src\column_test.cpp" />
     <ClCompile Include="..\..\src\configuration_test.cpp" />
     <ClCompile Include="..\..\src\connection_info_test.cpp" />
     <ClCompile Include="..\..\src\cursor_test.cpp" />

http://git-wip-us.apache.org/repos/asf/ignite/blob/895901af/modules/platforms/cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj.filters
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj.filters b/modules/platforms/cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj.filters
index 7daaf03..cf44ba9 100644
--- a/modules/platforms/cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj.filters
+++ b/modules/platforms/cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj.filters
@@ -67,6 +67,9 @@
     <ClCompile Include="..\..\..\odbc-driver\src\column.cpp">
       <Filter>Externals</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\src\column_test.cpp">
+      <Filter>Code</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\include\teamcity_messages.h">

http://git-wip-us.apache.org/repos/asf/ignite/blob/895901af/modules/platforms/cpp/odbc/odbc-test/src/column_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-test/src/column_test.cpp b/modules/platforms/cpp/odbc/odbc-test/src/column_test.cpp
new file mode 100644
index 0000000..4864a6a
--- /dev/null
+++ b/modules/platforms/cpp/odbc/odbc-test/src/column_test.cpp
@@ -0,0 +1,290 @@
+/*
+ * 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.
+ */
+
+#ifndef _MSC_VER
+#   define BOOST_TEST_DYN_LINK
+#endif
+
+#include <boost/test/unit_test.hpp>
+
+#include <ignite/impl/binary/binary_common.h>
+#include <ignite/impl/binary/binary_writer_impl.h>
+
+#include "ignite/odbc/system/odbc_constants.h"
+#include "ignite/odbc/column.h"
+
+using namespace ignite::impl::binary;
+using namespace ignite::odbc::app;
+using namespace ignite::odbc;
+
+BOOST_AUTO_TEST_SUITE(ColumnTestSuite)
+
+BOOST_AUTO_TEST_CASE(TestColumnDefaultConstruction)
+{
+    Column column;
+
+    BOOST_REQUIRE(!column.IsValid());
+}
+
+BOOST_AUTO_TEST_CASE(TestColumnShort)
+{
+    ignite::impl::interop::InteropUnpooledMemory mem(4096);
+    ignite::impl::interop::InteropOutputStream outStream(&mem);
+    ignite::impl::binary::BinaryWriterImpl writer(&outStream, 0);
+
+    int16_t data = 42;
+
+    writer.WriteInt8(IGNITE_TYPE_SHORT);
+    writer.WriteInt16(data);
+
+    outStream.Synchronize();
+
+    ignite::impl::interop::InteropInputStream inStream(&mem);
+    ignite::impl::binary::BinaryReaderImpl reader(&inStream);
+
+    Column column(reader);
+
+    BOOST_REQUIRE(column.IsValid());
+
+    BOOST_REQUIRE(column.GetSize() == 2);
+
+    BOOST_REQUIRE(column.GetUnreadDataLength() == 2);
+
+    short shortBuf = 0;
+    SqlLen reslen = 0;
+    size_t* offset = 0;
+
+    ApplicationDataBuffer appBuf(type_traits::IGNITE_ODBC_C_TYPE_SIGNED_SHORT, &shortBuf, sizeof(shortBuf), &reslen, &offset);
+
+    BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SQL_RESULT_SUCCESS);
+
+    BOOST_REQUIRE(column.IsValid());
+
+    BOOST_REQUIRE(column.GetSize() == 2);
+
+    BOOST_REQUIRE(column.GetUnreadDataLength() == 0);
+
+    BOOST_REQUIRE(shortBuf == data);
+
+    BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SQL_RESULT_NO_DATA);
+
+    BOOST_REQUIRE(column.IsValid());
+
+    BOOST_REQUIRE(column.GetSize() == 2);
+
+    BOOST_REQUIRE(column.GetUnreadDataLength() == 0);
+}
+
+BOOST_AUTO_TEST_CASE(TestColumnString)
+{
+    ignite::impl::interop::InteropUnpooledMemory mem(4096);
+    ignite::impl::interop::InteropOutputStream outStream(&mem);
+    ignite::impl::binary::BinaryWriterImpl writer(&outStream, 0);
+
+    std::string data("Some test data.");
+
+    writer.WriteString(data.data(), static_cast<int32_t>(data.size()));
+
+    outStream.Synchronize();
+
+    ignite::impl::interop::InteropInputStream inStream(&mem);
+    ignite::impl::binary::BinaryReaderImpl reader(&inStream);
+
+    Column column(reader);
+
+    BOOST_REQUIRE(column.IsValid());
+
+    BOOST_REQUIRE(column.GetSize() == data.size());
+
+    BOOST_REQUIRE(column.GetUnreadDataLength() == data.size());
+
+    char strBuf[1024] = {};
+    SqlLen reslen = 0;
+    size_t* offset = 0;
+
+    ApplicationDataBuffer appBuf(type_traits::IGNITE_ODBC_C_TYPE_CHAR, &strBuf, sizeof(strBuf), &reslen, &offset);
+
+    BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SQL_RESULT_SUCCESS);
+
+    BOOST_REQUIRE(column.IsValid());
+
+    BOOST_REQUIRE(column.GetSize() == data.size());
+
+    BOOST_REQUIRE(column.GetUnreadDataLength() == 0);
+
+    BOOST_REQUIRE(std::string(strBuf) == data);
+
+    BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SQL_RESULT_NO_DATA);
+
+    BOOST_REQUIRE(column.IsValid());
+
+    BOOST_REQUIRE(column.GetSize() == data.size());
+
+    BOOST_REQUIRE(column.GetUnreadDataLength() == 0);
+}
+
+BOOST_AUTO_TEST_CASE(TestColumnStringSeveral)
+{
+    ignite::impl::interop::InteropUnpooledMemory mem(4096);
+    ignite::impl::interop::InteropOutputStream outStream(&mem);
+    ignite::impl::binary::BinaryWriterImpl writer(&outStream, 0);
+
+    std::string data("Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
+
+    writer.WriteString(data.data(), static_cast<int32_t>(data.size()));
+
+    outStream.Synchronize();
+
+    ignite::impl::interop::InteropInputStream inStream(&mem);
+    ignite::impl::binary::BinaryReaderImpl reader(&inStream);
+
+    Column column(reader);
+
+    BOOST_REQUIRE(column.IsValid());
+
+    BOOST_REQUIRE(column.GetSize() == data.size());
+
+    BOOST_REQUIRE(column.GetUnreadDataLength() == data.size());
+
+    std::string res;
+
+    std::string strBuf(data.size() / 3 + 2, 0);
+    SqlLen reslen = 0;
+    size_t* offset = 0;
+
+    ApplicationDataBuffer appBuf(type_traits::IGNITE_ODBC_C_TYPE_CHAR, &strBuf[0], strBuf.size(), &reslen, &offset);
+
+    BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SQL_RESULT_SUCCESS);
+
+    BOOST_REQUIRE(column.IsValid());
+
+    BOOST_REQUIRE(column.GetSize() == data.size());
+
+    BOOST_REQUIRE(column.GetUnreadDataLength() == data.size() - (strBuf.size() - 1));
+
+    res.append(strBuf.c_str());
+
+    BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SQL_RESULT_SUCCESS);
+
+    BOOST_REQUIRE(column.IsValid());
+
+    BOOST_REQUIRE(column.GetSize() == data.size());
+
+    BOOST_REQUIRE(column.GetUnreadDataLength() == data.size() - 2 * (strBuf.size() - 1));
+
+    res.append(strBuf.c_str());
+
+    BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SQL_RESULT_SUCCESS);
+
+    BOOST_REQUIRE(column.IsValid());
+
+    BOOST_REQUIRE(column.GetSize() == data.size());
+
+    BOOST_REQUIRE(column.GetUnreadDataLength() == 0);
+
+    res.append(strBuf.c_str());
+
+    BOOST_REQUIRE(column.ReadToBuffer(reader, appBuf) == SQL_RESULT_NO_DATA);
+
+    BOOST_REQUIRE(column.IsValid());
+
+    BOOST_REQUIRE(column.GetSize() == data.size());
+
+    BOOST_REQUIRE(column.GetUnreadDataLength() == 0);
+
+    BOOST_REQUIRE(res == data);
+}
+
+BOOST_AUTO_TEST_CASE(TestColumnMultiString)
+{
+    ignite::impl::interop::InteropUnpooledMemory mem(4096);
+    ignite::impl::interop::InteropOutputStream outStream(&mem);
+    ignite::impl::binary::BinaryWriterImpl writer(&outStream, 0);
+
+    std::string data1("Some test data.");
+    std::string data2("Other TEST DATA.");
+
+    writer.WriteString(data1.data(), static_cast<int32_t>(data1.size()));
+    writer.WriteString(data2.data(), static_cast<int32_t>(data2.size()));
+
+    outStream.Synchronize();
+
+    ignite::impl::interop::InteropInputStream inStream(&mem);
+    ignite::impl::binary::BinaryReaderImpl reader(&inStream);
+
+    Column column1(reader);
+
+    inStream.Position(column1.GetEndPosition());
+
+    Column column2(reader);
+
+    BOOST_REQUIRE(column1.IsValid());
+
+    BOOST_REQUIRE(column1.GetSize() == data1.size());
+
+    BOOST_REQUIRE(column1.GetUnreadDataLength() == data1.size());
+
+    BOOST_REQUIRE(column2.IsValid());
+
+    BOOST_REQUIRE(column2.GetSize() == data2.size());
+
+    BOOST_REQUIRE(column2.GetUnreadDataLength() == data2.size());
+
+    char strBuf[1024] = {};
+    SqlLen reslen = 0;
+    size_t* offset = 0;
+
+    ApplicationDataBuffer appBuf(type_traits::IGNITE_ODBC_C_TYPE_CHAR, &strBuf, sizeof(strBuf), &reslen, &offset);
+
+    BOOST_REQUIRE(column1.ReadToBuffer(reader, appBuf) == SQL_RESULT_SUCCESS);
+
+    BOOST_REQUIRE(column1.IsValid());
+
+    BOOST_REQUIRE(column1.GetSize() == data1.size());
+
+    BOOST_REQUIRE(column1.GetUnreadDataLength() == 0);
+
+    BOOST_REQUIRE(std::string(strBuf) == data1);
+
+    BOOST_REQUIRE(column1.ReadToBuffer(reader, appBuf) == SQL_RESULT_NO_DATA);
+
+    BOOST_REQUIRE(column1.IsValid());
+
+    BOOST_REQUIRE(column1.GetSize() == data1.size());
+
+    BOOST_REQUIRE(column1.GetUnreadDataLength() == 0);
+
+    BOOST_REQUIRE(column2.ReadToBuffer(reader, appBuf) == SQL_RESULT_SUCCESS);
+
+    BOOST_REQUIRE(column2.IsValid());
+
+    BOOST_REQUIRE(column2.GetSize() == data2.size());
+
+    BOOST_REQUIRE(column2.GetUnreadDataLength() == 0);
+
+    BOOST_REQUIRE(std::string(strBuf) == data2);
+
+    BOOST_REQUIRE(column2.ReadToBuffer(reader, appBuf) == SQL_RESULT_NO_DATA);
+
+    BOOST_REQUIRE(column2.IsValid());
+
+    BOOST_REQUIRE(column2.GetSize() == data2.size());
+
+    BOOST_REQUIRE(column2.GetUnreadDataLength() == 0);
+}
+
+BOOST_AUTO_TEST_SUITE_END()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/895901af/modules/platforms/cpp/odbc/odbc-test/src/row_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-test/src/row_test.cpp b/modules/platforms/cpp/odbc/odbc-test/src/row_test.cpp
index 86e5203..e655cf7 100644
--- a/modules/platforms/cpp/odbc/odbc-test/src/row_test.cpp
+++ b/modules/platforms/cpp/odbc/odbc-test/src/row_test.cpp
@@ -144,27 +144,6 @@ BOOST_AUTO_TEST_CASE(TestRowMoveToNext)
     }
 }
 
-//BOOST_AUTO_TEST_CASE(TestRowSkip)
-//{
-//    ignite::impl::interop::InteropUnpooledMemory mem(4096);
-//
-//    const size_t rowNum = 8;
-//
-//    FillMemWithData(mem, rowNum);
-//
-//    Row row(mem);
-//
-//    for (size_t i = 0; i < rowNum - 1; ++i)
-//    {
-//        BOOST_REQUIRE(row.GetSize() == 4);
-//
-//        for (int32_t j = 0; j < row.GetSize(); ++j)
-//            BOOST_REQUIRE(row.SkipColumn());
-//
-//        BOOST_REQUIRE(row.MoveToNext());
-//    }
-//}
-
 BOOST_AUTO_TEST_CASE(TestRowRead)
 {
     ignite::impl::interop::InteropUnpooledMemory mem(4096);


[31/50] ignite git commit: IGNITE-2242: Added columns and implemented SQLGetData.

Posted by vo...@apache.org.
IGNITE-2242: Added columns and implemented SQLGetData.


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

Branch: refs/heads/ignite-1786
Commit: c4df7fc43b075f9a599f072d5b0a98af619a99fd
Parents: 05cf1fd
Author: isapego <is...@gridgain.com>
Authored: Wed Jan 20 16:23:14 2016 +0300
Committer: isapego <is...@gridgain.com>
Committed: Wed Jan 20 16:23:14 2016 +0300

----------------------------------------------------------------------
 .../odbc-driver/include/ignite/odbc/column.h    | 149 ++++++
 .../ignite/odbc/query/column_metadata_query.h   |   9 +
 .../include/ignite/odbc/query/data_query.h      |  10 +
 .../ignite/odbc/query/foreign_keys_query.h      |   9 +
 .../ignite/odbc/query/primary_keys_query.h      |   9 +
 .../include/ignite/odbc/query/query.h           |  10 +
 .../ignite/odbc/query/table_metadata_query.h    |   9 +
 .../include/ignite/odbc/query/type_info_query.h |   9 +
 .../odbc/odbc-driver/include/ignite/odbc/row.h  |  61 ++-
 .../odbc-driver/include/ignite/odbc/statement.h |  17 +
 .../odbc-driver/project/vs/odbc-driver.vcxproj  |   2 +
 .../project/vs/odbc-driver.vcxproj.filters      |   6 +
 .../cpp/odbc/odbc-driver/src/column.cpp         | 454 +++++++++++++++++++
 .../platforms/cpp/odbc/odbc-driver/src/odbc.cpp |  39 +-
 .../src/query/column_metadata_query.cpp         | 179 ++++----
 .../odbc/odbc-driver/src/query/data_query.cpp   |  36 +-
 .../src/query/foreign_keys_query.cpp            |  12 +
 .../src/query/primary_keys_query.cpp            | 101 +++--
 .../src/query/table_metadata_query.cpp          |  89 ++--
 .../odbc-driver/src/query/type_info_query.cpp   | 247 +++++-----
 .../platforms/cpp/odbc/odbc-driver/src/row.cpp  | 320 ++-----------
 .../cpp/odbc/odbc-driver/src/statement.cpp      |  21 +-
 .../odbc/odbc-test/project/vs/odbc-test.vcxproj |   1 +
 .../project/vs/odbc-test.vcxproj.filters        |   3 +
 .../cpp/odbc/odbc-test/src/row_test.cpp         |  50 +-
 25 files changed, 1228 insertions(+), 624 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/c4df7fc4/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/column.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/column.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/column.h
new file mode 100644
index 0000000..dc0b6d9
--- /dev/null
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/column.h
@@ -0,0 +1,149 @@
+/*
+ * 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.
+ */
+
+#ifndef _IGNITE_ODBC_DRIVER_COLUMN
+#define _IGNITE_ODBC_DRIVER_COLUMN
+
+#include <stdint.h>
+
+#include <ignite/impl/binary/binary_reader_impl.h>
+
+#include "ignite/odbc/app/application_data_buffer.h"
+
+namespace ignite
+{
+    namespace odbc
+    {
+        /**
+         * Result set column.
+         */
+        class Column
+        {
+        public:
+            /**
+             * Default constructor.
+             */
+            Column();
+
+            /**
+             * Copy constructor.
+             *
+             * @param other Another instance.
+             */
+            Column(const Column& other);
+
+            /**
+             * Copy operator.
+             *
+             * @param other Another instance.
+             * @return This.
+             */
+            Column& operator=(const Column& other);
+
+            /**
+             * Destructor.
+             */
+            ~Column();
+
+            /**
+             * Constructor.
+             *
+             * @param reader Reader to be used to retrieve column data.
+             */
+            Column(ignite::impl::binary::BinaryReaderImpl& reader);
+
+            /**
+             * Get column size in bytes.
+             *
+             * @return Column size.
+             */
+            int32_t GetSize() const
+            {
+                return size;
+            }
+
+            /**
+             * Read column data and store it in application data buffer.
+             *
+             * @param dataBuf Application data buffer.
+             * @return Operation result.
+             */
+            SqlResult ReadToBuffer(ignite::impl::binary::BinaryReaderImpl& reader,
+                app::ApplicationDataBuffer& dataBuf);
+
+            /**
+             * Check if the column is in valid state.
+             *
+             * @return True if valid.
+             */
+            bool IsValid() const
+            {
+                return startPos >= 0;
+            }
+
+            /**
+             * Get unread data length.
+             * Find out how many bytes of data are left unread.
+             *
+             * @return Lengh of unread data in bytes.
+             */
+            int32_t GetUnreadDataLength() const
+            {
+                return size - offset;
+            }
+
+            /**
+             * Get unread data length.
+             * Find out how many bytes of data are left unread.
+             *
+             * @return Lengh of unread data in bytes.
+             */
+            int32_t GetEndPosition() const
+            {
+                return endPos;
+            }
+
+        private:
+            /**
+             * Increase offset.
+             *
+             * Increases offset on specified value and makes sure resulting
+             * offset does not exceed column size.
+             *
+             * @param value Offset is incremented on this value.
+             */
+            void IncreaseOffset(int32_t value);
+
+            /** Column type */
+            int8_t type;
+
+            /** Column position in current row. */
+            int32_t startPos;
+
+            /** Column end position in current row. */
+            int32_t endPos;
+
+            /** Current offset in column. */
+            int32_t offset;
+
+            /** Column data size in bytes. */
+            int32_t size;
+        };
+    }
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/c4df7fc4/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/column_metadata_query.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/column_metadata_query.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/column_metadata_query.h
index cbd6641..378e95c 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/column_metadata_query.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/column_metadata_query.h
@@ -76,6 +76,15 @@ namespace ignite
                 virtual SqlResult FetchNextRow(app::ColumnBindingMap& columnBindings);
 
                 /**
+                 * Get data of the specified column in the result set.
+                 *
+                 * @param columnIdx Column index.
+                 * @param buffer Buffer to put column data to.
+                 * @return Operation result.
+                 */
+                virtual SqlResult GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer);
+
+                /**
                  * Close query.
                  *
                  * @return True on success.

http://git-wip-us.apache.org/repos/asf/ignite/blob/c4df7fc4/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/data_query.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/data_query.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/data_query.h
index 03f4406..88550d0 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/data_query.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/data_query.h
@@ -70,9 +70,19 @@ namespace ignite
                 /**
                  * Fetch next result row to application buffers.
                  *
+                 * @param columnBindings Application buffers to put data to.
                  * @return Operation result.
                  */
                 virtual SqlResult FetchNextRow(app::ColumnBindingMap& columnBindings);
+                
+                /**
+                 * Get data of the specified column in the result set.
+                 *
+                 * @param columnIdx Column index.
+                 * @param buffer Buffer to put column data to.
+                 * @return Operation result.
+                 */
+                virtual SqlResult GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer);
 
                 /**
                  * Close query.

http://git-wip-us.apache.org/repos/asf/ignite/blob/c4df7fc4/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/foreign_keys_query.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/foreign_keys_query.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/foreign_keys_query.h
index 5c25c6f..abd13bc 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/foreign_keys_query.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/foreign_keys_query.h
@@ -77,6 +77,15 @@ namespace ignite
                 virtual SqlResult FetchNextRow(app::ColumnBindingMap& columnBindings);
 
                 /**
+                 * Get data of the specified column in the result set.
+                 *
+                 * @param columnIdx Column index.
+                 * @param buffer Buffer to put column data to.
+                 * @return Operation result.
+                 */
+                virtual SqlResult GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer);
+
+                /**
                  * Close query.
                  *
                  * @return True on success.

http://git-wip-us.apache.org/repos/asf/ignite/blob/c4df7fc4/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/primary_keys_query.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/primary_keys_query.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/primary_keys_query.h
index 88dd2a4..22e1359 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/primary_keys_query.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/primary_keys_query.h
@@ -74,6 +74,15 @@ namespace ignite
                 virtual SqlResult FetchNextRow(app::ColumnBindingMap& columnBindings);
 
                 /**
+                 * Get data of the specified column in the result set.
+                 *
+                 * @param columnIdx Column index.
+                 * @param buffer Buffer to put column data to.
+                 * @return Operation result.
+                 */
+                virtual SqlResult GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer);
+
+                /**
                  * Close query.
                  *
                  * @return True on success.

http://git-wip-us.apache.org/repos/asf/ignite/blob/c4df7fc4/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/query.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/query.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/query.h
index f273a41..93da5c9 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/query.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/query.h
@@ -57,11 +57,21 @@ namespace ignite
                 /**
                  * Fetch next result row to application buffers.
                  *
+                 * @param columnBindings Application buffers to put data to.
                  * @return Operation result.
                  */
                 virtual SqlResult FetchNextRow(app::ColumnBindingMap& columnBindings) = 0;
 
                 /**
+                 * Get data of the specified column in the result set.
+                 *
+                 * @param columnIdx Column index.
+                 * @param buffer Buffer to put column data to.
+                 * @return Operation result.
+                 */
+                virtual SqlResult GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer) = 0;
+
+                /**
                  * Close query.
                  *
                  * @return True on success.

http://git-wip-us.apache.org/repos/asf/ignite/blob/c4df7fc4/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/table_metadata_query.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/table_metadata_query.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/table_metadata_query.h
index ea2be8e..1b05377 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/table_metadata_query.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/table_metadata_query.h
@@ -77,6 +77,15 @@ namespace ignite
                 virtual SqlResult FetchNextRow(app::ColumnBindingMap& columnBindings);
 
                 /**
+                 * Get data of the specified column in the result set.
+                 *
+                 * @param columnIdx Column index.
+                 * @param buffer Buffer to put column data to.
+                 * @return Operation result.
+                 */
+                virtual SqlResult GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer);
+
+                /**
                  * Close query.
                  *
                  * @return True on success.

http://git-wip-us.apache.org/repos/asf/ignite/blob/c4df7fc4/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/type_info_query.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/type_info_query.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/type_info_query.h
index ca9b879..ffef3e4 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/type_info_query.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/type_info_query.h
@@ -67,6 +67,15 @@ namespace ignite
                 virtual SqlResult FetchNextRow(app::ColumnBindingMap& columnBindings);
 
                 /**
+                 * Get data of the specified column in the result set.
+                 *
+                 * @param columnIdx Column index.
+                 * @param buffer Buffer to put column data to.
+                 * @return Operation result.
+                 */
+                virtual SqlResult GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer);
+
+                /**
                  * Close query.
                  *
                  * @return True on success.

http://git-wip-us.apache.org/repos/asf/ignite/blob/c4df7fc4/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/row.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/row.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/row.h
index 2110860..7673555 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/row.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/row.h
@@ -19,11 +19,12 @@
 #define _IGNITE_ODBC_DRIVER_ROW
 
 #include <stdint.h>
+#include <vector>
 
-#include "ignite/odbc/result_page.h"
-#include "ignite/odbc/common_types.h"
+#include "ignite/odbc/column.h"
 #include "ignite/odbc/app/application_data_buffer.h"
 
+
 namespace ignite
 {
     namespace odbc
@@ -46,8 +47,8 @@ namespace ignite
 
             /**
              * Get row size in columns.
+             *
              * @return Row size.
-             * @return True on success.
              */
             int32_t GetSize() const
             {
@@ -56,19 +57,15 @@ namespace ignite
 
             /**
              * Read column data and store it in application data buffer.
+             *
              * @param dataBuf Application data buffer.
              * @return True on success.
              */
-            bool ReadColumnToBuffer(app::ApplicationDataBuffer& dataBuf);
-
-            /**
-             * Skip columnt.
-             * @return True on success.
-             */
-            bool SkipColumn();
+            SqlResult ReadColumnToBuffer(uint16_t columnIdx, app::ApplicationDataBuffer& dataBuf);
 
             /**
              * Move to next row.
+             *
              * @return True on success.
              */
             bool MoveToNext();
@@ -77,21 +74,46 @@ namespace ignite
             IGNITE_NO_COPY_ASSIGNMENT(Row);
 
             /**
-             * Read column header and restores position if the column is of
-             * complex type.
-             * @return Column type header.
+             * Reinitialize row state using stream data.
+             * @note Stream must be positioned at the beginning of the row.
              */
-            int8_t ReadColumnHeader();
+            void Reinit();
 
-            /** Row size in columns. */
-            int32_t size;
+            /**
+             * Get columns by its index.
+             *
+             * Column indexing starts at 1.
+             *
+             * @note This operation is private because it's unsafe to use:
+             *       It is neccessary to ensure that column is discovered prior
+             *       to calling this method using EnsureColumnDiscovered().
+             *
+             * @param columnIdx Column index.
+             * @return Reference to specified column.
+             */
+            Column& GetColumn(uint16_t columnIdx)
+            {
+                return columns[columnIdx - 1];
+            }
 
-            /** Current position in row. */
-            int32_t pos;
+            /**
+             * Ensure that column data is discovered.
+             *
+             * @param columnIdx Column index.
+             * @return True if the column is discovered and false if it can not
+             * be discovered.
+             */
+            bool EnsureColumnDiscovered(uint16_t columnIdx);
 
             /** Row position in current page. */
             int32_t rowBeginPos;
 
+            /** Current position in row. */
+            int32_t pos;
+
+            /** Row size in columns. */
+            int32_t size;
+
             /** Memory that contains current row data. */
             ignite::impl::interop::InteropUnpooledMemory& pageData;
 
@@ -100,6 +122,9 @@ namespace ignite
 
             /** Data reader. */
             ignite::impl::binary::BinaryReaderImpl reader;
+
+            /** Columns. */
+            std::vector<Column> columns;
         };
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/c4df7fc4/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/statement.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/statement.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/statement.h
index 2449e07..43ba239 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/statement.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/statement.h
@@ -139,6 +139,14 @@ namespace ignite
             size_t* GetParamBindOffsetPtr();
 
             /**
+             * Get value of the column in the result set.
+             *
+             * @param columnIdx Column index.
+             * @param buffer Buffer to put column data to.
+             */
+            void GetColumnData(uint16_t columnIdx, app::ApplicationDataBuffer& buffer);
+
+            /**
              * Prepare SQL query.
              *
              * @note Only SELECT queries are supported currently.
@@ -309,6 +317,15 @@ namespace ignite
             IGNITE_NO_COPY_ASSIGNMENT(Statement);
 
             /**
+             * Get value of the column in the result set.
+             *
+             * @param columnIdx Column index.
+             * @param buffer Buffer to put column data to.
+             * @return Operation result.
+             */
+            SqlResult InternalGetColumnData(uint16_t columnIdx, app::ApplicationDataBuffer& buffer);
+
+            /**
              * Close statement.
              * Internal call.
              *

http://git-wip-us.apache.org/repos/asf/ignite/blob/c4df7fc4/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj b/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj
index 3c701be..5f151e4 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj
+++ b/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj
@@ -152,6 +152,7 @@
     <ClCompile Include="..\..\os\win\src\system\socket_client.cpp" />
     <ClCompile Include="..\..\src\app\application_data_buffer.cpp" />
     <ClCompile Include="..\..\src\app\parameter.cpp" />
+    <ClCompile Include="..\..\src\column.cpp" />
     <ClCompile Include="..\..\src\common_types.cpp" />
     <ClCompile Include="..\..\src\config\configuration.cpp" />
     <ClCompile Include="..\..\src\config\connection_info.cpp" />
@@ -183,6 +184,7 @@
   <ItemGroup>
     <ClInclude Include="..\..\include\ignite\odbc\app\application_data_buffer.h" />
     <ClInclude Include="..\..\include\ignite\odbc\app\parameter.h" />
+    <ClInclude Include="..\..\include\ignite\odbc\column.h" />
     <ClInclude Include="..\..\include\ignite\odbc\common_types.h" />
     <ClInclude Include="..\..\include\ignite\odbc\config\configuration.h" />
     <ClInclude Include="..\..\include\ignite\odbc\config\connection_info.h" />

http://git-wip-us.apache.org/repos/asf/ignite/blob/c4df7fc4/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj.filters
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj.filters b/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj.filters
index 69c3c10..8083def 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj.filters
+++ b/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj.filters
@@ -109,6 +109,9 @@
     <ClCompile Include="..\..\src\query\type_info_query.cpp">
       <Filter>Code\query</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\src\column.cpp">
+      <Filter>Code</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <None Include="module.def">
@@ -213,5 +216,8 @@
     <ClInclude Include="..\..\include\ignite\odbc\query\type_info_query.h">
       <Filter>Code\query</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\include\ignite\odbc\column.h">
+      <Filter>Code</Filter>
+    </ClInclude>
   </ItemGroup>
 </Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/c4df7fc4/modules/platforms/cpp/odbc/odbc-driver/src/column.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/column.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/column.cpp
new file mode 100644
index 0000000..76cae95
--- /dev/null
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/column.cpp
@@ -0,0 +1,454 @@
+/*
+ * 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.
+ */
+
+#include <ignite/impl/interop/interop_stream_position_guard.h>
+
+#include "ignite/odbc/utility.h"
+#include "ignite/odbc/column.h"
+
+namespace
+{
+    using namespace ignite::impl::interop;
+    using namespace ignite::impl::binary;
+
+    bool GetObjectLength(InteropInputStream& stream, int32_t& len)
+    {
+        InteropStreamPositionGuard<InteropInputStream> guard(stream);
+
+        int8_t hdr = stream.ReadInt8();
+
+        if (hdr != IGNITE_HDR_FULL)
+            return false;
+
+        int8_t protoVer = stream.ReadInt8();
+
+        if (protoVer != IGNITE_PROTO_VER)
+            return false;
+
+        // Skipping flags
+        stream.ReadInt16();
+
+        // Skipping typeId
+        stream.ReadInt32();
+
+        // Skipping hash code
+        stream.ReadInt32();
+
+        len = stream.ReadInt32();
+
+        return true;
+    }
+
+    /**
+     * Read column header and restores position if the column is of
+     * complex type.
+     * @return Column type header.
+     */
+    int8_t ReadColumnHeader(ignite::impl::interop::InteropInputStream& stream)
+    {
+        using namespace ignite::impl::binary;
+
+        int32_t headerPos = stream.Position();
+
+        int8_t hdr = stream.ReadInt8();
+
+        // Check if we need to restore position - to read complex types
+        // stream should have unread header, but for primitive types it
+        // should not.
+        switch (hdr)
+        {
+            case IGNITE_TYPE_BYTE:
+            case IGNITE_TYPE_SHORT:
+            case IGNITE_TYPE_CHAR:
+            case IGNITE_TYPE_INT:
+            case IGNITE_TYPE_LONG:
+            case IGNITE_TYPE_FLOAT:
+            case IGNITE_TYPE_DOUBLE:
+            case IGNITE_TYPE_BOOL:
+            case IGNITE_HDR_NULL:
+            {
+                // No-op.
+                break;
+            }
+
+            default:
+            {
+                // Restoring position.
+                stream.Position(headerPos);
+                break;
+            }
+        }
+
+        return hdr;
+    }
+}
+
+namespace ignite
+{
+    namespace odbc
+    {
+        Column::Column() :
+            type(0), startPos(-1), endPos(-1), offset(0), size(0)
+        {
+            // No-op.
+        }
+
+        Column::Column(const Column& other) :
+            type(other.type), startPos(other.startPos), endPos(other.endPos),
+            offset(other.offset), size(other.size)
+        {
+            // No-op.
+        }
+
+        Column& Column::operator=(const Column& other)
+        {
+            type = other.type;
+            startPos = other.startPos;
+            endPos = other.endPos;
+            offset = other.offset;
+            size = other.size;
+
+            return *this;
+        }
+
+        Column::~Column()
+        {
+            // No-op.
+        }
+
+        Column::Column(ignite::impl::binary::BinaryReaderImpl& reader) :
+            type(0), startPos(-1), endPos(-1), offset(0), size(0)
+        {
+            ignite::impl::interop::InteropInputStream* stream = reader.GetStream();
+
+            if (!stream)
+                return;
+
+            InteropStreamPositionGuard<InteropInputStream> guard(*stream);
+
+            int32_t sizeTmp = 0;
+
+            int8_t hdr = ReadColumnHeader(*stream);
+
+            int32_t startPosTmp = stream->Position();
+
+            switch (hdr)
+            {
+                case IGNITE_HDR_NULL:
+                {
+                    sizeTmp = 1;
+
+                    break;
+                }
+
+                case IGNITE_TYPE_BYTE:
+                {
+                    reader.ReadInt8();
+
+                    sizeTmp = 1;
+
+                    break;
+                }
+
+                case IGNITE_TYPE_BOOL:
+                {
+                    reader.ReadBool();
+
+                    sizeTmp = 1;
+
+                    break;
+                }
+
+                case IGNITE_TYPE_SHORT:
+                case IGNITE_TYPE_CHAR:
+                {
+                    reader.ReadInt16();
+
+                    sizeTmp = 2;
+
+                    break;
+                }
+
+                case IGNITE_TYPE_FLOAT:
+                {
+                    reader.ReadFloat();
+
+                    sizeTmp = 4;
+
+                    break;
+                }
+
+                case IGNITE_TYPE_INT:
+                {
+                    reader.ReadInt32();
+
+                    sizeTmp = 4;
+
+                    break;
+                }
+
+                case IGNITE_TYPE_DOUBLE:
+                {
+                    reader.ReadDouble();
+
+                    sizeTmp = 8;
+
+                    break;
+                }
+
+                case IGNITE_TYPE_LONG:
+                {
+                    reader.ReadInt64();
+
+                    sizeTmp = 8;
+
+                    break;
+                }
+
+                case IGNITE_TYPE_STRING:
+                {
+                    std::string str;
+                    utility::ReadString(reader, str);
+
+                    sizeTmp = static_cast<int32_t>(str.size());
+
+                    break;
+                }
+
+                case IGNITE_TYPE_UUID:
+                {
+                    reader.ReadGuid();
+
+                    sizeTmp = 16;
+
+                    break;
+                }
+
+                case IGNITE_HDR_FULL:
+                {
+                    int32_t len;
+
+                    if (!GetObjectLength(*stream, len))
+                        return;
+
+                    sizeTmp = len;
+
+                    stream->Position(stream->Position() + len);
+
+                    break;
+                }
+
+                case IGNITE_TYPE_DECIMAL:
+                {
+                    Decimal res;
+
+                    utility::ReadDecimal(reader, res);
+
+                    sizeTmp = res.GetLength() + 8;
+
+                    break;
+                }
+
+                case IGNITE_TYPE_DATE:
+                default:
+                {
+                    // This is a fail case.
+                    return;
+                }
+            }
+
+            type = hdr;
+            startPos = startPosTmp;
+            endPos = stream->Position();
+            size = sizeTmp;
+        }
+
+        SqlResult Column::ReadToBuffer(ignite::impl::binary::BinaryReaderImpl& reader,
+            app::ApplicationDataBuffer& dataBuf)
+        {
+            using namespace ignite::impl::binary;
+            using namespace ignite::impl::interop;
+
+            if (!IsValid())
+                return SQL_RESULT_ERROR;
+
+            if (GetUnreadDataLength() == 0)
+            {
+                dataBuf.PutNull();
+
+                return SQL_RESULT_NO_DATA;
+            }
+
+            ignite::impl::interop::InteropInputStream* stream = reader.GetStream();
+
+            if (!stream)
+                return SQL_RESULT_ERROR;
+
+            InteropStreamPositionGuard<InteropInputStream> guard(*stream);
+
+            stream->Position(startPos);
+
+            switch (type)
+            {
+                case IGNITE_TYPE_BYTE:
+                {
+                    dataBuf.PutInt8(reader.ReadInt8());
+
+                    IncreaseOffset(size);
+
+                    break;
+                }
+
+                case IGNITE_TYPE_SHORT:
+                case IGNITE_TYPE_CHAR:
+                {
+                    dataBuf.PutInt16(reader.ReadInt16());
+
+                    IncreaseOffset(size);
+
+                    break;
+                }
+
+                case IGNITE_TYPE_INT:
+                {
+                    dataBuf.PutInt32(reader.ReadInt32());
+
+                    IncreaseOffset(size);
+
+                    break;
+                }
+
+                case IGNITE_TYPE_LONG:
+                {
+                    dataBuf.PutInt64(reader.ReadInt64());
+
+                    IncreaseOffset(size);
+
+                    break;
+                }
+
+                case IGNITE_TYPE_FLOAT:
+                {
+                    dataBuf.PutFloat(reader.ReadFloat());
+
+                    IncreaseOffset(size);
+
+                    break;
+                }
+
+                case IGNITE_TYPE_DOUBLE:
+                {
+                    dataBuf.PutDouble(reader.ReadDouble());
+
+                    IncreaseOffset(size);
+
+                    break;
+                }
+
+                case IGNITE_TYPE_BOOL:
+                {
+                    dataBuf.PutInt8(reader.ReadBool() ? 1 : 0);
+
+                    IncreaseOffset(size);
+
+                    break;
+                }
+
+                case IGNITE_TYPE_STRING:
+                {
+                    std::string str;
+                    utility::ReadString(reader, str);
+
+                    dataBuf.PutString(str.substr(offset));
+
+                    IncreaseOffset(static_cast<int32_t>(dataBuf.GetSize()));
+
+                    break;
+                }
+
+                case IGNITE_TYPE_UUID:
+                {
+                    Guid guid = reader.ReadGuid();
+
+                    dataBuf.PutGuid(guid);
+
+                    IncreaseOffset(size);
+
+                    break;
+                }
+
+                case IGNITE_HDR_NULL:
+                {
+                    dataBuf.PutNull();
+
+                    IncreaseOffset(static_cast<int32_t>(dataBuf.GetSize()));
+
+                    break;
+                }
+
+                case IGNITE_HDR_FULL:
+                {
+                    int32_t len;
+
+                    if (!GetObjectLength(*stream, len))
+                        return SQL_RESULT_ERROR;
+
+                    std::vector<int8_t> data(len);
+
+                    stream->ReadInt8Array(&data[0], static_cast<int32_t>(data.size()));
+
+                    dataBuf.PutBinaryData(data.data() + offset, static_cast<size_t>(len - offset));
+
+                    IncreaseOffset(static_cast<int32_t>(dataBuf.GetSize()));
+
+                    break;
+                }
+
+                case IGNITE_TYPE_DECIMAL:
+                {
+                    Decimal res;
+
+                    utility::ReadDecimal(reader, res);
+
+                    dataBuf.PutDecimal(res);
+
+                    IncreaseOffset(size);
+
+                    break;
+                }
+
+                case IGNITE_TYPE_DATE:
+                default:
+                {
+                    // This is a fail case. Return false.
+                    return SQL_RESULT_ERROR;
+                }
+            }
+
+            return SQL_RESULT_SUCCESS;
+        }
+
+        void Column::IncreaseOffset(int32_t value)
+        {
+            offset += value;
+
+            if (offset > size)
+                offset = size;
+        }
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/ignite/blob/c4df7fc4/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp
index 4c8a172..b9d6099 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp
@@ -1262,6 +1262,34 @@ SQLRETURN SQL_API SQLEndTran(SQLSMALLINT    handleType,
     return result;
 }
 
+SQLRETURN SQL_API SQLGetData(SQLHSTMT       stmt,
+                             SQLUSMALLINT   colNum,
+                             SQLSMALLINT    targetType,
+                             SQLPOINTER     targetValue,
+                             SQLLEN         bufferLength,
+                             SQLLEN*        strLengthOrIndicator)
+{
+    using namespace ignite::odbc::type_traits;
+
+    using ignite::odbc::Statement;
+    using ignite::odbc::app::ApplicationDataBuffer;
+
+    LOG_MSG("SQLGetData called\n");
+
+    Statement *statement = reinterpret_cast<Statement*>(stmt);
+
+    if (!statement)
+        return SQL_INVALID_HANDLE;
+
+    IgniteSqlType driverType = ToDriverType(targetType);
+
+    ApplicationDataBuffer dataBuffer(driverType, targetValue, bufferLength, strLengthOrIndicator);
+
+    //statement->GetColumnData(colNum, dataBuffer);
+
+    return statement->GetDiagnosticRecords().GetReturnCode();
+}
+
 //
 // ==== Not implemented ====
 //
@@ -1322,17 +1350,6 @@ SQLRETURN SQL_API SQLGetConnectOption(SQLHDBC       conn,
     return SQL_SUCCESS;
 }
 
-SQLRETURN SQL_API SQLGetData(SQLHSTMT       stmt,
-                             SQLUSMALLINT   colNum,
-                             SQLSMALLINT    targetType,
-                             SQLPOINTER     targetValue,
-                             SQLLEN         bufferLength,
-                             SQLLEN*        strLengthOrIndicator)
-{
-    LOG_MSG("SQLGetData called\n");
-    return SQL_SUCCESS;
-}
-
 SQLRETURN SQL_API SQLGetFunctions(SQLHDBC       conn,
                                   SQLUSMALLINT  funcId,
                                   SQLUSMALLINT* supported)

http://git-wip-us.apache.org/repos/asf/ignite/blob/c4df7fc4/modules/platforms/cpp/odbc/odbc-driver/src/query/column_metadata_query.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/query/column_metadata_query.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/query/column_metadata_query.cpp
index 083b367..69a08b1 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/query/column_metadata_query.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/query/column_metadata_query.cpp
@@ -148,96 +148,109 @@ namespace ignite
                 app::ColumnBindingMap::iterator it;
 
                 for (it = columnBindings.begin(); it != columnBindings.end(); ++it)
+                    GetColumn(it->first, it->second);
+
+                ++cursor;
+
+                return SQL_RESULT_SUCCESS;
+            }
+
+            SqlResult ColumnMetadataQuery::GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer & buffer)
+            {
+                if (!executed)
                 {
-                    uint16_t columnIdx = it->first;
-                    app::ApplicationDataBuffer& buffer = it->second;
-                    const meta::ColumnMeta& currentColumn = *cursor;
-                    uint8_t columnType = currentColumn.GetDataType();
+                    diag.AddStatusRecord(SQL_STATE_HY010_SEQUENCE_ERROR, "Query was not executed.");
 
-                    switch (columnIdx)
+                    return SQL_RESULT_ERROR;
+                }
+
+                if (cursor == meta.end())
+                    return SQL_RESULT_NO_DATA;
+
+                const meta::ColumnMeta& currentColumn = *cursor;
+                uint8_t columnType = currentColumn.GetDataType();
+
+                switch (columnIdx)
+                {
+                    case TABLE_CAT:
                     {
-                        case TABLE_CAT:
-                        {
-                            buffer.PutNull();
-                            break;
-                        }
-
-                        case TABLE_SCHEM:
-                        {
-                            buffer.PutString(currentColumn.GetSchemaName());
-                            break;
-                        }
-
-                        case TABLE_NAME:
-                        {
-                            buffer.PutString(currentColumn.GetTableName());
-                            break;
-                        }
-
-                        case COLUMN_NAME:
-                        {
-                            buffer.PutString(currentColumn.GetColumnName());
-                            break;
-                        }
-
-                        case DATA_TYPE:
-                        {
-                            buffer.PutInt16(type_traits::BinaryToSqlType(columnType));
-                            break;
-                        }
-
-                        case TYPE_NAME:
-                        {
-                            buffer.PutString(currentColumn.GetColumnTypeName());
-                            break;
-                        }
-
-                        case COLUMN_SIZE:
-                        {
-                            buffer.PutInt16(type_traits::BinaryTypeColumnSize(columnType));
-                            break;
-                        }
-
-                        case BUFFER_LENGTH:
-                        {
-                            buffer.PutInt16(type_traits::BinaryTypeTransferLength(columnType));
-                            break;
-                        }
-
-                        case DECIMAL_DIGITS:
-                        {
-                            int32_t decDigits = type_traits::BinaryTypeDecimalDigits(columnType);
-                            if (decDigits < 0)
-                                buffer.PutNull();
-                            else
-                                buffer.PutInt16(static_cast<int16_t>(decDigits));
-                            break;
-                        }
-
-                        case NUM_PREC_RADIX:
-                        {
-                            buffer.PutInt16(type_traits::BinaryTypeNumPrecRadix(columnType));
-                            break;
-                        }
-
-                        case NULLABLE:
-                        {
-                            buffer.PutInt16(type_traits::BinaryTypeNullability(columnType));
-                            break;
-                        }
-
-                        case REMARKS:
-                        {
+                        buffer.PutNull();
+                        break;
+                    }
+
+                    case TABLE_SCHEM:
+                    {
+                        buffer.PutString(currentColumn.GetSchemaName());
+                        break;
+                    }
+
+                    case TABLE_NAME:
+                    {
+                        buffer.PutString(currentColumn.GetTableName());
+                        break;
+                    }
+
+                    case COLUMN_NAME:
+                    {
+                        buffer.PutString(currentColumn.GetColumnName());
+                        break;
+                    }
+
+                    case DATA_TYPE:
+                    {
+                        buffer.PutInt16(type_traits::BinaryToSqlType(columnType));
+                        break;
+                    }
+
+                    case TYPE_NAME:
+                    {
+                        buffer.PutString(currentColumn.GetColumnTypeName());
+                        break;
+                    }
+
+                    case COLUMN_SIZE:
+                    {
+                        buffer.PutInt16(type_traits::BinaryTypeColumnSize(columnType));
+                        break;
+                    }
+
+                    case BUFFER_LENGTH:
+                    {
+                        buffer.PutInt16(type_traits::BinaryTypeTransferLength(columnType));
+                        break;
+                    }
+
+                    case DECIMAL_DIGITS:
+                    {
+                        int32_t decDigits = type_traits::BinaryTypeDecimalDigits(columnType);
+                        if (decDigits < 0)
                             buffer.PutNull();
-                            break;
-                        }
+                        else
+                            buffer.PutInt16(static_cast<int16_t>(decDigits));
+                        break;
+                    }
 
-                        default:
-                            break;
+                    case NUM_PREC_RADIX:
+                    {
+                        buffer.PutInt16(type_traits::BinaryTypeNumPrecRadix(columnType));
+                        break;
                     }
-                }
 
-                ++cursor;
+                    case NULLABLE:
+                    {
+                        buffer.PutInt16(type_traits::BinaryTypeNullability(columnType));
+                        break;
+                    }
+
+                    case REMARKS:
+                    {
+                        buffer.PutNull();
+                        break;
+                    }
+
+                    default:
+                        break;
+                }
 
                 return SQL_RESULT_SUCCESS;
             }

http://git-wip-us.apache.org/repos/asf/ignite/blob/c4df7fc4/modules/platforms/cpp/odbc/odbc-driver/src/query/data_query.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/query/data_query.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/query/data_query.cpp
index b630993..4e9239b 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/query/data_query.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/query/data_query.cpp
@@ -58,7 +58,7 @@ namespace ignite
                 return resultMeta;
             }
 
-            SqlResult DataQuery::FetchNextRow(app::ColumnBindingMap & columnBindings)
+            SqlResult DataQuery::FetchNextRow(app::ColumnBindingMap& columnBindings)
             {
                 if (!cursor.get())
                 {
@@ -96,14 +96,12 @@ namespace ignite
                 {
                     app::ColumnBindingMap::iterator it = columnBindings.find(i);
 
-                    bool success;
+                    SqlResult result;
 
                     if (it != columnBindings.end())
-                        success = row->ReadColumnToBuffer(it->second);
-                    else
-                        success = row->SkipColumn();
+                        result = row->ReadColumnToBuffer(i, it->second);
 
-                    if (!success)
+                    if (result == SQL_RESULT_ERROR)
                     {
                         diag.AddStatusRecord(SQL_STATE_01S01_ERROR_IN_ROW, "Can not retrieve row column.", 0, i);
 
@@ -114,6 +112,32 @@ namespace ignite
                 return SQL_RESULT_SUCCESS;
             }
 
+            SqlResult DataQuery::GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer)
+            {
+                if (!cursor.get())
+                {
+                    diag.AddStatusRecord(SQL_STATE_HY010_SEQUENCE_ERROR, "Query was not executed.");
+
+                    return SQL_RESULT_ERROR;
+                }
+
+                Row* row = cursor->GetRow();
+
+                if (!row)
+                    return SQL_RESULT_NO_DATA;
+
+                SqlResult result = row->ReadColumnToBuffer(columnIdx, buffer);
+
+                if (result == SQL_RESULT_ERROR)
+                {
+                    diag.AddStatusRecord(SQL_STATE_HY000_GENERAL_ERROR, "Unknown column type.");
+
+                    return SQL_RESULT_ERROR;
+                }
+
+                return result;
+            }
+
             SqlResult DataQuery::Close()
             {
                 if (!cursor.get())

http://git-wip-us.apache.org/repos/asf/ignite/blob/c4df7fc4/modules/platforms/cpp/odbc/odbc-driver/src/query/foreign_keys_query.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/query/foreign_keys_query.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/query/foreign_keys_query.cpp
index 65246d6..78e1464 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/query/foreign_keys_query.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/query/foreign_keys_query.cpp
@@ -98,6 +98,18 @@ namespace ignite
                 return SQL_RESULT_NO_DATA;
             }
 
+            SqlResult ForeignKeysQuery::GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer)
+            {
+                if (!executed)
+                {
+                    diag.AddStatusRecord(SQL_STATE_HY010_SEQUENCE_ERROR, "Query was not executed.");
+
+                    return SQL_RESULT_ERROR;
+                }
+
+                return SQL_RESULT_NO_DATA;
+            }
+
             SqlResult ForeignKeysQuery::Close()
             {
                 executed = false;

http://git-wip-us.apache.org/repos/asf/ignite/blob/c4df7fc4/modules/platforms/cpp/odbc/odbc-driver/src/query/primary_keys_query.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/query/primary_keys_query.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/query/primary_keys_query.cpp
index a6c7f67..b616db3 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/query/primary_keys_query.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/query/primary_keys_query.cpp
@@ -120,55 +120,68 @@ namespace ignite
                 app::ColumnBindingMap::iterator it;
 
                 for (it = columnBindings.begin(); it != columnBindings.end(); ++it)
+                    GetColumn(it->first, it->second);
+
+                ++cursor;
+
+                return SQL_RESULT_SUCCESS;
+            }
+
+            SqlResult PrimaryKeysQuery::GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer)
+            {
+                if (!executed)
                 {
-                    uint16_t columnIdx = it->first;
-                    app::ApplicationDataBuffer& buffer = it->second;
-                    const meta::PrimaryKeyMeta& currentColumn = *cursor;
+                    diag.AddStatusRecord(SQL_STATE_HY010_SEQUENCE_ERROR, "Query was not executed.");
 
-                    switch (columnIdx)
+                    return SQL_RESULT_ERROR;
+                }
+
+                if (cursor == meta.end())
+                    return SQL_RESULT_NO_DATA;
+
+                const meta::PrimaryKeyMeta& currentColumn = *cursor;
+
+                switch (columnIdx)
+                {
+                    case TABLE_CAT:
                     {
-                        case TABLE_CAT:
-                        {
-                            buffer.PutString(currentColumn.GetCatalogName());
-                            break;
-                        }
-
-                        case TABLE_SCHEM:
-                        {
-                            buffer.PutString(currentColumn.GetSchemaName());
-                            break;
-                        }
-
-                        case TABLE_NAME:
-                        {
-                            buffer.PutString(currentColumn.GetTableName());
-                            break;
-                        }
-
-                        case COLUMN_NAME:
-                        {
-                            buffer.PutString(currentColumn.GetColumnName());
-                            break;
-                        }
-
-                        case KEY_SEQ:
-                        {
-                            buffer.PutInt16(currentColumn.GetKeySeq());
-                            break;
-                        }
-
-                        case PK_NAME:
-                        {
-                            buffer.PutString(currentColumn.GetKeyName());
-                            break;
-                        }
-
-                        default:
-                            break;
+                        buffer.PutString(currentColumn.GetCatalogName());
+                        break;
                     }
-                }
 
-                ++cursor;
+                    case TABLE_SCHEM:
+                    {
+                        buffer.PutString(currentColumn.GetSchemaName());
+                        break;
+                    }
+
+                    case TABLE_NAME:
+                    {
+                        buffer.PutString(currentColumn.GetTableName());
+                        break;
+                    }
+
+                    case COLUMN_NAME:
+                    {
+                        buffer.PutString(currentColumn.GetColumnName());
+                        break;
+                    }
+
+                    case KEY_SEQ:
+                    {
+                        buffer.PutInt16(currentColumn.GetKeySeq());
+                        break;
+                    }
+
+                    case PK_NAME:
+                    {
+                        buffer.PutString(currentColumn.GetKeyName());
+                        break;
+                    }
+
+                    default:
+                        break;
+                }
 
                 return SQL_RESULT_SUCCESS;
             }

http://git-wip-us.apache.org/repos/asf/ignite/blob/c4df7fc4/modules/platforms/cpp/odbc/odbc-driver/src/query/table_metadata_query.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/query/table_metadata_query.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/query/table_metadata_query.cpp
index 5375515..42850cf 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/query/table_metadata_query.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/query/table_metadata_query.cpp
@@ -121,49 +121,62 @@ namespace ignite
                 app::ColumnBindingMap::iterator it;
 
                 for (it = columnBindings.begin(); it != columnBindings.end(); ++it)
+                    GetColumn(it->first, it->second);
+
+                ++cursor;
+
+                return SQL_RESULT_SUCCESS;
+            }
+
+            SqlResult TableMetadataQuery::GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer & buffer)
+            {
+                if (!executed)
+                {
+                    diag.AddStatusRecord(SQL_STATE_HY010_SEQUENCE_ERROR, "Query was not executed.");
+
+                    return SQL_RESULT_ERROR;
+                }
+
+                if (cursor == meta.end())
+                    return SQL_RESULT_NO_DATA;
+
+                const meta::TableMeta& currentColumn = *cursor;
+
+                switch (columnIdx)
                 {
-                    uint16_t columnIdx = it->first;
-                    app::ApplicationDataBuffer& buffer = it->second;
-                    const meta::TableMeta& currentColumn = *cursor;
+                    case TABLE_CAT:
+                    {
+                        buffer.PutString(currentColumn.GetCatalogName());
+                        break;
+                    }
 
-                    switch (columnIdx)
+                    case TABLE_SCHEM:
                     {
-                        case TABLE_CAT:
-                        {
-                            buffer.PutString(currentColumn.GetCatalogName());
-                            break;
-                        }
-
-                        case TABLE_SCHEM:
-                        {
-                            buffer.PutString(currentColumn.GetSchemaName());
-                            break;
-                        }
-
-                        case TABLE_NAME:
-                        {
-                            buffer.PutString(currentColumn.GetTableName());
-                            break;
-                        }
-
-                        case TABLE_TYPE:
-                        {
-                            buffer.PutString(currentColumn.GetTableType());
-                            break;
-                        }
-
-                        case REMARKS:
-                        {
-                            buffer.PutNull();
-                            break;
-                        }
-
-                        default:
-                            break;
+                        buffer.PutString(currentColumn.GetSchemaName());
+                        break;
                     }
-                }
 
-                ++cursor;
+                    case TABLE_NAME:
+                    {
+                        buffer.PutString(currentColumn.GetTableName());
+                        break;
+                    }
+
+                    case TABLE_TYPE:
+                    {
+                        buffer.PutString(currentColumn.GetTableType());
+                        break;
+                    }
+
+                    case REMARKS:
+                    {
+                        buffer.PutNull();
+                        break;
+                    }
+
+                    default:
+                        break;
+                }
 
                 return SQL_RESULT_SUCCESS;
             }

http://git-wip-us.apache.org/repos/asf/ignite/blob/c4df7fc4/modules/platforms/cpp/odbc/odbc-driver/src/query/type_info_query.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/query/type_info_query.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/query/type_info_query.cpp
index 69766a1..efba734 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/query/type_info_query.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/query/type_info_query.cpp
@@ -193,8 +193,6 @@ namespace ignite
 
             SqlResult TypeInfoQuery::FetchNextRow(app::ColumnBindingMap & columnBindings)
             {
-                using namespace ignite::impl::binary;
-
                 if (!executed)
                 {
                     diag.AddStatusRecord(SQL_STATE_HY010_SEQUENCE_ERROR, "Query was not executed.");
@@ -208,151 +206,166 @@ namespace ignite
                 app::ColumnBindingMap::iterator it;
 
                 for (it = columnBindings.begin(); it != columnBindings.end(); ++it)
+                    GetColumn(it->first, it->second);
+
+                ++cursor;
+
+                return SQL_RESULT_SUCCESS;
+            }
+
+            SqlResult TypeInfoQuery::GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer & buffer)
+            {
+                using namespace ignite::impl::binary;
+
+                if (!executed)
                 {
-                    uint16_t columnIdx = it->first;
-                    app::ApplicationDataBuffer& buffer = it->second;
-                    int8_t currentType = *cursor;
+                    diag.AddStatusRecord(SQL_STATE_HY010_SEQUENCE_ERROR, "Query was not executed.");
+
+                    return SQL_RESULT_ERROR;
+                }
+
+                if (cursor == types.end())
+                    return SQL_RESULT_NO_DATA;
+
+                int8_t currentType = *cursor;
 
-                    switch (columnIdx)
+                switch (columnIdx)
+                {
+                    case TYPE_NAME:
                     {
-                        case TYPE_NAME:
-                        {
-                            buffer.PutString(type_traits::BinaryTypeToSqlTypeName(currentType));
-
-                            break;
-                        }
-
-                        case DATA_TYPE:
-                        case SQL_DATA_TYPE:
-                        {
-                            buffer.PutInt16(type_traits::BinaryToSqlType(currentType));
-
-                            break;
-                        }
-
-                        case COLUMN_SIZE:
-                        {
-                            buffer.PutInt32(type_traits::BinaryTypeColumnSize(currentType));
-
-                            break;
-                        }
-
-                        case LITERAL_PREFIX:
-                        {
-                            if (currentType == IGNITE_TYPE_STRING)
-                                buffer.PutString("'");
-                            else if (currentType == IGNITE_TYPE_BINARY)
-                                buffer.PutString("0x");
-                            else
-                                buffer.PutNull();
-
-                            break;
-                        }
-
-                        case LITERAL_SUFFIX:
-                        {
-                            if (currentType == IGNITE_TYPE_STRING)
-                                buffer.PutString("'");
-                            else
-                                buffer.PutNull();
-
-                            break;
-                        }
-
-                        case CREATE_PARAMS:
-                        {
-                            buffer.PutNull();
+                        buffer.PutString(type_traits::BinaryTypeToSqlTypeName(currentType));
 
-                            break;
-                        }
+                        break;
+                    }
 
-                        case NULLABLE:
-                        {
-                            buffer.PutInt32(type_traits::BinaryTypeNullability(currentType));
+                    case DATA_TYPE:
+                    case SQL_DATA_TYPE:
+                    {
+                        buffer.PutInt16(type_traits::BinaryToSqlType(currentType));
+
+                        break;
+                    }
 
-                            break;
-                        }
+                    case COLUMN_SIZE:
+                    {
+                        buffer.PutInt32(type_traits::BinaryTypeColumnSize(currentType));
 
-                        case CASE_SENSITIVE:
-                        {
-                            if (currentType == IGNITE_TYPE_STRING)
-                                buffer.PutInt16(SQL_TRUE);
-                            else
-                                buffer.PutInt16(SQL_FALSE);
+                        break;
+                    }
 
-                            break;
-                        }
+                    case LITERAL_PREFIX:
+                    {
+                        if (currentType == IGNITE_TYPE_STRING)
+                            buffer.PutString("'");
+                        else if (currentType == IGNITE_TYPE_BINARY)
+                            buffer.PutString("0x");
+                        else
+                            buffer.PutNull();
 
-                        case SEARCHABLE:
-                        {
-                            buffer.PutInt16(SQL_SEARCHABLE);
+                        break;
+                    }
 
-                            break;
-                        }
+                    case LITERAL_SUFFIX:
+                    {
+                        if (currentType == IGNITE_TYPE_STRING)
+                            buffer.PutString("'");
+                        else
+                            buffer.PutNull();
 
-                        case UNSIGNED_ATTRIBUTE:
-                        {
-                            buffer.PutInt16(type_traits::BinaryTypeUnsigned(currentType));
+                        break;
+                    }
 
-                            break;
-                        }
+                    case CREATE_PARAMS:
+                    {
+                        buffer.PutNull();
 
-                        case FIXED_PREC_SCALE:
-                        {
-                            buffer.PutInt16(SQL_FALSE);
+                        break;
+                    }
 
-                            break;
-                        }
+                    case NULLABLE:
+                    {
+                        buffer.PutInt32(type_traits::BinaryTypeNullability(currentType));
 
-                        case AUTO_UNIQUE_VALUE:
-                        {
+                        break;
+                    }
+
+                    case CASE_SENSITIVE:
+                    {
+                        if (currentType == IGNITE_TYPE_STRING)
+                            buffer.PutInt16(SQL_TRUE);
+                        else
                             buffer.PutInt16(SQL_FALSE);
 
-                            break;
-                        }
+                        break;
+                    }
 
-                        case LOCAL_TYPE_NAME:
-                        {
-                            buffer.PutNull();
+                    case SEARCHABLE:
+                    {
+                        buffer.PutInt16(SQL_SEARCHABLE);
 
-                            break;
-                        }
+                        break;
+                    }
 
-                        case MINIMUM_SCALE:
-                        case MAXIMUM_SCALE:
-                        {
-                            buffer.PutInt16(type_traits::BinaryTypeDecimalDigits(currentType));
+                    case UNSIGNED_ATTRIBUTE:
+                    {
+                        buffer.PutInt16(type_traits::BinaryTypeUnsigned(currentType));
 
-                            break;
-                        }
+                        break;
+                    }
 
-                        case SQL_DATETIME_SUB:
-                        {
-                            buffer.PutNull();
+                    case FIXED_PREC_SCALE:
+                    {
+                        buffer.PutInt16(SQL_FALSE);
 
-                            break;
-                        }
+                        break;
+                    }
 
-                        case NUM_PREC_RADIX:
-                        {
-                            buffer.PutInt32(type_traits::BinaryTypeNumPrecRadix(currentType));
+                    case AUTO_UNIQUE_VALUE:
+                    {
+                        buffer.PutInt16(SQL_FALSE);
 
-                            break;
-                        }
+                        break;
+                    }
 
-                        case INTERVAL_PRECISION:
-                        {
-                            buffer.PutNull();
+                    case LOCAL_TYPE_NAME:
+                    {
+                        buffer.PutNull();
 
-                            break;
-                        }
+                        break;
+                    }
+
+                    case MINIMUM_SCALE:
+                    case MAXIMUM_SCALE:
+                    {
+                        buffer.PutInt16(type_traits::BinaryTypeDecimalDigits(currentType));
 
-                        default:
-                            break;
+                        break;
                     }
-                }
 
-                ++cursor;
+                    case SQL_DATETIME_SUB:
+                    {
+                        buffer.PutNull();
+
+                        break;
+                    }
+
+                    case NUM_PREC_RADIX:
+                    {
+                        buffer.PutInt32(type_traits::BinaryTypeNumPrecRadix(currentType));
+
+                        break;
+                    }
+
+                    case INTERVAL_PRECISION:
+                    {
+                        buffer.PutNull();
+
+                        break;
+                    }
+
+                    default:
+                        break;
+                }
 
                 return SQL_RESULT_SUCCESS;
             }

http://git-wip-us.apache.org/repos/asf/ignite/blob/c4df7fc4/modules/platforms/cpp/odbc/odbc-driver/src/row.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/row.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/row.cpp
index d048674..5e5a00e 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/row.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/row.cpp
@@ -20,52 +20,17 @@
 #include "ignite/odbc/utility.h"
 #include "ignite/odbc/row.h"
 
-namespace
-{
-    using namespace ignite::impl::interop;
-    using namespace ignite::impl::binary;
-
-    bool GetObjectLength(InteropInputStream& stream, int32_t& len)
-    {
-        InteropStreamPositionGuard<InteropInputStream> guard(stream);
-
-        int8_t hdr = stream.ReadInt8();
-
-        if (hdr != IGNITE_HDR_FULL)
-            return false;
-
-        int8_t protoVer = stream.ReadInt8();
-
-        if (protoVer != IGNITE_PROTO_VER)
-            return false;
-
-        // Skipping flags
-        stream.ReadInt16();
-
-        // Skipping typeId
-        stream.ReadInt32();
-
-        // Skipping hash code
-        stream.ReadInt32();
-
-        len = stream.ReadInt32();
-
-        return true;
-    }
-}
-
 namespace ignite
 {
     namespace odbc
     {
         Row::Row(ignite::impl::interop::InteropUnpooledMemory& pageData) :
-            size(0), pos(0), rowBeginPos(0), pageData(pageData), stream(&pageData), reader(&stream)
+            rowBeginPos(0), pos(rowBeginPos), size(0), pageData(pageData),
+            stream(&pageData), reader(&stream), columns()
         {
             if (pageData.Length() >= 4)
             {
-                size = stream.ReadInt32();
-
-                rowBeginPos = stream.Position();
+                Reinit();
             }
         }
 
@@ -74,286 +39,81 @@ namespace ignite
             // No-op.
         }
 
-        int8_t Row::ReadColumnHeader()
+        bool Row::EnsureColumnDiscovered(uint16_t columnIdx)
         {
-            using namespace ignite::impl::binary;
-
-            int32_t headerPos = stream.Position();
-
-            int8_t hdr = stream.ReadInt8();
-
-            // Check if we need to restore position - to read complex types
-            // stream should have unread header, but for primitive types it
-            // should not.
-            switch (hdr)
-            {
-                case IGNITE_TYPE_BYTE:
-                case IGNITE_TYPE_SHORT:
-                case IGNITE_TYPE_CHAR:
-                case IGNITE_TYPE_INT:
-                case IGNITE_TYPE_LONG:
-                case IGNITE_TYPE_FLOAT:
-                case IGNITE_TYPE_DOUBLE:
-                case IGNITE_TYPE_BOOL:
-                case IGNITE_HDR_NULL:
-                {
-                    // No-op.
-                    break;
-                }
+            if (columns.size() >= columnIdx)
+                return true;
 
-                default:
-                {
-                    // Restoring position.
-                    stream.Position(headerPos);
-                    break;
-                }
-            }
-
-            return hdr;
-        }
-
-        bool Row::ReadColumnToBuffer(app::ApplicationDataBuffer& dataBuf)
-        {
-            using namespace ignite::impl::binary;
-            using namespace ignite::impl::interop;
-
-            if (pos == size)
+            if (columnIdx > GetSize() || columnIdx < 1)
                 return false;
 
-            int8_t hdr = ReadColumnHeader();
-
-            switch (hdr)
+            if (columns.empty())
             {
-                case IGNITE_TYPE_BYTE:
-                {
-                    dataBuf.PutInt8(reader.ReadInt8());
-                    break;
-                }
-
-                case IGNITE_TYPE_SHORT:
-                case IGNITE_TYPE_CHAR:
-                {
-                    dataBuf.PutInt16(reader.ReadInt16());
-                    break;
-                }
-
-                case IGNITE_TYPE_INT:
-                {
-                    dataBuf.PutInt32(reader.ReadInt32());
-                    break;
-                }
-
-                case IGNITE_TYPE_LONG:
-                {
-                    dataBuf.PutInt64(reader.ReadInt64());
-                    break;
-                }
-
-                case IGNITE_TYPE_FLOAT:
-                {
-                    dataBuf.PutFloat(reader.ReadFloat());
-                    break;
-                }
-
-                case IGNITE_TYPE_DOUBLE:
-                {
-                    dataBuf.PutDouble(reader.ReadDouble());
-                    break;
-                }
-
-                case IGNITE_TYPE_BOOL:
-                {
-                    dataBuf.PutInt8(reader.ReadBool() ? 1 : 0);
-                    break;
-                }
-
-                case IGNITE_TYPE_STRING:
-                {
-                    std::string str;
-                    utility::ReadString(reader, str);
-
-                    dataBuf.PutString(str);
-                    break;
-                }
-
-                case IGNITE_TYPE_UUID:
-                {
-                    Guid guid = reader.ReadGuid();
-
-                    dataBuf.PutGuid(guid);
-                    break;
-                }
-
-                case IGNITE_HDR_NULL:
-                {
-                    dataBuf.PutNull();
+                Column newColumn(reader);
 
-                    break;
-                }
-
-                case IGNITE_HDR_FULL:
-                {
-                    int32_t len;
-
-                    if (!GetObjectLength(stream, len))
-                        return false;
-
-                    int32_t offset = stream.Position();
-
-                    dataBuf.PutBinaryData(pageData.Data() + offset, static_cast<size_t>(len));
-
-                    stream.Position(stream.Position() + len);
-
-                    break;
-                }
+                if (!newColumn.IsValid())
+                    return false;
 
-                case IGNITE_TYPE_DECIMAL:
-                {
-                    Decimal res;
+                columns.push_back(newColumn);
+            }
 
-                    utility::ReadDecimal(reader, res);
+            while (columns.size() < columnIdx)
+            {
+                Column& column = columns.back();
 
-                    dataBuf.PutDecimal(res);
+                stream.Position(column.GetEndPosition());
 
-                    break;
-                }
+                Column newColumn(reader);
 
-                case IGNITE_TYPE_DATE:
-                default:
-                {
-                    // This is a fail case. Return false.
+                if (!newColumn.IsValid())
                     return false;
-                }
+
+                columns.push_back(newColumn);
             }
 
-            ++pos;
             return true;
         }
 
-        bool Row::SkipColumn()
+        SqlResult Row::ReadColumnToBuffer(uint16_t columnIdx, app::ApplicationDataBuffer& dataBuf)
         {
             using namespace ignite::impl::binary;
             using namespace ignite::impl::interop;
 
-            if (pos == size)
-                return false;
-
-            int8_t hdr = ReadColumnHeader();
-
-            switch (hdr)
-            {
-                case IGNITE_TYPE_BYTE:
-                {
-                    reader.ReadInt8();
-                    break;
-                }
-
-                case IGNITE_TYPE_SHORT:
-                case IGNITE_TYPE_CHAR:
-                {
-                    reader.ReadInt16();
-                    break;
-                }
-
-                case IGNITE_TYPE_INT:
-                {
-                    reader.ReadInt32();
-                    break;
-                }
-
-                case IGNITE_TYPE_LONG:
-                {
-                    reader.ReadInt64();
-                    break;
-                }
-
-                case IGNITE_TYPE_FLOAT:
-                {
-                    reader.ReadFloat();
-                    break;
-                }
-
-                case IGNITE_TYPE_DOUBLE:
-                {
-                    reader.ReadDouble();
-                    break;
-                }
-
-                case IGNITE_TYPE_BOOL:
-                {
-                    reader.ReadBool();
-                    break;
-                }
-
-                case IGNITE_TYPE_STRING:
-                {
-                    std::string str;
-                    utility::ReadString(reader, str);
+            if (!EnsureColumnDiscovered(columnIdx))
+                return SQL_RESULT_ERROR;
 
-                    break;
-                }
+            Column& column = GetColumn(columnIdx);
 
-                case IGNITE_TYPE_UUID:
-                {
-                    Guid guid = reader.ReadGuid();
-
-                    break;
-                }
-
-                case IGNITE_HDR_NULL:
-                {
-                    // No-op.
-                    break;
-                }
-
-                case IGNITE_HDR_FULL:
-                {
-                    int32_t len;
-
-                    if (!GetObjectLength(stream, len))
-                        return false;
-
-                    stream.Position(stream.Position() + len);
+            return column.ReadToBuffer(reader, dataBuf);
+        }
 
-                    break;
-                }
+        bool Row::MoveToNext()
+        {
+            int32_t lastColumnIdx = GetSize();
 
-                case IGNITE_TYPE_DECIMAL:
-                {
-                    Decimal res;
+            if (!EnsureColumnDiscovered(lastColumnIdx))
+                return false;
 
-                    utility::ReadDecimal(reader, res);
+            Column& lastColumn = GetColumn(lastColumnIdx);
 
-                    break;
-                }
+            stream.Position(lastColumn.GetEndPosition());
 
-                case IGNITE_TYPE_DATE:
-                default:
-                {
-                    // This is a fail case. Return false.
-                    return false;
-                }
-            }
+            Reinit();
 
-            ++pos;
             return true;
         }
 
-        bool Row::MoveToNext()
+        void Row::Reinit()
         {
-            for (int32_t i = pos; i < size; ++i)
-            {
-                if (!SkipColumn())
-                    return false;
-            }
-
             size = stream.ReadInt32();
 
             rowBeginPos = stream.Position();
 
-            pos = 0;
+            columns.clear();
 
-            return true;
+            columns.reserve(size);
+
+            pos = 0;
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/c4df7fc4/modules/platforms/cpp/odbc/odbc-driver/src/statement.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/statement.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/statement.cpp
index e31d75a..81cb523 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/statement.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/statement.cpp
@@ -159,6 +159,25 @@ namespace ignite
             return paramBindOffset;
         }
 
+        void Statement::GetColumnData(uint16_t columnIdx, app::ApplicationDataBuffer& buffer)
+        {
+            IGNITE_ODBC_API_CALL(InternalGetColumnData(columnIdx, buffer));
+        }
+
+        SqlResult Statement::InternalGetColumnData(uint16_t columnIdx, app::ApplicationDataBuffer& buffer)
+        {
+            if (!currentQuery.get())
+            {
+                AddStatusRecord(SQL_STATE_24000_INVALID_CURSOR_STATE, "Cursor is not in the open state.");
+
+                return SQL_RESULT_ERROR;
+            }
+
+            SqlResult res = currentQuery->GetColumn(columnIdx, buffer);
+
+            return res;
+        }
+
         void Statement::PrepareSqlQuery(const std::string& query)
         {
             return PrepareSqlQuery(query.data(), query.size());
@@ -365,8 +384,6 @@ namespace ignite
 
             SqlResult res = currentQuery->FetchNextRow(columnBindings);
 
-            LOG_MSG("Result: %d\n", res);
-
             if (res == SQL_RESULT_SUCCESS)
             {
                 if (rowsFetched)

http://git-wip-us.apache.org/repos/asf/ignite/blob/c4df7fc4/modules/platforms/cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj b/modules/platforms/cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj
index 1572340..5e5d636 100644
--- a/modules/platforms/cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj
+++ b/modules/platforms/cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj
@@ -153,6 +153,7 @@
   </ItemDefinitionGroup>
   <ItemGroup>
     <ClCompile Include="..\..\..\odbc-driver\src\app\application_data_buffer.cpp" />
+    <ClCompile Include="..\..\..\odbc-driver\src\column.cpp" />
     <ClCompile Include="..\..\..\odbc-driver\src\config\configuration.cpp" />
     <ClCompile Include="..\..\..\odbc-driver\src\config\connection_info.cpp" />
     <ClCompile Include="..\..\..\odbc-driver\src\cursor.cpp" />

http://git-wip-us.apache.org/repos/asf/ignite/blob/c4df7fc4/modules/platforms/cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj.filters
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj.filters b/modules/platforms/cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj.filters
index 0591e93..7daaf03 100644
--- a/modules/platforms/cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj.filters
+++ b/modules/platforms/cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj.filters
@@ -64,6 +64,9 @@
     <ClCompile Include="..\..\..\odbc-driver\src\decimal.cpp">
       <Filter>Externals</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\..\odbc-driver\src\column.cpp">
+      <Filter>Externals</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\include\teamcity_messages.h">

http://git-wip-us.apache.org/repos/asf/ignite/blob/c4df7fc4/modules/platforms/cpp/odbc/odbc-test/src/row_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-test/src/row_test.cpp b/modules/platforms/cpp/odbc/odbc-test/src/row_test.cpp
index a0eed39..86e5203 100644
--- a/modules/platforms/cpp/odbc/odbc-test/src/row_test.cpp
+++ b/modules/platforms/cpp/odbc/odbc-test/src/row_test.cpp
@@ -33,7 +33,7 @@ using namespace ignite::odbc;
 std::string GetStrColumnValue(size_t rowIdx)
 {
     std::stringstream generator("Column 2 test string, row num: ");
-    generator << rowIdx;
+    generator << rowIdx << ". Some trailing bytes";
 
     return generator.str();
 }
@@ -92,11 +92,11 @@ void CheckRowData(Row& row, size_t rowIdx)
     BOOST_REQUIRE(row.GetSize() == 4);
 
     // Checking 1st column.
-    BOOST_REQUIRE(row.ReadColumnToBuffer(appLongBuf));
+    BOOST_REQUIRE(row.ReadColumnToBuffer(1, appLongBuf) == SQL_RESULT_SUCCESS);
     BOOST_REQUIRE(longBuf == rowIdx * 10);
 
     // Checking 2nd column.
-    BOOST_REQUIRE(row.ReadColumnToBuffer(appStrBuf));
+    BOOST_REQUIRE(row.ReadColumnToBuffer(2, appStrBuf) == SQL_RESULT_SUCCESS);
 
     std::string strReal(strBuf, static_cast<size_t>(reslen));
     std::string strExpected(GetStrColumnValue(rowIdx));
@@ -104,7 +104,7 @@ void CheckRowData(Row& row, size_t rowIdx)
     BOOST_REQUIRE(strReal == strExpected);
 
     // Checking 3rd column.
-    BOOST_REQUIRE(row.ReadColumnToBuffer(appGuidBuf));
+    BOOST_REQUIRE(row.ReadColumnToBuffer(3, appGuidBuf) == SQL_RESULT_SUCCESS);
 
     BOOST_REQUIRE(guidBuf.Data1 == 0x2b218f63UL);
     BOOST_REQUIRE(guidBuf.Data2 == 0x642aU);
@@ -120,7 +120,7 @@ void CheckRowData(Row& row, size_t rowIdx)
     BOOST_REQUIRE(guidBuf.Data4[7] == 0x98 + rowIdx);
 
     // Checking 4th column.
-    BOOST_REQUIRE(row.ReadColumnToBuffer(appBitBuf));
+    BOOST_REQUIRE(row.ReadColumnToBuffer(4, appBitBuf) == SQL_RESULT_SUCCESS);
     BOOST_REQUIRE(bitBuf == rowIdx % 2);
 }
 
@@ -144,26 +144,26 @@ BOOST_AUTO_TEST_CASE(TestRowMoveToNext)
     }
 }
 
-BOOST_AUTO_TEST_CASE(TestRowSkip)
-{
-    ignite::impl::interop::InteropUnpooledMemory mem(4096);
-
-    const size_t rowNum = 8;
-
-    FillMemWithData(mem, rowNum);
-
-    Row row(mem);
-
-    for (size_t i = 0; i < rowNum - 1; ++i)
-    {
-        BOOST_REQUIRE(row.GetSize() == 4);
-
-        for (int32_t j = 0; j < row.GetSize(); ++j)
-            BOOST_REQUIRE(row.SkipColumn());
-
-        BOOST_REQUIRE(row.MoveToNext());
-    }
-}
+//BOOST_AUTO_TEST_CASE(TestRowSkip)
+//{
+//    ignite::impl::interop::InteropUnpooledMemory mem(4096);
+//
+//    const size_t rowNum = 8;
+//
+//    FillMemWithData(mem, rowNum);
+//
+//    Row row(mem);
+//
+//    for (size_t i = 0; i < rowNum - 1; ++i)
+//    {
+//        BOOST_REQUIRE(row.GetSize() == 4);
+//
+//        for (int32_t j = 0; j < row.GetSize(); ++j)
+//            BOOST_REQUIRE(row.SkipColumn());
+//
+//        BOOST_REQUIRE(row.MoveToNext());
+//    }
+//}
 
 BOOST_AUTO_TEST_CASE(TestRowRead)
 {


[09/50] ignite git commit: IGNITE-2223: Fix for tests.

Posted by vo...@apache.org.
IGNITE-2223: Fix for tests.


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

Branch: refs/heads/ignite-1786
Commit: 9c904bfd955c3e09e7983e26a99756016555e0df
Parents: 7e32752
Author: isapego <is...@gridgain.com>
Authored: Mon Jan 11 21:34:26 2016 +0300
Committer: isapego <is...@gridgain.com>
Committed: Mon Jan 11 21:34:26 2016 +0300

----------------------------------------------------------------------
 modules/platforms/cpp/odbc/odbc-driver/src/decimal.cpp       | 8 ++++----
 modules/platforms/cpp/odbc/odbc-driver/src/utility.cpp       | 4 ++--
 .../cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj          | 1 +
 .../cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj.filters  | 3 +++
 4 files changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/9c904bfd/modules/platforms/cpp/odbc/odbc-driver/src/decimal.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/decimal.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/decimal.cpp
index 2df48d8..af16747 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/decimal.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/decimal.cpp
@@ -28,7 +28,7 @@ namespace ignite
     {
     }
 
-    Decimal::Decimal(int32_t scale, const int8_t * mag, int32_t len) :
+    Decimal::Decimal(int32_t scale, const int8_t* mag, int32_t len) :
         scale(scale), len(len), magnitude(0)
     {
         magnitude = new int8_t[len];
@@ -36,7 +36,7 @@ namespace ignite
         memcpy(magnitude, mag, len);
     }
 
-    Decimal::Decimal(const Decimal & other) :
+    Decimal::Decimal(const Decimal& other) :
         scale(other.scale), len(other.len), magnitude(0)
     {
         magnitude = new int8_t[len];
@@ -69,12 +69,12 @@ namespace ignite
         return scale;
     }
 
-    const int8_t * Decimal::GetMagnitude() const
+    const int8_t* Decimal::GetMagnitude() const
     {
         return magnitude;
     }
 
-    void swap(Decimal & first, Decimal & second)
+    void swap(Decimal& first, Decimal& second)
     {
         using std::swap;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/9c904bfd/modules/platforms/cpp/odbc/odbc-driver/src/utility.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/utility.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/utility.cpp
index 3d30d43..c7210c3 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/utility.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/utility.cpp
@@ -75,9 +75,9 @@ namespace ignite
 
             mag.resize(len);
 
-            reader.ReadInt8Array(mag.data(), mag.size());
+            reader.ReadInt8Array(mag.data(), static_cast<int32_t>(mag.size()));
 
-            Decimal res(scale, mag.data(), mag.size());
+            Decimal res(scale, mag.data(), static_cast<int32_t>(mag.size()));
 
             swap(decimal, res);
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/9c904bfd/modules/platforms/cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj b/modules/platforms/cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj
index ce4ce0b..8c90fa6 100644
--- a/modules/platforms/cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj
+++ b/modules/platforms/cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj
@@ -153,6 +153,7 @@
     <ClCompile Include="..\..\..\odbc-driver\src\config\configuration.cpp" />
     <ClCompile Include="..\..\..\odbc-driver\src\config\connection_info.cpp" />
     <ClCompile Include="..\..\..\odbc-driver\src\cursor.cpp" />
+    <ClCompile Include="..\..\..\odbc-driver\src\decimal.cpp" />
     <ClCompile Include="..\..\..\odbc-driver\src\result_page.cpp" />
     <ClCompile Include="..\..\..\odbc-driver\src\row.cpp" />
     <ClCompile Include="..\..\..\odbc-driver\src\utility.cpp" />

http://git-wip-us.apache.org/repos/asf/ignite/blob/9c904bfd/modules/platforms/cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj.filters
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj.filters b/modules/platforms/cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj.filters
index 7f58082..0591e93 100644
--- a/modules/platforms/cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj.filters
+++ b/modules/platforms/cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj.filters
@@ -61,6 +61,9 @@
     <ClCompile Include="..\..\..\odbc-driver\src\app\application_data_buffer.cpp">
       <Filter>Externals</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\..\odbc-driver\src\decimal.cpp">
+      <Filter>Externals</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\include\teamcity_messages.h">


[44/50] ignite git commit: IGNITE-2248: Implmented Statement::InternalExecuteSpecialColumnsQuery.

Posted by vo...@apache.org.
IGNITE-2248: Implmented Statement::InternalExecuteSpecialColumnsQuery.


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

Branch: refs/heads/ignite-1786
Commit: 8b1db4ef54f83a70e5a92aa7c7c8d15ad51fb368
Parents: d86a82c
Author: isapego <is...@gridgain.com>
Authored: Thu Jan 21 17:27:27 2016 +0300
Committer: isapego <is...@gridgain.com>
Committed: Thu Jan 21 17:27:27 2016 +0300

----------------------------------------------------------------------
 .../include/ignite/odbc/common_types.h          | 47 +++++++++++---------
 .../ignite/odbc/query/special_columns_query.h   |  2 +-
 .../cpp/odbc/odbc-driver/src/statement.cpp      | 17 ++++++-
 3 files changed, 42 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/8b1db4ef/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/common_types.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/common_types.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/common_types.h
index c065872..8e1dbf2 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/common_types.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/common_types.h
@@ -73,48 +73,49 @@ namespace ignite
             SQL_STATE_24000_INVALID_CURSOR_STATE,
 
             /**
-            * The driver was unable to establish a connection with the data
-            * source.
-            */
+             * The driver was unable to establish a connection with the data
+             * source.
+             */
             SQL_STATE_08001_CANNOT_CONNECT,
 
             /**
-            * The specified ConnectionHandle had already been used
-            * to establish a connection with a data source, and the connection
-            * was still open.
-            */
+             * The specified ConnectionHandle had already been used
+             * to establish a connection with a data source, and the connection
+             * was still open.
+             */
             SQL_STATE_08002_ALREADY_CONNECTED,
 
             /** The connection specified was not open. */
             SQL_STATE_08003_NOT_CONNECTED,
 
             /**
-            * An error occurred for which there was no specific SQLSTATE
-            * and for which no implementation-specific SQLSTATE was defined.
-            */
+             * An error occurred for which there was no specific SQLSTATE
+             * and for which no implementation-specific SQLSTATE was defined.
+             */
             SQL_STATE_HY000_GENERAL_ERROR,
 
             /**
-            * The driver was unable to allocate memory for the specified
-            * handle.
-            */
+             * The driver was unable to allocate memory for the specified
+             * handle.
+             */
             SQL_STATE_HY001_MEMORY_ALLOCATION,
 
-            /**
-            * Function sequence error.
-            */
+            /** Function sequence error. */
             SQL_STATE_HY010_SEQUENCE_ERROR,
 
+            /** Column type out of range. */
+            SQL_STATE_HY097_COLUMN_TYPE_OUT_OF_RANGE,
+
             /**
-            * The driver does not support the feature of ODBC behavior that
-            * the application requested.
-            */
+             * The driver does not support the feature of ODBC behavior that
+             * the application requested.
+             */
             SQL_STATE_HYC00_OPTIONAL_FEATURE_NOT_IMPLEMENTED,
 
             /**
-            * The connection timeout period expired before the data source
-            * responded to the request.
-            */
+             * The connection timeout period expired before the data source
+             * responded to the request.
+             */
             SQL_STATE_HYT01_CONNECTIOIN_TIMEOUT
         };
 
@@ -216,6 +217,8 @@ namespace ignite
          * @return Internal EnvironmentAttribute type value.
          */
         EnvironmentAttribute EnvironmentAttributeToInternal(int32_t attr);
+
+
     }
 }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/8b1db4ef/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/special_columns_query.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/special_columns_query.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/special_columns_query.h
index ad45791..f5affad 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/special_columns_query.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/special_columns_query.h
@@ -29,7 +29,7 @@ namespace ignite
             /**
              * Special columns query.
              */
-            class SpecialColumnsQuery : Query
+            class SpecialColumnsQuery : public Query
             {
             public:
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/8b1db4ef/modules/platforms/cpp/odbc/odbc-driver/src/statement.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/statement.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/statement.cpp
index d7ea288..4bf0db9 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/statement.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/statement.cpp
@@ -22,6 +22,7 @@
 #include "ignite/odbc/query/foreign_keys_query.h"
 #include "ignite/odbc/query/primary_keys_query.h"
 #include "ignite/odbc/query/type_info_query.h"
+#include "ignite/odbc/query/special_columns_query.h"
 #include "ignite/odbc/connection.h"
 #include "ignite/odbc/utility.h"
 #include "ignite/odbc/message.h"
@@ -317,7 +318,21 @@ namespace ignite
             const std::string& catalog, const std::string& schema,
             const std::string& table, int16_t scope, int16_t nullable)
         {
-            return SQL_RESULT_ERROR;
+            if (type != SQL_BEST_ROWID && type != SQL_ROWVER)
+            {
+                AddStatusRecord(SQL_STATE_HY097_COLUMN_TYPE_OUT_OF_RANGE,
+                    "An invalid IdentifierType value was specified.");
+
+                return SQL_RESULT_ERROR;
+            }
+
+            if (currentQuery.get())
+                currentQuery->Close();
+
+            currentQuery.reset(new query::SpecialColumnsQuery(*this, type,
+                catalog, schema, table, scope, nullable));
+
+            return currentQuery->Execute();
         }
 
         void Statement::ExecuteGetTypeInfoQuery(int16_t sqlType)


[50/50] ignite git commit: IGNITE-1786: Review.

Posted by vo...@apache.org.
IGNITE-1786: Review.


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

Branch: refs/heads/ignite-1786
Commit: 1138cf8c7d4d081b58a5993934099d07c096dd07
Parents: 12835b4
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Mon Jan 25 14:52:56 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Mon Jan 25 14:52:56 2016 +0300

----------------------------------------------------------------------
 .../include/ignite/impl/interop/interop_stream_position_guard.h     | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/1138cf8c/modules/platforms/cpp/binary/include/ignite/impl/interop/interop_stream_position_guard.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/binary/include/ignite/impl/interop/interop_stream_position_guard.h b/modules/platforms/cpp/binary/include/ignite/impl/interop/interop_stream_position_guard.h
index a1c6e8a..92b835f 100644
--- a/modules/platforms/cpp/binary/include/ignite/impl/interop/interop_stream_position_guard.h
+++ b/modules/platforms/cpp/binary/include/ignite/impl/interop/interop_stream_position_guard.h
@@ -18,7 +18,6 @@
 #ifndef _IGNITE_IMPL_INTEROP_STREAM_POSITION_GUARD
 #define _IGNITE_IMPL_INTEROP_OUTPUT_POSITION_GUARD
 
-/// TODO: Consider replacing NULL with 0 and removing header.
 #include <cstddef>
 
 #include "ignite/impl/interop/interop_memory.h"


[14/50] ignite git commit: Merge remote-tracking branch 'upstream/ignite-1.5.4' into ignite-1786

Posted by vo...@apache.org.
Merge remote-tracking branch 'upstream/ignite-1.5.4' into ignite-1786


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

Branch: refs/heads/ignite-1786
Commit: 578167cea4cc652659aae4688715af67c4306df0
Parents: 0b8487f 92229d2
Author: isapego <is...@gridgain.com>
Authored: Wed Jan 13 13:09:12 2016 +0300
Committer: isapego <is...@gridgain.com>
Committed: Wed Jan 13 13:09:12 2016 +0300

----------------------------------------------------------------------
 examples/pom.xml                                |   2 +-
 examples/schema-import/pom.xml                  |   2 +-
 modules/aop/pom.xml                             |   4 +-
 modules/apache-license-gen/pom.xml              |   2 +-
 modules/aws/pom.xml                             |   2 +-
 modules/camel/pom.xml                           |   2 +-
 modules/clients/pom.xml                         |   2 +-
 modules/cloud/pom.xml                           |   2 +-
 modules/codegen/pom.xml                         |   2 +-
 modules/core/pom.xml                            |   2 +-
 .../configuration/FileSystemConfiguration.java  |  54 +-
 .../org/apache/ignite/igfs/IgfsUserContext.java |  16 +-
 .../igfs/secondary/IgfsSecondaryFileSystem.java |  14 -
 .../ignite/internal/MarshallerContextImpl.java  |  86 ++-
 .../internal/binary/BinaryClassDescriptor.java  |  15 +-
 .../version/GridCachePlainVersionedEntry.java   |   2 +-
 .../processors/hadoop/HadoopPayloadAware.java   |  28 +
 .../ignite/internal/processors/igfs/IgfsEx.java |  13 -
 .../internal/processors/igfs/IgfsImpl.java      |  28 +-
 .../internal/processors/igfs/IgfsPaths.java     |  62 +-
 .../igfs/IgfsSecondaryFileSystemImpl.java       |  11 -
 .../visor/node/VisorIgfsConfiguration.java      |  43 --
 .../core/src/main/resources/ignite.properties   |   2 +-
 ...eMarshallerCacheConcurrentReadWriteTest.java | 189 +++++
 .../dht/GridCacheTxNodeFailureSelfTest.java     |   6 +-
 .../processors/igfs/IgfsAbstractSelfTest.java   |   8 +-
 .../igfs/IgfsExUniversalFileSystemAdapter.java  |  11 +-
 .../igfs/UniversalFileSystemAdapter.java        |   5 +-
 .../ignite/testsuites/IgniteBasicTestSuite.java |   2 +
 modules/extdata/p2p/pom.xml                     |   2 +-
 .../extdata/uri/modules/uri-dependency/pom.xml  |   2 +-
 modules/extdata/uri/pom.xml                     |   2 +-
 modules/flume/pom.xml                           |   2 +-
 modules/gce/pom.xml                             |   2 +-
 modules/geospatial/pom.xml                      |  10 +-
 modules/hadoop/pom.xml                          |   2 +-
 .../hadoop/fs/BasicHadoopFileSystemFactory.java | 226 ++++++
 .../fs/CachingHadoopFileSystemFactory.java      |  86 +++
 .../hadoop/fs/HadoopFileSystemFactory.java      |  52 ++
 .../fs/IgniteHadoopIgfsSecondaryFileSystem.java | 260 +++----
 .../hadoop/fs/v1/IgniteHadoopFileSystem.java    | 154 +++--
 .../hadoop/fs/v2/IgniteHadoopFileSystem.java    | 122 ++--
 .../processors/hadoop/HadoopClassLoader.java    | 689 ++++++++++++++-----
 .../hadoop/SecondaryFileSystemProvider.java     | 139 ----
 .../hadoop/fs/HadoopFileSystemCacheUtils.java   |   8 +-
 .../hadoop/fs/HadoopLazyConcurrentMap.java      |   5 +-
 .../hadoop/v2/HadoopNativeCodeLoader.java       |  74 --
 .../ignite/igfs/Hadoop1DualAbstractTest.java    |  14 +-
 .../igfs/HadoopFIleSystemFactorySelfTest.java   | 326 +++++++++
 ...oopFileSystemUniversalFileSystemAdapter.java |  53 +-
 ...oopSecondaryFileSystemConfigurationTest.java |  27 +-
 .../IgniteHadoopFileSystemAbstractSelfTest.java |  71 +-
 ...condaryFileSystemInitializationSelfTest.java | 214 ++++++
 .../hadoop/HadoopAbstractWordCountTest.java     |  46 +-
 .../hadoop/HadoopClassLoaderTest.java           | 101 ++-
 .../hadoop/HadoopMapReduceEmbeddedSelfTest.java |   2 +-
 .../processors/hadoop/HadoopMapReduceTest.java  |  15 +-
 .../hadoop/HadoopSnappyFullMapReduceTest.java   |  28 +
 .../processors/hadoop/HadoopSnappyTest.java     | 102 +++
 .../processors/hadoop/HadoopTasksV2Test.java    |   2 +-
 .../hadoop/deps/CircularWIthHadoop.java         |  32 +
 .../hadoop/deps/CircularWithoutHadoop.java      |  27 +
 .../processors/hadoop/deps/WithCast.java        |  41 ++
 .../hadoop/deps/WithClassAnnotation.java        |  28 +
 .../hadoop/deps/WithConstructorInvocation.java  |  31 +
 .../processors/hadoop/deps/WithExtends.java     |  27 +
 .../processors/hadoop/deps/WithField.java       |  29 +
 .../processors/hadoop/deps/WithImplements.java  |  36 +
 .../hadoop/deps/WithIndirectField.java          |  27 +
 .../processors/hadoop/deps/WithInitializer.java |  33 +
 .../processors/hadoop/deps/WithInnerClass.java  |  31 +
 .../hadoop/deps/WithLocalVariable.java          |  38 +
 .../hadoop/deps/WithMethodAnnotation.java       |  32 +
 .../hadoop/deps/WithMethodArgument.java         |  31 +
 .../hadoop/deps/WithMethodCheckedException.java |  31 +
 .../hadoop/deps/WithMethodInvocation.java       |  31 +
 .../hadoop/deps/WithMethodReturnType.java       |  31 +
 .../hadoop/deps/WithMethodRuntimeException.java |  31 +
 .../processors/hadoop/deps/WithOuterClass.java  |  38 +
 .../hadoop/deps/WithParameterAnnotation.java    |  31 +
 .../processors/hadoop/deps/WithStaticField.java |  29 +
 .../hadoop/deps/WithStaticInitializer.java      |  34 +
 .../processors/hadoop/deps/Without.java         |  25 +
 .../hadoop/examples/HadoopWordCount1Reduce.java |   1 +
 .../hadoop/examples/HadoopWordCount2.java       |  18 +-
 .../examples/HadoopWordCount2Reducer.java       |   1 +
 .../testsuites/IgniteHadoopTestSuite.java       |  26 +-
 modules/hibernate/pom.xml                       |   2 +-
 modules/indexing/pom.xml                        |  10 +-
 modules/jcl/pom.xml                             |   4 +-
 modules/jms11/pom.xml                           |   2 +-
 modules/jta/pom.xml                             |   2 +-
 modules/kafka/pom.xml                           |   2 +-
 modules/log4j/pom.xml                           |   2 +-
 modules/log4j2/pom.xml                          |   4 +-
 modules/mesos/pom.xml                           |   2 +-
 modules/mqtt/pom.xml                            |   2 +-
 modules/osgi-karaf/pom.xml                      |   6 +-
 modules/osgi-paxlogging/pom.xml                 |   2 +-
 modules/osgi/pom.xml                            |  10 +-
 modules/platforms/cpp/common/configure.ac       |   2 +-
 modules/platforms/cpp/core-test/configure.ac    |   2 +-
 modules/platforms/cpp/core/configure.ac         |   2 +-
 modules/platforms/cpp/examples/configure.ac     |   2 +-
 modules/platforms/cpp/ignite/configure.ac       |   2 +-
 .../Properties/AssemblyInfo.cs                  |   8 +-
 .../Properties/AssemblyInfo.cs                  |   8 +-
 .../Properties/AssemblyInfo.cs                  |   8 +-
 .../Properties/AssemblyInfo.cs                  |   8 +-
 .../Apache.Ignite/Properties/AssemblyInfo.cs    |   8 +-
 .../Properties/AssemblyInfo.cs                  |   8 +-
 .../Properties/AssemblyInfo.cs                  |   8 +-
 modules/rest-http/pom.xml                       |   2 +-
 modules/scalar-2.10/pom.xml                     |   2 +-
 modules/scalar/pom.xml                          |   2 +-
 modules/schedule/pom.xml                        |   4 +-
 modules/schema-import/pom.xml                   |   2 +-
 modules/slf4j/pom.xml                           |   2 +-
 modules/spark-2.10/pom.xml                      |   2 +-
 modules/spark/pom.xml                           |   2 +-
 modules/spring/pom.xml                          |   4 +-
 modules/ssh/pom.xml                             |   2 +-
 modules/tools/pom.xml                           |   2 +-
 modules/twitter/pom.xml                         |   2 +-
 modules/urideploy/pom.xml                       |   2 +-
 modules/visor-console-2.10/pom.xml              |   2 +-
 modules/visor-console/pom.xml                   |   2 +-
 modules/visor-plugins/pom.xml                   |   2 +-
 modules/web/pom.xml                             |   4 +-
 modules/yardstick/pom.xml                       |   2 +-
 modules/yarn/pom.xml                            |   2 +-
 modules/zookeeper/pom.xml                       |   2 +-
 pom.xml                                         |   2 +-
 133 files changed, 3424 insertions(+), 965 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/578167ce/modules/platforms/cpp/core/configure.ac
----------------------------------------------------------------------


[37/50] ignite git commit: IGNITE-2243: Implemented EnvironmentAttribute.

Posted by vo...@apache.org.
IGNITE-2243: Implemented EnvironmentAttribute.


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

Branch: refs/heads/ignite-1786
Commit: a172649ff3979c5a51ba291cbe8a083d09dee397
Parents: 7037069
Author: isapego <is...@gridgain.com>
Authored: Wed Jan 20 20:45:42 2016 +0300
Committer: isapego <is...@gridgain.com>
Committed: Wed Jan 20 20:45:42 2016 +0300

----------------------------------------------------------------------
 .../include/ignite/odbc/common_types.h          | 26 +++++++++++++++++---
 .../cpp/odbc/odbc-driver/src/common_types.cpp   | 16 +++++++++++-
 .../cpp/odbc/odbc-driver/src/environment.cpp    | 10 ++++++--
 3 files changed, 46 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/a172649f/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/common_types.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/common_types.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/common_types.h
index 1d007fb..2e64857 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/common_types.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/common_types.h
@@ -117,6 +117,9 @@ namespace ignite
          */
         enum DiagnosticField
         {
+            /** Field type is unknown to the driver. */
+            IGNITE_SQL_DIAG_UNKNOWN,
+
             /** Header record field: Count of rows in the cursor. */
             IGNITE_SQL_DIAG_HEADER_CURSOR_ROW_COUNT,
 
@@ -166,10 +169,19 @@ namespace ignite
             IGNITE_SQL_DIAG_STATUS_SQLSTATE,
 
             /** Status record field: Subclass origin. */
-            IGNITE_SQL_DIAG_STATUS_SUBCLASS_ORIGIN,
+            IGNITE_SQL_DIAG_STATUS_SUBCLASS_ORIGIN
+        };
 
-            /** Field type is unknown to the driver. */
-            IGNITE_SQL_DIAG_UNKNOWN
+        /**
+         * Environment attribute.
+         */
+        enum EnvironmentAttribute
+        {
+            /** ODBC attribute is unknown to the driver. */
+            IGNITE_SQL_ENV_ATTR_UNKNOWN,
+
+            /** ODBC attribute. */
+            IGNITE_SQL_ENV_ATTR_ODBC_VERSION
         };
 
         /**
@@ -187,6 +199,14 @@ namespace ignite
          * @return Internal DiagnosticField type value.
          */
         DiagnosticField DiagnosticFieldToInternal(int16_t field);
+
+        /**
+         * Convert environment attribute to internal EnvironmentAttribute type value.
+         *
+         * @param attr Environment attribute.
+         * @return Internal EnvironmentAttribute type value.
+         */
+        EnvironmentAttribute EnvironmentAttributeToInternal(int32_t attr);
     }
 }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/a172649f/modules/platforms/cpp/odbc/odbc-driver/src/common_types.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/common_types.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/common_types.cpp
index 9086321..83bfe4c 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/common_types.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/common_types.cpp
@@ -24,7 +24,6 @@ namespace ignite
 {
     namespace odbc
     {
-
         int SqlResultToReturnCode(SqlResult result)
         {
             switch (result)
@@ -96,8 +95,23 @@ namespace ignite
                 default:
                     break;
             }
+
             return IGNITE_SQL_DIAG_UNKNOWN;
         }
+
+        EnvironmentAttribute EnvironmentAttributeToInternal(int32_t attr)
+        {
+            switch (attr)
+            {
+                case SQL_ATTR_ODBC_VERSION:
+                    return IGNITE_SQL_ENV_ATTR_ODBC_VERSION;
+
+                default:
+                    break;
+            }
+
+            return IGNITE_SQL_ENV_ATTR_UNKNOWN;
+        }
     }
 }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/a172649f/modules/platforms/cpp/odbc/odbc-driver/src/environment.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/environment.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/environment.cpp
index c5e4808..186fdc1 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/environment.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/environment.cpp
@@ -85,7 +85,10 @@ namespace ignite
 
         SqlResult Environment::InternalSetAttribute(int32_t attr, void* value, int32_t len)
         {
-            return SQL_RESULT_SUCCESS;
+            AddStatusRecord(SQL_STATE_HYC00_OPTIONAL_FEATURE_NOT_IMPLEMENTED,
+                "Attribute is not supported.");
+
+            return SQL_RESULT_ERROR;
         }
 
         void Environment::GetAttribute(int32_t attr, app::ApplicationDataBuffer& buffer)
@@ -95,7 +98,10 @@ namespace ignite
 
         SqlResult Environment::InternalGetAttribute(int32_t attr, app::ApplicationDataBuffer& buffer)
         {
-            return SQL_RESULT_SUCCESS;
+            AddStatusRecord(SQL_STATE_HYC00_OPTIONAL_FEATURE_NOT_IMPLEMENTED,
+                "Attribute is not supported.");
+
+            return SQL_RESULT_ERROR;
         }
     }
 }


[23/50] ignite git commit: IGNITE-1786: Debug functions fix.

Posted by vo...@apache.org.
IGNITE-1786: Debug functions fix.


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

Branch: refs/heads/ignite-1786
Commit: a5b73aa76a326625efa99d3f96b47181c41a3657
Parents: b0b2c90
Author: isapego <is...@gridgain.com>
Authored: Fri Jan 15 16:53:07 2016 +0300
Committer: isapego <is...@gridgain.com>
Committed: Fri Jan 15 16:53:07 2016 +0300

----------------------------------------------------------------------
 .../odbc-driver/include/ignite/odbc/config/connection_info.h | 2 +-
 .../odbc/odbc-driver/include/ignite/odbc/meta/column_meta.h  | 2 +-
 .../cpp/odbc/odbc-driver/include/ignite/odbc/type_traits.h   | 2 +-
 .../cpp/odbc/odbc-driver/include/ignite/odbc/utility.h       | 2 +-
 .../cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj      | 8 ++++----
 .../cpp/odbc/odbc-driver/src/config/connection_info.cpp      | 2 +-
 .../platforms/cpp/odbc/odbc-driver/src/meta/column_meta.cpp  | 2 +-
 modules/platforms/cpp/odbc/odbc-driver/src/type_traits.cpp   | 2 +-
 8 files changed, 11 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/a5b73aa7/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/config/connection_info.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/config/connection_info.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/config/connection_info.h
index 3cdc1bb..7f2738c 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/config/connection_info.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/config/connection_info.h
@@ -40,7 +40,7 @@ namespace ignite
                 /** Info type. */
                 typedef unsigned short InfoType;
 
-#ifdef _DEBUG
+#ifdef ODBC_DEBUG
                 /**
                  * Convert type to string containing its name.
                  * Debug function.

http://git-wip-us.apache.org/repos/asf/ignite/blob/a5b73aa7/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/meta/column_meta.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/meta/column_meta.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/meta/column_meta.h
index e90070e..9bc7227 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/meta/column_meta.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/meta/column_meta.h
@@ -38,7 +38,7 @@ namespace ignite
             class ColumnMeta
             {
             public:
-#ifdef _DEBUG
+#ifdef ODBC_DEBUG
                 /**
                  * Convert attribute ID to string containing its name.
                  * Debug function.

http://git-wip-us.apache.org/repos/asf/ignite/blob/a5b73aa7/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/type_traits.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/type_traits.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/type_traits.h
index ba7b78a..230a4ec 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/type_traits.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/type_traits.h
@@ -28,7 +28,7 @@ namespace ignite
     {
         namespace type_traits
         {
-#ifdef _DEBUG
+#ifdef ODBC_DEBUG
             /**
              * Convert statement attribute ID to string containing its name.
              * Debug function.

http://git-wip-us.apache.org/repos/asf/ignite/blob/a5b73aa7/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/utility.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/utility.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/utility.h
index dbaefc9..922e5e2 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/utility.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/utility.h
@@ -41,7 +41,7 @@ void logInit(const char*);
 
 #   define LOG_MSG(fmt, ...)                                        \
     do {                                                            \
-        logInit("D:\\odbc.log");                                    \
+        logInit(ODBC_LOG_PATH);                                    \
         fprintf(log_file, "%s: " fmt, __FUNCTION__, __VA_ARGS__);   \
         fflush(log_file);                                           \
     } while (false)

http://git-wip-us.apache.org/repos/asf/ignite/blob/a5b73aa7/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj b/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj
index 2f48e8d..3c701be 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj
+++ b/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj
@@ -90,7 +90,7 @@
       <Optimization>Disabled</Optimization>
       <SDLCheck>false</SDLCheck>
       <AdditionalIncludeDirectories>$(ProjectDir)\..\..\..\..\common\include;$(ProjectDir)\..\..\..\..\common\os\win\include;$(ProjectDir)\..\..\src;$(ProjectDir)\..\..\os\win;$(ProjectDir)\..\..\..\..\binary\include;$(ProjectDir)\..\..\..\..\binary\os\win\include;$(ProjectDir)\..\..\include</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;IGNITE_FRIEND;ODBC_DEBUG;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;IGNITE_FRIEND;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
     <Link>
       <GenerateDebugInformation>true</GenerateDebugInformation>
@@ -104,7 +104,7 @@
       <Optimization>Disabled</Optimization>
       <SDLCheck>false</SDLCheck>
       <AdditionalIncludeDirectories>$(ProjectDir)\..\..\..\..\common\include;$(ProjectDir)\..\..\..\..\common\os\win\include;$(ProjectDir)\..\..\src;$(ProjectDir)\..\..\os\win;$(ProjectDir)\..\..\..\..\binary\include;$(ProjectDir)\..\..\..\..\binary\os\win\include;$(ProjectDir)\..\..\include</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;IGNITE_FRIEND;ODBC_DEBUG;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;IGNITE_FRIEND;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
     <Link>
       <GenerateDebugInformation>true</GenerateDebugInformation>
@@ -120,7 +120,7 @@
       <IntrinsicFunctions>true</IntrinsicFunctions>
       <SDLCheck>false</SDLCheck>
       <AdditionalIncludeDirectories>$(ProjectDir)\..\..\..\..\common\include;$(ProjectDir)\..\..\..\..\common\os\win\include;$(ProjectDir)\..\..\src;$(ProjectDir)\..\..\os\win;$(ProjectDir)\..\..\..\..\binary\include;$(ProjectDir)\..\..\..\..\binary\os\win\include;$(ProjectDir)\..\..\include</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;IGNITE_FRIEND;ODBC_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;IGNITE_FRIEND;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
     <Link>
       <GenerateDebugInformation>true</GenerateDebugInformation>
@@ -138,7 +138,7 @@
       <IntrinsicFunctions>true</IntrinsicFunctions>
       <SDLCheck>false</SDLCheck>
       <AdditionalIncludeDirectories>$(ProjectDir)\..\..\..\..\common\include;$(ProjectDir)\..\..\..\..\common\os\win\include;$(ProjectDir)\..\..\src;$(ProjectDir)\..\..\os\win;$(ProjectDir)\..\..\..\..\binary\include;$(ProjectDir)\..\..\..\..\binary\os\win\include;$(ProjectDir)\..\..\include</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;IGNITE_FRIEND;ODBC_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;IGNITE_FRIEND;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
     <Link>
       <GenerateDebugInformation>true</GenerateDebugInformation>

http://git-wip-us.apache.org/repos/asf/ignite/blob/a5b73aa7/modules/platforms/cpp/odbc/odbc-driver/src/config/connection_info.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/config/connection_info.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/config/connection_info.cpp
index 05f50aa..0e8e748 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/config/connection_info.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/config/connection_info.cpp
@@ -42,7 +42,7 @@ namespace ignite
         namespace config
         {
 
-#ifdef _DEBUG
+#ifdef ODBC_DEBUG
 
 #define DBG_STR_CASE(x) case x: return #x
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/a5b73aa7/modules/platforms/cpp/odbc/odbc-driver/src/meta/column_meta.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/meta/column_meta.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/meta/column_meta.cpp
index ab12aad..114dd03 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/meta/column_meta.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/meta/column_meta.cpp
@@ -27,7 +27,7 @@ namespace ignite
         namespace meta
         {
 
-#ifdef _DEBUG
+#ifdef ODBC_DEBUG
 
 #define DBG_STR_CASE(x) case x: return #x
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/a5b73aa7/modules/platforms/cpp/odbc/odbc-driver/src/type_traits.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/type_traits.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/type_traits.cpp
index 8cf9aff..03e525f 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/type_traits.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/type_traits.cpp
@@ -59,7 +59,7 @@ namespace ignite
 
             const std::string SqlTypeName::GUID("GUID");
 
-#ifdef _DEBUG
+#ifdef ODBC_DEBUG
 
 #define DBG_STR_CASE(x) case x: return #x
 


[27/50] ignite git commit: IGNITE-1786: Fixed ODBC solution.

Posted by vo...@apache.org.
IGNITE-1786: Fixed ODBC solution.


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

Branch: refs/heads/ignite-1786
Commit: 1877ace3fc82ae4fa76d6ee4845c5ada321d005a
Parents: 9250352
Author: isapego <is...@gridgain.com>
Authored: Mon Jan 18 16:40:50 2016 +0300
Committer: isapego <is...@gridgain.com>
Committed: Mon Jan 18 16:40:50 2016 +0300

----------------------------------------------------------------------
 modules/platforms/cpp/odbc/project/vs/odbc.sln | 36 ++++++++++-----------
 1 file changed, 18 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/1877ace3/modules/platforms/cpp/odbc/project/vs/odbc.sln
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/project/vs/odbc.sln b/modules/platforms/cpp/odbc/project/vs/odbc.sln
index ee570b5..ecaafe0 100644
--- a/modules/platforms/cpp/odbc/project/vs/odbc.sln
+++ b/modules/platforms/cpp/odbc/project/vs/odbc.sln
@@ -14,43 +14,43 @@ EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|x64 = Debug|x64
-		Debug|x86 = Debug|x86
+		Debug|Win32 = Debug|Win32
 		Release|x64 = Release|x64
-		Release|x86 = Release|x86
+		Release|Win32 = Release|Win32
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
 		{12F77E12-38FE-42D3-B1DA-7E5979362961}.Debug|x64.ActiveCfg = Debug|x64
 		{12F77E12-38FE-42D3-B1DA-7E5979362961}.Debug|x64.Build.0 = Debug|x64
-		{12F77E12-38FE-42D3-B1DA-7E5979362961}.Debug|x86.ActiveCfg = Debug|Win32
-		{12F77E12-38FE-42D3-B1DA-7E5979362961}.Debug|x86.Build.0 = Debug|Win32
+		{12F77E12-38FE-42D3-B1DA-7E5979362961}.Debug|Win32.ActiveCfg = Debug|Win32
+		{12F77E12-38FE-42D3-B1DA-7E5979362961}.Debug|Win32.Build.0 = Debug|Win32
 		{12F77E12-38FE-42D3-B1DA-7E5979362961}.Release|x64.ActiveCfg = Release|x64
 		{12F77E12-38FE-42D3-B1DA-7E5979362961}.Release|x64.Build.0 = Release|x64
-		{12F77E12-38FE-42D3-B1DA-7E5979362961}.Release|x86.ActiveCfg = Release|Win32
-		{12F77E12-38FE-42D3-B1DA-7E5979362961}.Release|x86.Build.0 = Release|Win32
+		{12F77E12-38FE-42D3-B1DA-7E5979362961}.Release|Win32.ActiveCfg = Release|Win32
+		{12F77E12-38FE-42D3-B1DA-7E5979362961}.Release|Win32.Build.0 = Release|Win32
 		{309BEA40-495D-463F-98D5-4657F03F6D8F}.Debug|x64.ActiveCfg = Debug|x64
 		{309BEA40-495D-463F-98D5-4657F03F6D8F}.Debug|x64.Build.0 = Debug|x64
-		{309BEA40-495D-463F-98D5-4657F03F6D8F}.Debug|x86.ActiveCfg = Debug|Win32
-		{309BEA40-495D-463F-98D5-4657F03F6D8F}.Debug|x86.Build.0 = Debug|Win32
+		{309BEA40-495D-463F-98D5-4657F03F6D8F}.Debug|Win32.ActiveCfg = Debug|Win32
+		{309BEA40-495D-463F-98D5-4657F03F6D8F}.Debug|Win32.Build.0 = Debug|Win32
 		{309BEA40-495D-463F-98D5-4657F03F6D8F}.Release|x64.ActiveCfg = Release|x64
 		{309BEA40-495D-463F-98D5-4657F03F6D8F}.Release|x64.Build.0 = Release|x64
-		{309BEA40-495D-463F-98D5-4657F03F6D8F}.Release|x86.ActiveCfg = Release|Win32
-		{309BEA40-495D-463F-98D5-4657F03F6D8F}.Release|x86.Build.0 = Release|Win32
+		{309BEA40-495D-463F-98D5-4657F03F6D8F}.Release|Win32.ActiveCfg = Release|Win32
+		{309BEA40-495D-463F-98D5-4657F03F6D8F}.Release|Win32.Build.0 = Release|Win32
 		{4F7E4917-4612-4B96-9838-025711ADE391}.Debug|x64.ActiveCfg = Debug|x64
 		{4F7E4917-4612-4B96-9838-025711ADE391}.Debug|x64.Build.0 = Debug|x64
-		{4F7E4917-4612-4B96-9838-025711ADE391}.Debug|x86.ActiveCfg = Debug|Win32
-		{4F7E4917-4612-4B96-9838-025711ADE391}.Debug|x86.Build.0 = Debug|Win32
+		{4F7E4917-4612-4B96-9838-025711ADE391}.Debug|Win32.ActiveCfg = Debug|Win32
+		{4F7E4917-4612-4B96-9838-025711ADE391}.Debug|Win32.Build.0 = Debug|Win32
 		{4F7E4917-4612-4B96-9838-025711ADE391}.Release|x64.ActiveCfg = Release|x64
 		{4F7E4917-4612-4B96-9838-025711ADE391}.Release|x64.Build.0 = Release|x64
-		{4F7E4917-4612-4B96-9838-025711ADE391}.Release|x86.ActiveCfg = Release|Win32
-		{4F7E4917-4612-4B96-9838-025711ADE391}.Release|x86.Build.0 = Release|Win32
+		{4F7E4917-4612-4B96-9838-025711ADE391}.Release|Win32.ActiveCfg = Release|Win32
+		{4F7E4917-4612-4B96-9838-025711ADE391}.Release|Win32.Build.0 = Release|Win32
 		{4F15669B-92EB-49F0-B774-8F19BAE0B960}.Debug|x64.ActiveCfg = Debug|x64
 		{4F15669B-92EB-49F0-B774-8F19BAE0B960}.Debug|x64.Build.0 = Debug|x64
-		{4F15669B-92EB-49F0-B774-8F19BAE0B960}.Debug|x86.ActiveCfg = Debug|Win32
-		{4F15669B-92EB-49F0-B774-8F19BAE0B960}.Debug|x86.Build.0 = Debug|Win32
+		{4F15669B-92EB-49F0-B774-8F19BAE0B960}.Debug|Win32.ActiveCfg = Debug|Win32
+		{4F15669B-92EB-49F0-B774-8F19BAE0B960}.Debug|Win32.Build.0 = Debug|Win32
 		{4F15669B-92EB-49F0-B774-8F19BAE0B960}.Release|x64.ActiveCfg = Release|x64
 		{4F15669B-92EB-49F0-B774-8F19BAE0B960}.Release|x64.Build.0 = Release|x64
-		{4F15669B-92EB-49F0-B774-8F19BAE0B960}.Release|x86.ActiveCfg = Release|Win32
-		{4F15669B-92EB-49F0-B774-8F19BAE0B960}.Release|x86.Build.0 = Release|Win32
+		{4F15669B-92EB-49F0-B774-8F19BAE0B960}.Release|Win32.ActiveCfg = Release|Win32
+		{4F15669B-92EB-49F0-B774-8F19BAE0B960}.Release|Win32.Build.0 = Release|Win32
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE


[03/50] ignite git commit: IGNITE-1786: Fix for the PrimaryKeysQuery.

Posted by vo...@apache.org.
IGNITE-1786: Fix for the PrimaryKeysQuery.


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

Branch: refs/heads/ignite-1786
Commit: 1add4f1a5eabccbade182a75b47e205bf1a41849
Parents: fe5b560
Author: isapego <is...@gridgain.com>
Authored: Wed Dec 30 17:21:50 2015 +0300
Committer: isapego <is...@gridgain.com>
Committed: Wed Dec 30 17:21:50 2015 +0300

----------------------------------------------------------------------
 .../cpp/odbc/odbc-driver/src/query/primary_keys_query.cpp      | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/1add4f1a/modules/platforms/cpp/odbc/odbc-driver/src/query/primary_keys_query.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/query/primary_keys_query.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/query/primary_keys_query.cpp
index b352e33..0b9b523 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/query/primary_keys_query.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/query/primary_keys_query.cpp
@@ -96,6 +96,8 @@ namespace ignite
 
                 executed = true;
 
+                cursor = meta.begin();
+
                 return SQL_RESULT_SUCCESS;
             }
 
@@ -113,9 +115,13 @@ namespace ignite
                     return SQL_RESULT_ERROR;
                 }
 
+                LOG_MSG("1\n");
+
                 if (cursor == meta.end())
                     return SQL_RESULT_NO_DATA;
 
+                LOG_MSG("2\n");
+
                 app::ColumnBindingMap::iterator it;
 
                 for (it = columnBindings.begin(); it != columnBindings.end(); ++it)


[43/50] ignite git commit: IGNITE-2248: Added SpecialColumnsQuery (returns empty result set).

Posted by vo...@apache.org.
IGNITE-2248: Added SpecialColumnsQuery (returns empty result set).


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

Branch: refs/heads/ignite-1786
Commit: d86a82c8693eecbc1e3e3939b2a2b8452fb880b9
Parents: a5d824c
Author: isapego <is...@gridgain.com>
Authored: Thu Jan 21 17:18:13 2016 +0300
Committer: isapego <is...@gridgain.com>
Committed: Thu Jan 21 17:18:13 2016 +0300

----------------------------------------------------------------------
 .../ignite/odbc/query/special_columns_query.h   | 142 +++++++++++++++++++
 .../odbc-driver/include/ignite/odbc/statement.h |   8 +-
 .../odbc-driver/project/vs/odbc-driver.vcxproj  |   2 +
 .../project/vs/odbc-driver.vcxproj.filters      |   6 +
 .../platforms/cpp/odbc/odbc-driver/src/odbc.cpp |   2 +-
 .../src/query/special_columns_query.cpp         | 121 ++++++++++++++++
 .../cpp/odbc/odbc-driver/src/statement.cpp      |   6 +-
 7 files changed, 279 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/d86a82c8/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/special_columns_query.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/special_columns_query.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/special_columns_query.h
new file mode 100644
index 0000000..ad45791
--- /dev/null
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/special_columns_query.h
@@ -0,0 +1,142 @@
+/*
+ * 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.
+ */
+
+#ifndef _IGNITE_ODBC_DRIVER_SPECIAL_COLUMNS_QUERY
+#define _IGNITE_ODBC_DRIVER_SPECIAL_COLUMNS_QUERY
+
+#include "ignite/odbc/query/query.h"
+
+namespace ignite
+{
+    namespace odbc
+    {
+        namespace query
+        {
+            /**
+             * Special columns query.
+             */
+            class SpecialColumnsQuery : Query
+            {
+            public:
+
+                /**
+                 * Constructor.
+                 *
+                 * @param diag Diagnostics collector.
+                 * @param catalog Catalog name.
+                 * @param schema Schema name.
+                 * @param table Table name.
+                 * @param scope Minimum required scope of the rowid.
+                 * @param nullable Determines whether to return special columns
+                 *                 that can have a NULL value.
+                 */
+                SpecialColumnsQuery(diagnostic::Diagnosable& diag, int16_t type,
+                    const std::string& catalog, const std::string& schema,
+                    const std::string& table, int16_t scope, int16_t nullable);
+
+                /**
+                 * Destructor.
+                 */
+                virtual ~SpecialColumnsQuery();
+
+                /**
+                 * Execute query.
+                 *
+                 * @return True on success.
+                 */
+                virtual SqlResult Execute();
+
+                /**
+                 * Fetch next result row to application buffers.
+                 *
+                 * @param columnBindings Application buffers to put data to.
+                 * @return Operation result.
+                 */
+                virtual SqlResult FetchNextRow(app::ColumnBindingMap& columnBindings);
+
+                /**
+                 * Get data of the specified column in the result set.
+                 *
+                 * @param columnIdx Column index.
+                 * @param buffer Buffer to put column data to.
+                 * @return Operation result.
+                 */
+                virtual SqlResult GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer);
+
+                /**
+                 * Close query.
+                 *
+                 * @return True on success.
+                 */
+                virtual SqlResult Close();
+
+                /**
+                 * Get column metadata.
+                 *
+                 * @return Column metadata.
+                 */
+                virtual const meta::ColumnMetaVector& GetMeta() const;
+
+                /**
+                 * Check if data is available.
+                 *
+                 * @return True if data is available.
+                 */
+                virtual bool DataAvailable() const;
+
+                /**
+                 * Get number of rows affected by the statement.
+                 *
+                 * @return Number of rows affected by the statement.
+                 */
+                virtual int64_t AffectedRows() const;
+
+            private:
+                IGNITE_NO_COPY_ASSIGNMENT(SpecialColumnsQuery);
+
+                /** Query type. */
+                int16_t type;
+
+                /** Catalog name. */
+                std::string catalog;
+
+                /** Schema name. */
+                std::string schema;
+
+                /** Table name. */
+                std::string table;
+
+                /** Minimum required scope of the rowid. */
+                int16_t scope;
+
+                /**
+                 * Determines whether to return special columns that can have
+                 * a NULL value.
+                 */
+                int16_t nullable;
+
+                /** Query executed. */
+                bool executed;
+
+                /** Columns metadata. */
+                meta::ColumnMetaVector columnsMeta;
+            };
+        }
+    }
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/d86a82c8/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/statement.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/statement.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/statement.h
index 4c49a76..bbe5da5 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/statement.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/statement.h
@@ -245,7 +245,7 @@ namespace ignite
              * @param type Determines whether to return special columns that
              *             can have a NULL value.
              */
-            void ExecuteGetSpecialColumnsQuery(int16_t type,
+            void ExecuteSpecialColumnsQuery(int16_t type,
                 const std::string& catalog, const std::string& schema,
                 const std::string& table, int16_t scope, int16_t nullable);
 
@@ -450,11 +450,11 @@ namespace ignite
              * @param schema Schema name.
              * @param table Table name.
              * @param scope Minimum required scope of the rowid.
-             * @param type Determines whether to return special columns that
-             *             can have a NULL value.
+             * @param nullable Determines whether to return special columns
+             *                 that can have a NULL value.
              * @return Operation result.
              */
-            SqlResult InternalExecuteGetSpecialColumnsQuery(int16_t type,
+            SqlResult InternalExecuteSpecialColumnsQuery(int16_t type,
                 const std::string& catalog, const std::string& schema,
                 const std::string& table, int16_t scope, int16_t nullable);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/d86a82c8/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj b/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj
index cff9f3f..b327ffd 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj
+++ b/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj
@@ -170,6 +170,7 @@
     <ClCompile Include="..\..\src\query\column_metadata_query.cpp" />
     <ClCompile Include="..\..\src\query\foreign_keys_query.cpp" />
     <ClCompile Include="..\..\src\query\primary_keys_query.cpp" />
+    <ClCompile Include="..\..\src\query\special_columns_query.cpp" />
     <ClCompile Include="..\..\src\query\table_metadata_query.cpp" />
     <ClCompile Include="..\..\src\query\type_info_query.cpp" />
     <ClCompile Include="..\..\src\result_page.cpp" />
@@ -206,6 +207,7 @@
     <ClInclude Include="..\..\include\ignite\odbc\query\foreign_keys_query.h" />
     <ClInclude Include="..\..\include\ignite\odbc\query\primary_keys_query.h" />
     <ClInclude Include="..\..\include\ignite\odbc\query\query.h" />
+    <ClInclude Include="..\..\include\ignite\odbc\query\special_columns_query.h" />
     <ClInclude Include="..\..\include\ignite\odbc\query\table_metadata_query.h" />
     <ClInclude Include="..\..\include\ignite\odbc\query\type_info_query.h" />
     <ClInclude Include="..\..\include\ignite\odbc\result_page.h" />

http://git-wip-us.apache.org/repos/asf/ignite/blob/d86a82c8/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj.filters
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj.filters b/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj.filters
index 8083def..d47684a 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj.filters
+++ b/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj.filters
@@ -112,6 +112,9 @@
     <ClCompile Include="..\..\src\column.cpp">
       <Filter>Code</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\src\query\special_columns_query.cpp">
+      <Filter>Code\query</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <None Include="module.def">
@@ -219,5 +222,8 @@
     <ClInclude Include="..\..\include\ignite\odbc\column.h">
       <Filter>Code</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\include\ignite\odbc\query\special_columns_query.h">
+      <Filter>Code\query</Filter>
+    </ClInclude>
   </ItemGroup>
 </Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/d86a82c8/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp
index 7199ad3..84e312a 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp
@@ -1368,7 +1368,7 @@ SQLRETURN SQL_API SQLSpecialColumns(SQLHSTMT    stmt,
     LOG_MSG("schema: %s\n", schema.c_str());
     LOG_MSG("table: %s\n", table.c_str());
 
-    statement->ExecuteGetSpecialColumnsQuery(idType, catalog, schema, table, scope, nullable);
+    statement->ExecuteSpecialColumnsQuery(idType, catalog, schema, table, scope, nullable);
 
     return statement->GetDiagnosticRecords().GetReturnCode();
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/d86a82c8/modules/platforms/cpp/odbc/odbc-driver/src/query/special_columns_query.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/query/special_columns_query.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/query/special_columns_query.cpp
new file mode 100644
index 0000000..43d6842
--- /dev/null
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/query/special_columns_query.cpp
@@ -0,0 +1,121 @@
+/*
+ * 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.
+ */
+
+#include <ignite/impl/binary/binary_common.h>
+
+#include "ignite/odbc/type_traits.h"
+#include "ignite/odbc/query/special_columns_query.h"
+
+namespace ignite
+{
+    namespace odbc
+    {
+        namespace query
+        {
+            SpecialColumnsQuery::SpecialColumnsQuery(diagnostic::Diagnosable& diag,
+                int16_t type, const std::string& catalog, const std::string& schema,
+                const std::string& table, int16_t scope, int16_t nullable) :
+                Query(diag),
+                type(type),
+                catalog(catalog),
+                schema(schema),
+                table(table),
+                scope(scope),
+                nullable(nullable),
+                executed(false),
+                columnsMeta()
+            {
+                using namespace ignite::impl::binary;
+                using namespace ignite::odbc::type_traits;
+
+                using meta::ColumnMeta;
+
+                columnsMeta.reserve(8);
+
+                const std::string sch("");
+                const std::string tbl("");
+
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "SCOPE",          SqlTypeName::SMALLINT,  IGNITE_TYPE_SHORT));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "COLUMN_NAME",    SqlTypeName::VARCHAR,   IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "DATA_TYPE",      SqlTypeName::SMALLINT,  IGNITE_TYPE_SHORT));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "TYPE_NAME",      SqlTypeName::VARCHAR,   IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "COLUMN_SIZE",    SqlTypeName::INTEGER,   IGNITE_TYPE_INT));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "BUFFER_LENGTH",  SqlTypeName::INTEGER,   IGNITE_TYPE_INT));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "DECIMAL_DIGITS", SqlTypeName::SMALLINT,  IGNITE_TYPE_SHORT));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "PSEUDO_COLUMN",  SqlTypeName::SMALLINT,  IGNITE_TYPE_SHORT));
+            }
+
+            SpecialColumnsQuery::~SpecialColumnsQuery()
+            {
+                // No-op.
+            }
+
+            SqlResult SpecialColumnsQuery::Execute()
+            {
+                executed = true;
+
+                return SQL_RESULT_SUCCESS;
+            }
+
+            const meta::ColumnMetaVector& SpecialColumnsQuery::GetMeta() const
+            {
+                return columnsMeta;
+            }
+
+            SqlResult SpecialColumnsQuery::FetchNextRow(app::ColumnBindingMap & columnBindings)
+            {
+                if (!executed)
+                {
+                    diag.AddStatusRecord(SQL_STATE_HY010_SEQUENCE_ERROR, "Query was not executed.");
+
+                    return SQL_RESULT_ERROR;
+                }
+
+                return SQL_RESULT_NO_DATA;
+            }
+
+            SqlResult SpecialColumnsQuery::GetColumn(uint16_t columnIdx, app::ApplicationDataBuffer& buffer)
+            {
+                if (!executed)
+                {
+                    diag.AddStatusRecord(SQL_STATE_HY010_SEQUENCE_ERROR, "Query was not executed.");
+
+                    return SQL_RESULT_ERROR;
+                }
+
+                return SQL_RESULT_NO_DATA;
+            }
+
+            SqlResult SpecialColumnsQuery::Close()
+            {
+                executed = false;
+
+                return SQL_RESULT_SUCCESS;
+            }
+
+            bool SpecialColumnsQuery::DataAvailable() const
+            {
+                return false;
+            }
+
+            int64_t SpecialColumnsQuery::AffectedRows() const
+            {
+                return 0;
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/d86a82c8/modules/platforms/cpp/odbc/odbc-driver/src/statement.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/statement.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/statement.cpp
index d23c276..d7ea288 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/statement.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/statement.cpp
@@ -305,15 +305,15 @@ namespace ignite
             return currentQuery->Execute();
         }
 
-        void Statement::ExecuteGetSpecialColumnsQuery(int16_t type,
+        void Statement::ExecuteSpecialColumnsQuery(int16_t type,
             const std::string& catalog, const std::string& schema,
             const std::string& table, int16_t scope, int16_t nullable)
         {
-            IGNITE_ODBC_API_CALL(InternalExecuteGetSpecialColumnsQuery(type,
+            IGNITE_ODBC_API_CALL(InternalExecuteSpecialColumnsQuery(type,
                 catalog, schema, table, scope, nullable));
         }
 
-        SqlResult Statement::InternalExecuteGetSpecialColumnsQuery(int16_t type,
+        SqlResult Statement::InternalExecuteSpecialColumnsQuery(int16_t type,
             const std::string& catalog, const std::string& schema,
             const std::string& table, int16_t scope, int16_t nullable)
         {


[46/50] ignite git commit: Merge branch 'ignite-1786' of https://github.com/isapego/ignite into ignite-1786

Posted by vo...@apache.org.
Merge branch 'ignite-1786' of https://github.com/isapego/ignite into ignite-1786

# Conflicts:
#	modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorIgfsConfiguration.java


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

Branch: refs/heads/ignite-1786
Commit: 9628396c4482f803bf45c71ddc76721595b07d7d
Parents: 243a857 e1a50af
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Fri Jan 22 16:35:02 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Fri Jan 22 16:35:02 2016 +0300

----------------------------------------------------------------------
 .gitignore                                      |    1 -
 examples/pom.xml                                |    2 +-
 examples/schema-import/pom.xml                  |    2 +-
 modules/aop/pom.xml                             |    2 +-
 modules/apache-license-gen/pom.xml              |    2 +-
 modules/aws/pom.xml                             |    2 +-
 modules/camel/pom.xml                           |    2 +-
 modules/clients/pom.xml                         |    2 +-
 modules/cloud/pom.xml                           |    2 +-
 modules/codegen/pom.xml                         |    2 +-
 modules/core/pom.xml                            |    2 +-
 .../configuration/IgniteConfiguration.java      |   21 +
 .../ignite/configuration/OdbcConfiguration.java |  259 +++
 .../ignite/internal/GridKernalContext.java      |    8 +
 .../ignite/internal/GridKernalContextImpl.java  |   12 +
 .../apache/ignite/internal/IgniteKernal.java    |    2 +
 .../processors/odbc/GridOdbcColumnMeta.java     |  125 ++
 .../processors/odbc/GridOdbcCommandHandler.java |  337 ++++
 .../processors/odbc/GridOdbcProcessor.java      |  160 ++
 .../odbc/GridOdbcProtocolHandler.java           |   40 +
 .../processors/odbc/GridOdbcTableMeta.java      |   89 +
 .../odbc/protocol/GridOdbcParser.java           |  345 ++++
 .../odbc/protocol/GridTcpOdbcNioListener.java   |  102 ++
 .../odbc/protocol/GridTcpOdbcServer.java        |  191 ++
 .../odbc/request/GridOdbcRequest.java           |   61 +
 .../odbc/request/QueryCloseRequest.java         |   47 +
 .../odbc/request/QueryExecuteRequest.java       |   85 +
 .../odbc/request/QueryFetchRequest.java         |   66 +
 .../request/QueryGetColumnsMetaRequest.java     |   84 +
 .../odbc/request/QueryGetTablesMetaRequest.java |  105 ++
 .../odbc/response/GridOdbcResponse.java         |  107 ++
 .../odbc/response/QueryCloseResult.java         |   39 +
 .../odbc/response/QueryExecuteResult.java       |   55 +
 .../odbc/response/QueryFetchResult.java         |   75 +
 .../response/QueryGetColumnsMetaResult.java     |   43 +
 .../odbc/response/QueryGetTablesMetaResult.java |   43 +
 .../visor/node/VisorIgfsConfiguration.java      |   30 -
 .../core/src/main/resources/ignite.properties   |    2 +-
 modules/extdata/p2p/pom.xml                     |    2 +-
 .../extdata/uri/modules/uri-dependency/pom.xml  |    2 +-
 modules/extdata/uri/pom.xml                     |    2 +-
 modules/flume/pom.xml                           |    2 +-
 modules/gce/pom.xml                             |    2 +-
 modules/geospatial/pom.xml                      |    2 +-
 modules/hadoop/pom.xml                          |    2 +-
 modules/hibernate/pom.xml                       |    2 +-
 modules/indexing/pom.xml                        |    2 +-
 modules/jcl/pom.xml                             |    2 +-
 modules/jms11/pom.xml                           |    2 +-
 modules/jta/pom.xml                             |    2 +-
 modules/kafka/pom.xml                           |    2 +-
 modules/log4j/pom.xml                           |    2 +-
 modules/log4j2/pom.xml                          |    2 +-
 modules/mesos/pom.xml                           |    2 +-
 modules/mqtt/pom.xml                            |    2 +-
 modules/osgi-karaf/pom.xml                      |    2 +-
 modules/osgi-paxlogging/pom.xml                 |    2 +-
 modules/osgi/pom.xml                            |    2 +-
 modules/platforms/cpp/binary/Makefile.am        |   60 +
 modules/platforms/cpp/binary/configure.ac       |   62 +
 .../platforms/cpp/binary/ignite-binary.pc.in    |    9 +
 .../platforms/cpp/binary/include/Makefile.am    |   48 +
 .../cpp/binary/include/ignite/binary/binary.h   |   34 +
 .../include/ignite/binary/binary_consts.h       |   86 +
 .../include/ignite/binary/binary_containers.h   |  531 ++++++
 .../include/ignite/binary/binary_raw_reader.h   |  355 ++++
 .../include/ignite/binary/binary_raw_writer.h   |  331 ++++
 .../include/ignite/binary/binary_reader.h       |  389 ++++
 .../binary/include/ignite/binary/binary_type.h  |  310 ++++
 .../include/ignite/binary/binary_writer.h       |  367 ++++
 .../platforms/cpp/binary/include/ignite/guid.h  |  143 ++
 .../include/ignite/impl/binary/binary_common.h  |  188 ++
 .../ignite/impl/binary/binary_id_resolver.h     |  106 ++
 .../ignite/impl/binary/binary_reader_impl.h     | 1309 ++++++++++++++
 .../include/ignite/impl/binary/binary_schema.h  |  136 ++
 .../ignite/impl/binary/binary_type_handler.h    |  102 ++
 .../ignite/impl/binary/binary_type_manager.h    |  120 ++
 .../ignite/impl/binary/binary_type_snapshot.h   |  122 ++
 .../ignite/impl/binary/binary_type_updater.h    |   53 +
 .../impl/binary/binary_type_updater_impl.h      |   65 +
 .../include/ignite/impl/binary/binary_utils.h   |  344 ++++
 .../ignite/impl/binary/binary_writer_impl.h     |  913 ++++++++++
 .../include/ignite/impl/ignite_environment.h    |  130 ++
 .../include/ignite/impl/interop/interop.h       |   25 +
 .../ignite/impl/interop/interop_input_stream.h  |  250 +++
 .../ignite/impl/interop/interop_memory.h        |  287 +++
 .../ignite/impl/interop/interop_output_stream.h |  250 +++
 .../interop/interop_stream_position_guard.h     |   81 +
 .../cpp/binary/project/vs/binary.vcxproj        |  239 +++
 .../binary/project/vs/binary.vcxproj.filters    |  163 ++
 .../cpp/binary/src/binary/binary_containers.cpp |   76 +
 .../cpp/binary/src/binary/binary_raw_reader.cpp |  145 ++
 .../cpp/binary/src/binary/binary_raw_writer.cpp |  147 ++
 .../cpp/binary/src/binary/binary_reader.cpp     |  152 ++
 .../cpp/binary/src/binary/binary_type.cpp       |   51 +
 .../cpp/binary/src/binary/binary_writer.cpp     |  154 ++
 modules/platforms/cpp/binary/src/guid.cpp       |   65 +
 .../src/impl/binary/binary_reader_impl.cpp      |  760 ++++++++
 .../binary/src/impl/binary/binary_schema.cpp    |  135 ++
 .../src/impl/binary/binary_type_handler.cpp     |   78 +
 .../src/impl/binary/binary_type_manager.cpp     |  201 +++
 .../src/impl/binary/binary_type_snapshot.cpp    |   70 +
 .../src/impl/binary/binary_type_updater.cpp     |   32 +
 .../impl/binary/binary_type_updater_impl.cpp    |   96 +
 .../cpp/binary/src/impl/binary/binary_utils.cpp |  211 +++
 .../src/impl/binary/binary_writer_impl.cpp      |  623 +++++++
 .../cpp/binary/src/impl/ignite_environment.cpp  |  167 ++
 .../src/impl/interop/interop_input_stream.cpp   |  235 +++
 .../binary/src/impl/interop/interop_memory.cpp  |  187 ++
 .../src/impl/interop/interop_output_stream.cpp  |  233 +++
 modules/platforms/cpp/common/Makefile.am        |    6 +-
 modules/platforms/cpp/common/configure.ac       |    2 +-
 .../platforms/cpp/common/include/Makefile.am    |    3 +-
 .../common/include/ignite/common/ignite_error.h |  265 +++
 .../cpp/common/include/ignite/common/utils.h    |  129 +-
 .../platforms/cpp/common/os/linux/src/utils.cpp |  439 +++++
 .../platforms/cpp/common/os/win/src/utils.cpp   |  453 +++++
 .../cpp/common/project/vs/common.vcxproj        |    9 +-
 .../common/project/vs/common.vcxproj.filters    |    9 +
 .../platforms/cpp/common/src/ignite_error.cpp   |  221 +++
 modules/platforms/cpp/core-test/configure.ac    |    2 +-
 .../cpp/core-test/project/vs/core-test.vcxproj  |   11 +-
 .../cpp/core-test/src/cache_query_test.cpp      |    4 +-
 modules/platforms/cpp/core/Makefile.am          |   36 +-
 modules/platforms/cpp/core/configure.ac         |    4 +-
 modules/platforms/cpp/core/include/Makefile.am  |   68 +-
 .../cpp/core/include/ignite/binary/binary.h     |   34 -
 .../core/include/ignite/binary/binary_consts.h  |   86 -
 .../include/ignite/binary/binary_containers.h   |  530 ------
 .../include/ignite/binary/binary_raw_reader.h   |  355 ----
 .../include/ignite/binary/binary_raw_writer.h   |  331 ----
 .../core/include/ignite/binary/binary_reader.h  |  389 ----
 .../core/include/ignite/binary/binary_type.h    |  310 ----
 .../core/include/ignite/binary/binary_writer.h  |  367 ----
 .../cpp/core/include/ignite/cache/cache.h       |    2 +-
 .../include/ignite/cache/query/query_cursor.h   |    2 +-
 .../ignite/cache/query/query_fields_cursor.h    |    2 +-
 .../ignite/cache/query/query_fields_row.h       |    2 +-
 .../platforms/cpp/core/include/ignite/guid.h    |  117 --
 .../core/include/ignite/ignite_configuration.h  |    2 +-
 .../cpp/core/include/ignite/ignite_error.h      |  265 ---
 .../cpp/core/include/ignite/ignition.h          |    2 +-
 .../include/ignite/impl/binary/binary_common.h  |  188 --
 .../ignite/impl/binary/binary_id_resolver.h     |  106 --
 .../ignite/impl/binary/binary_reader_impl.h     | 1309 --------------
 .../include/ignite/impl/binary/binary_schema.h  |  136 --
 .../ignite/impl/binary/binary_type_handler.h    |  102 --
 .../ignite/impl/binary/binary_type_manager.h    |  120 --
 .../ignite/impl/binary/binary_type_snapshot.h   |  122 --
 .../ignite/impl/binary/binary_type_updater.h    |   53 -
 .../impl/binary/binary_type_updater_impl.h      |   65 -
 .../include/ignite/impl/binary/binary_utils.h   |  344 ----
 .../ignite/impl/binary/binary_writer_impl.h     |  913 ----------
 .../impl/cache/query/query_fields_row_impl.h    |    2 +-
 .../ignite/impl/cache/query/query_impl.h        |    2 +-
 .../include/ignite/impl/ignite_environment.h    |  130 --
 .../cpp/core/include/ignite/impl/ignite_impl.h  |    8 +-
 .../core/include/ignite/impl/interop/interop.h  |   25 -
 .../ignite/impl/interop/interop_input_stream.h  |  250 ---
 .../ignite/impl/interop/interop_memory.h        |  280 ---
 .../ignite/impl/interop/interop_output_stream.h |  250 ---
 .../interop/interop_stream_position_guard.h     |   79 -
 .../cpp/core/os/linux/include/Makefile.am       |   23 -
 .../core/os/linux/include/ignite/impl/utils.h   |  155 --
 .../cpp/core/os/linux/src/impl/utils.cpp        |  439 -----
 .../cpp/core/os/win/include/ignite/impl/utils.h |  155 --
 .../cpp/core/os/win/src/impl/utils.cpp          |  453 -----
 .../platforms/cpp/core/project/vs/core.vcxproj  |   73 +-
 .../cpp/core/project/vs/core.vcxproj.filters    |  159 --
 .../cpp/core/src/binary/binary_containers.cpp   |   76 -
 .../cpp/core/src/binary/binary_raw_reader.cpp   |  145 --
 .../cpp/core/src/binary/binary_raw_writer.cpp   |  147 --
 .../cpp/core/src/binary/binary_reader.cpp       |  152 --
 .../cpp/core/src/binary/binary_type.cpp         |   51 -
 .../cpp/core/src/binary/binary_writer.cpp       |  154 --
 modules/platforms/cpp/core/src/guid.cpp         |   65 -
 modules/platforms/cpp/core/src/ignite_error.cpp |  222 ---
 modules/platforms/cpp/core/src/ignition.cpp     |    4 +-
 .../core/src/impl/binary/binary_reader_impl.cpp |  760 --------
 .../cpp/core/src/impl/binary/binary_schema.cpp  |  135 --
 .../src/impl/binary/binary_type_handler.cpp     |   78 -
 .../src/impl/binary/binary_type_manager.cpp     |  201 ---
 .../src/impl/binary/binary_type_snapshot.cpp    |   70 -
 .../src/impl/binary/binary_type_updater.cpp     |   32 -
 .../impl/binary/binary_type_updater_impl.cpp    |   96 -
 .../cpp/core/src/impl/binary/binary_utils.cpp   |  211 ---
 .../core/src/impl/binary/binary_writer_impl.cpp |  623 -------
 .../cpp/core/src/impl/cache/cache_impl.cpp      |    4 +-
 .../cpp/core/src/impl/ignite_environment.cpp    |  167 --
 .../src/impl/interop/interop_input_stream.cpp   |  235 ---
 .../core/src/impl/interop/interop_memory.cpp    |  182 --
 .../src/impl/interop/interop_output_stream.cpp  |  233 ---
 modules/platforms/cpp/examples/configure.ac     |    2 +-
 modules/platforms/cpp/ignite/configure.ac       |    2 +-
 .../cpp/ignite/project/vs/ignite.vcxproj        |   27 +-
 .../ignite/project/vs/ignite.vcxproj.filters    |    8 -
 modules/platforms/cpp/ignite/src/ignite.cpp     |    8 +-
 .../platforms/cpp/odbc/odbc-driver/Makefile.am  |   67 +
 .../platforms/cpp/odbc/odbc-driver/configure.ac |   62 +
 .../cpp/odbc/odbc-driver/ignite-odbc.pc.in      |    9 +
 .../ignite/odbc/app/application_data_buffer.h   |  342 ++++
 .../include/ignite/odbc/app/parameter.h         |  113 ++
 .../odbc-driver/include/ignite/odbc/column.h    |  149 ++
 .../include/ignite/odbc/common_types.h          |  225 +++
 .../include/ignite/odbc/config/configuration.h  |  164 ++
 .../ignite/odbc/config/connection_info.h        |   98 +
 .../include/ignite/odbc/connection.h            |  258 +++
 .../odbc-driver/include/ignite/odbc/cursor.h    |  108 ++
 .../odbc-driver/include/ignite/odbc/decimal.h   |  126 ++
 .../ignite/odbc/diagnostic/diagnosable.h        |   82 +
 .../odbc/diagnostic/diagnosable_adapter.h       |  107 ++
 .../ignite/odbc/diagnostic/diagnostic_record.h  |  165 ++
 .../odbc/diagnostic/diagnostic_record_storage.h |  198 ++
 .../include/ignite/odbc/environment.h           |  137 ++
 .../odbc-driver/include/ignite/odbc/message.h   |  630 +++++++
 .../include/ignite/odbc/meta/column_meta.h      |  210 +++
 .../include/ignite/odbc/meta/primary_key_meta.h |  188 ++
 .../include/ignite/odbc/meta/table_meta.h       |  166 ++
 .../odbc-driver/include/ignite/odbc/parser.h    |  141 ++
 .../ignite/odbc/query/column_metadata_query.h   |  146 ++
 .../include/ignite/odbc/query/data_query.h      |  152 ++
 .../ignite/odbc/query/foreign_keys_query.h      |  143 ++
 .../ignite/odbc/query/primary_keys_query.h      |  137 ++
 .../include/ignite/odbc/query/query.h           |  119 ++
 .../ignite/odbc/query/special_columns_query.h   |  142 ++
 .../ignite/odbc/query/table_metadata_query.h    |  150 ++
 .../include/ignite/odbc/query/type_info_query.h |  118 ++
 .../include/ignite/odbc/result_page.h           |  101 ++
 .../odbc/odbc-driver/include/ignite/odbc/row.h  |  132 ++
 .../odbc-driver/include/ignite/odbc/statement.h |  525 ++++++
 .../include/ignite/odbc/system/odbc_constants.h |   45 +
 .../include/ignite/odbc/system/socket_client.h  |   92 +
 .../include/ignite/odbc/type_traits.h           |  313 ++++
 .../odbc-driver/include/ignite/odbc/utility.h   |  171 ++
 .../os/linux/src/system/socket_client.cpp       |  120 ++
 .../os/win/src/system/socket_client.cpp         |  133 ++
 .../cpp/odbc/odbc-driver/project/README.TXT     |    1 +
 .../cpp/odbc/odbc-driver/project/vs/README.TXT  |    1 +
 .../cpp/odbc/odbc-driver/project/vs/module.def  |   69 +
 .../odbc-driver/project/vs/odbc-driver.vcxproj  |  233 +++
 .../project/vs/odbc-driver.vcxproj.filters      |  229 +++
 .../src/app/application_data_buffer.cpp         |  834 +++++++++
 .../cpp/odbc/odbc-driver/src/app/parameter.cpp  |  147 ++
 .../cpp/odbc/odbc-driver/src/column.cpp         |  454 +++++
 .../cpp/odbc/odbc-driver/src/common_types.cpp   |  120 ++
 .../odbc-driver/src/config/configuration.cpp    |  245 +++
 .../odbc-driver/src/config/connection_info.cpp  |  419 +++++
 .../cpp/odbc/odbc-driver/src/connection.cpp     |  269 +++
 .../cpp/odbc/odbc-driver/src/cursor.cpp         |   78 +
 .../cpp/odbc/odbc-driver/src/decimal.cpp        |  117 ++
 .../src/diagnostic/diagnosable_adapter.cpp      |   49 +
 .../src/diagnostic/diagnostic_record.cpp        |  241 +++
 .../diagnostic/diagnostic_record_storage.cpp    |  242 +++
 .../cpp/odbc/odbc-driver/src/environment.cpp    |  172 ++
 .../odbc/odbc-driver/src/meta/column_meta.cpp   |  275 +++
 .../odbc/odbc-driver/src/meta/table_meta.cpp    |   50 +
 .../platforms/cpp/odbc/odbc-driver/src/odbc.cpp | 1687 ++++++++++++++++++
 .../src/query/column_metadata_query.cpp         |  317 ++++
 .../odbc/odbc-driver/src/query/data_query.cpp   |  277 +++
 .../src/query/foreign_keys_query.cpp            |  131 ++
 .../src/query/primary_keys_query.cpp            |  210 +++
 .../src/query/special_columns_query.cpp         |  121 ++
 .../src/query/table_metadata_query.cpp          |  242 +++
 .../odbc-driver/src/query/type_info_query.cpp   |  394 ++++
 .../cpp/odbc/odbc-driver/src/result_page.cpp    |   58 +
 .../platforms/cpp/odbc/odbc-driver/src/row.cpp  |  120 ++
 .../cpp/odbc/odbc-driver/src/statement.cpp      |  529 ++++++
 .../cpp/odbc/odbc-driver/src/type_traits.cpp    |  657 +++++++
 .../cpp/odbc/odbc-driver/src/utility.cpp        |  105 ++
 .../platforms/cpp/odbc/odbc-test/Makefile.am    |   55 +
 modules/platforms/cpp/odbc/odbc-test/README.TXT |    1 +
 .../platforms/cpp/odbc/odbc-test/configure.ac   |   62 +
 .../odbc/odbc-test/include/teamcity_messages.h  |   55 +
 .../odbc/odbc-test/project/vs/odbc-test.vcxproj |  189 ++
 .../project/vs/odbc-test.vcxproj.filters        |   79 +
 .../src/application_data_buffer_test.cpp        |  630 +++++++
 .../cpp/odbc/odbc-test/src/column_test.cpp      |  290 +++
 .../odbc/odbc-test/src/configuration_test.cpp   |  206 +++
 .../odbc/odbc-test/src/connection_info_test.cpp |  219 +++
 .../cpp/odbc/odbc-test/src/cursor_test.cpp      |  166 ++
 .../cpp/odbc/odbc-test/src/parser_test.cpp      |   94 +
 .../cpp/odbc/odbc-test/src/row_test.cpp         |  167 ++
 .../cpp/odbc/odbc-test/src/teamcity_boost.cpp   |  159 ++
 .../odbc/odbc-test/src/teamcity_messages.cpp    |  150 ++
 .../cpp/odbc/odbc-test/src/utility_test.cpp     |   81 +
 modules/platforms/cpp/odbc/project/vs/odbc.sln  |   58 +
 modules/platforms/cpp/project/vs/ignite.sln     |   19 +
 modules/platforms/cpp/project/vs/ignite.slnrel  |   13 +
 .../platforms/cpp/project/vs/ignite_x86.slnrel  |   13 +
 .../Properties/AssemblyInfo.cs                  |    6 +-
 .../Properties/AssemblyInfo.cs                  |    6 +-
 .../Properties/AssemblyInfo.cs                  |    6 +-
 .../Properties/AssemblyInfo.cs                  |    6 +-
 .../Apache.Ignite/Properties/AssemblyInfo.cs    |    6 +-
 .../Properties/AssemblyInfo.cs                  |    6 +-
 .../Properties/AssemblyInfo.cs                  |    6 +-
 modules/rest-http/pom.xml                       |    2 +-
 modules/scalar-2.10/pom.xml                     |    2 +-
 modules/scalar/pom.xml                          |    2 +-
 modules/schedule/pom.xml                        |    2 +-
 modules/schema-import/pom.xml                   |    2 +-
 modules/slf4j/pom.xml                           |    2 +-
 modules/spark-2.10/pom.xml                      |    2 +-
 modules/spark/pom.xml                           |    2 +-
 modules/spring/pom.xml                          |    2 +-
 modules/ssh/pom.xml                             |    2 +-
 modules/tools/pom.xml                           |    2 +-
 modules/twitter/pom.xml                         |    2 +-
 modules/urideploy/pom.xml                       |    2 +-
 modules/visor-console-2.10/pom.xml              |    2 +-
 modules/visor-console/pom.xml                   |    2 +-
 modules/visor-plugins/pom.xml                   |    2 +-
 modules/web/pom.xml                             |    2 +-
 modules/yardstick/pom.xml                       |    2 +-
 modules/yarn/pom.xml                            |    2 +-
 modules/zookeeper/pom.xml                       |    2 +-
 pom.xml                                         |    2 +-
 317 files changed, 33902 insertions(+), 12973 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/9628396c/modules/core/pom.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/9628396c/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/9628396c/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorIgfsConfiguration.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/9628396c/pom.xml
----------------------------------------------------------------------


[34/50] ignite git commit: IGNITE-2242: fix for SQLGetData.

Posted by vo...@apache.org.
IGNITE-2242: fix for SQLGetData.


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

Branch: refs/heads/ignite-1786
Commit: 4b25500a2aca321e3e4c41ba9c99e1ab5b75e166
Parents: 0d47aa7
Author: isapego <is...@gridgain.com>
Authored: Wed Jan 20 19:27:56 2016 +0300
Committer: isapego <is...@gridgain.com>
Committed: Wed Jan 20 19:27:56 2016 +0300

----------------------------------------------------------------------
 modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/4b25500a/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp
index b9d6099..97b1569 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp
@@ -1285,7 +1285,7 @@ SQLRETURN SQL_API SQLGetData(SQLHSTMT       stmt,
 
     ApplicationDataBuffer dataBuffer(driverType, targetValue, bufferLength, strLengthOrIndicator);
 
-    //statement->GetColumnData(colNum, dataBuffer);
+    statement->GetColumnData(colNum, dataBuffer);
 
     return statement->GetDiagnosticRecords().GetReturnCode();
 }


[33/50] ignite git commit: IGNITE-2242: Adjusted offset incrementation.

Posted by vo...@apache.org.
IGNITE-2242: Adjusted offset incrementation.


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

Branch: refs/heads/ignite-1786
Commit: 0d47aa7eebb0eade89af2408de8310c1ea84965a
Parents: 895901a
Author: isapego <is...@gridgain.com>
Authored: Wed Jan 20 18:42:04 2016 +0300
Committer: isapego <is...@gridgain.com>
Committed: Wed Jan 20 18:42:04 2016 +0300

----------------------------------------------------------------------
 .../ignite/odbc/app/application_data_buffer.h   |  6 ++--
 .../src/app/application_data_buffer.cpp         | 30 ++++++++++++++++++--
 .../cpp/odbc/odbc-driver/src/column.cpp         | 10 +++----
 3 files changed, 37 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/0d47aa7e/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/app/application_data_buffer.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/app/application_data_buffer.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/app/application_data_buffer.h
index d77f598..051f459 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/app/application_data_buffer.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/app/application_data_buffer.h
@@ -132,8 +132,9 @@ namespace ignite
                  * Put in buffer value of type string.
                  *
                  * @param value Value.
+                 * @return Number of bytes that have been put in buffer.
                  */
-                void PutString(const std::string& value);
+                int32_t PutString(const std::string& value);
 
                 /**
                  * Put in buffer value of type GUID.
@@ -147,8 +148,9 @@ namespace ignite
                  *
                  * @param data Data pointer.
                  * @param len Data length.
+                 * @return Number of bytes that have been put in buffer.
                  */
-                void PutBinaryData(void* data, size_t len);
+                int32_t PutBinaryData(void* data, size_t len);
 
                 /**
                  * Put NULL.

http://git-wip-us.apache.org/repos/asf/ignite/blob/0d47aa7e/modules/platforms/cpp/odbc/odbc-driver/src/app/application_data_buffer.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/app/application_data_buffer.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/app/application_data_buffer.cpp
index 5096820..e10011b 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/app/application_data_buffer.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/app/application_data_buffer.cpp
@@ -318,9 +318,12 @@ namespace ignite
                 PutNum(value);
             }
 
-            void ApplicationDataBuffer::PutString(const std::string & value)
+            int32_t ApplicationDataBuffer::PutString(const std::string & value)
             {
                 using namespace type_traits;
+
+                int32_t used = 0;
+
                 switch (type)
                 {
                     case IGNITE_ODBC_C_TYPE_SIGNED_TINYINT:
@@ -342,6 +345,8 @@ namespace ignite
 
                         PutNum(numValue);
 
+                        used = static_cast<int32_t>(value.size());
+
                         break;
                     }
 
@@ -356,6 +361,8 @@ namespace ignite
 
                         PutNum(numValue);
 
+                        used = static_cast<int32_t>(value.size());
+
                         break;
                     }
 
@@ -365,6 +372,8 @@ namespace ignite
                     {
                         PutStrToStrBuffer<char>(value);
 
+                        used = static_cast<int32_t>(GetSize()) - 1;
+
                         break;
                     }
 
@@ -372,6 +381,8 @@ namespace ignite
                     {
                         PutStrToStrBuffer<wchar_t>(value);
 
+                        used = (static_cast<int32_t>(GetSize()) / 2) - 1;
+
                         break;
                     }
 
@@ -381,11 +392,14 @@ namespace ignite
                             *GetResLen() = SQL_NO_TOTAL;
                     }
                 }
+
+                return used < 0 ? 0 : used;
             }
 
             void ApplicationDataBuffer::PutGuid(const Guid & value)
             {
                 using namespace type_traits;
+
                 switch (type)
                 {
                     case IGNITE_ODBC_C_TYPE_CHAR:
@@ -425,15 +439,21 @@ namespace ignite
                 }
             }
 
-            void ApplicationDataBuffer::PutBinaryData(void *data, size_t len)
+            int32_t ApplicationDataBuffer::PutBinaryData(void *data, size_t len)
             {
                 using namespace type_traits;
+
+                int32_t used = 0;
+
                 switch (type)
                 {
                     case IGNITE_ODBC_C_TYPE_BINARY:
                     case IGNITE_ODBC_C_TYPE_DEFAULT:
                     {
                         PutRawDataToBuffer(data, len);
+
+                        used = static_cast<int32_t>(GetSize());
+
                         break;
                     }
 
@@ -453,6 +473,8 @@ namespace ignite
 
                         PutStrToStrBuffer<char>(converter.str());
 
+                        used = static_cast<int32_t>(GetSize()) - 1;
+
                         break;
                     }
 
@@ -472,6 +494,8 @@ namespace ignite
 
                         PutStrToStrBuffer<wchar_t>(converter.str());
 
+                        used = static_cast<int32_t>(GetSize() / 2) - 1;
+
                         break;
                     }
 
@@ -481,6 +505,8 @@ namespace ignite
                             *GetResLen() = SQL_NO_TOTAL;
                     }
                 }
+
+                return used < 0 ? 0 : used;
             }
 
             void ApplicationDataBuffer::PutNull()

http://git-wip-us.apache.org/repos/asf/ignite/blob/0d47aa7e/modules/platforms/cpp/odbc/odbc-driver/src/column.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/column.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/column.cpp
index 27c413a..7b2f1e9 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/column.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/column.cpp
@@ -373,9 +373,9 @@ namespace ignite
                     std::string str;
                     utility::ReadString(reader, str);
 
-                    dataBuf.PutString(str.substr(offset));
+                    int32_t written = dataBuf.PutString(str.substr(offset));
 
-                    IncreaseOffset(static_cast<int32_t>(dataBuf.GetSize() - 1));
+                    IncreaseOffset(written);
 
                     break;
                 }
@@ -395,7 +395,7 @@ namespace ignite
                 {
                     dataBuf.PutNull();
 
-                    IncreaseOffset(static_cast<int32_t>(dataBuf.GetSize()));
+                    IncreaseOffset(size);
 
                     break;
                 }
@@ -411,9 +411,9 @@ namespace ignite
 
                     stream->ReadInt8Array(&data[0], static_cast<int32_t>(data.size()));
 
-                    dataBuf.PutBinaryData(data.data() + offset, static_cast<size_t>(len - offset));
+                    int32_t written = dataBuf.PutBinaryData(data.data() + offset, static_cast<size_t>(len - offset));
 
-                    IncreaseOffset(static_cast<int32_t>(dataBuf.GetSize()));
+                    IncreaseOffset(written);
 
                     break;
                 }


[21/50] ignite git commit: IGNITE-2240: SQLEndTran implemented.

Posted by vo...@apache.org.
IGNITE-2240: SQLEndTran implemented.


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

Branch: refs/heads/ignite-1786
Commit: 37de912937fafb35bae750a0e34131301c449ee7
Parents: 97c795b
Author: isapego <is...@gridgain.com>
Authored: Thu Jan 14 20:56:51 2016 +0300
Committer: isapego <is...@gridgain.com>
Committed: Thu Jan 14 20:56:51 2016 +0300

----------------------------------------------------------------------
 .../include/ignite/odbc/connection.h            | 26 ++++++++
 .../include/ignite/odbc/environment.h           | 26 ++++++++
 .../cpp/odbc/odbc-driver/src/connection.cpp     | 23 +++++++
 .../cpp/odbc/odbc-driver/src/environment.cpp    | 22 +++++++
 .../platforms/cpp/odbc/odbc-driver/src/odbc.cpp | 65 +++++++++++++++++---
 5 files changed, 154 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/37de9129/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/connection.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/connection.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/connection.h
index 068b804..f0f22cf 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/connection.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/connection.h
@@ -150,6 +150,16 @@ namespace ignite
                 return true;
             }
 
+            /**
+             * Perform transaction commit.
+             */
+            void TransactionCommit();
+
+            /**
+             * Perform transaction rollback.
+             */
+            void TransactionRollback();
+
         private:
             IGNITE_NO_COPY_ASSIGNMENT(Connection);
 
@@ -194,6 +204,22 @@ namespace ignite
             SqlResult InternalCreateStatement(Statement*& statement);
 
             /**
+             * Perform transaction commit on all the associated connections.
+             * Internal call.
+             *
+             * @return Operation result.
+             */
+            SqlResult InternalTransactionCommit();
+
+            /**
+             * Perform transaction rollback on all the associated connections.
+             * Internal call.
+             *
+             * @return Operation result.
+             */
+            SqlResult InternalTransactionRollback();
+
+            /**
              * Constructor.
              */
             Connection();

http://git-wip-us.apache.org/repos/asf/ignite/blob/37de9129/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/environment.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/environment.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/environment.h
index 5db2914..14d3613 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/environment.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/environment.h
@@ -49,6 +49,16 @@ namespace ignite
              */
             Connection* CreateConnection();
 
+            /**
+             * Perform transaction commit on all the associated connections.
+             */
+            void TransactionCommit();
+
+            /**
+             * Perform transaction rollback on all the associated connections.
+             */
+            void TransactionRollback();
+
         private:
             IGNITE_NO_COPY_ASSIGNMENT(Environment);
 
@@ -60,6 +70,22 @@ namespace ignite
              * @return Operation result.
              */
             SqlResult InternalCreateConnection(Connection*& connection);
+
+            /**
+             * Perform transaction commit on all the associated connections.
+             * Internal call.
+             *
+             * @return Operation result.
+             */
+            SqlResult InternalTransactionCommit();
+
+            /**
+             * Perform transaction rollback on all the associated connections.
+             * Internal call.
+             *
+             * @return Operation result.
+             */
+            SqlResult InternalTransactionRollback();
         };
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/37de9129/modules/platforms/cpp/odbc/odbc-driver/src/connection.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/connection.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/connection.cpp
index ad16238..47494eb 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/connection.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/connection.cpp
@@ -221,6 +221,29 @@ namespace ignite
         {
             return diagnostic::DiagnosticRecord(sqlState, message, "", "", rowNum, columnNum);
         }
+
+        void Connection::TransactionCommit()
+        {
+            IGNITE_ODBC_API_CALL(InternalTransactionCommit());
+        }
+
+        SqlResult Connection::InternalTransactionCommit()
+        {
+            return SQL_RESULT_SUCCESS;
+        }
+
+        void Connection::TransactionRollback()
+        {
+            IGNITE_ODBC_API_CALL(InternalTransactionRollback());
+        }
+
+        SqlResult Connection::InternalTransactionRollback()
+        {
+            AddStatusRecord(SQL_STATE_HYC00_OPTIONAL_FEATURE_NOT_IMPLEMENTED,
+                "Rollback operation is not supported.");
+
+            return SQL_RESULT_ERROR;
+        }
     }
 }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/37de9129/modules/platforms/cpp/odbc/odbc-driver/src/environment.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/environment.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/environment.cpp
index fa68e83..0063e87 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/environment.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/environment.cpp
@@ -41,6 +41,28 @@ namespace ignite
             return connection;
         }
 
+        void Environment::TransactionCommit()
+        {
+            IGNITE_ODBC_API_CALL(InternalTransactionCommit());
+        }
+
+        SqlResult Environment::InternalTransactionCommit()
+        {
+            return SQL_RESULT_SUCCESS;
+        }
+
+        void Environment::TransactionRollback()
+        {
+            IGNITE_ODBC_API_CALL(InternalTransactionRollback());
+        }
+
+        SqlResult Environment::InternalTransactionRollback()
+        {
+            AddStatusRecord(SQL_STATE_HYC00_OPTIONAL_FEATURE_NOT_IMPLEMENTED,
+                "Rollback operation is not supported.");
+
+            return SQL_RESULT_ERROR;
+        }
 
         SqlResult Environment::InternalCreateConnection(Connection*& connection)
         {

http://git-wip-us.apache.org/repos/asf/ignite/blob/37de9129/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp
index 824cb32..b819744 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp
@@ -1210,6 +1210,63 @@ SQLRETURN SQL_API SQLGetTypeInfo(SQLHSTMT       stmt,
     return statement->GetDiagnosticRecords().GetReturnCode();
 }
 
+SQLRETURN SQL_API SQLEndTran(SQLSMALLINT    handleType,
+                             SQLHANDLE      handle,
+                             SQLSMALLINT    completionType)
+{
+    using namespace ignite::odbc;
+
+    LOG_MSG("SQLEndTran called\n");
+
+    SQLRETURN result;
+
+    switch (handleType)
+    {
+        case SQL_HANDLE_ENV:
+        {
+            Environment *env = reinterpret_cast<Environment*>(handle);
+
+            if (!env)
+                return SQL_INVALID_HANDLE;
+
+            if (completionType == SQL_COMMIT)
+                env->TransactionCommit();
+            else
+                env->TransactionRollback();
+
+            result = env->GetDiagnosticRecords().GetReturnCode();
+
+            break;
+        }
+
+        case SQL_HANDLE_DBC:
+        {
+            Connection *conn = reinterpret_cast<Connection*>(handle);
+
+            if (!conn)
+                return SQL_INVALID_HANDLE;
+
+            if (completionType == SQL_COMMIT)
+                conn->TransactionCommit();
+            else
+                conn->TransactionRollback();
+
+            result = conn->GetDiagnosticRecords().GetReturnCode();
+
+            break;
+        }
+
+        default:
+        {
+            result = SQL_INVALID_HANDLE;
+
+            break;
+        }
+    }
+
+    return result;
+}
+
 //
 // ==== Not implemented ====
 //
@@ -1471,14 +1528,6 @@ SQLRETURN SQL_API SQLCopyDesc(SQLHDESC src, SQLHDESC dst)
     return SQL_SUCCESS;
 }
 
-SQLRETURN SQL_API SQLEndTran(SQLSMALLINT    handleType,
-                             SQLHANDLE      handle,
-                             SQLSMALLINT    completionType)
-{
-    LOG_MSG("SQLEndTran called\n");
-    return SQL_SUCCESS;
-}
-
 SQLRETURN SQL_API SQLGetDescField(SQLHDESC      descr,
                                   SQLSMALLINT   recNum,
                                   SQLSMALLINT   fieldId,


[18/50] ignite git commit: IGNITE-2241: Moved to type_traits.

Posted by vo...@apache.org.
IGNITE-2241: Moved to type_traits.


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

Branch: refs/heads/ignite-1786
Commit: 77ba349b7cf69253e69c94ccb9b691e76e972106
Parents: 34834c6
Author: isapego <is...@gridgain.com>
Authored: Wed Jan 13 18:11:38 2016 +0300
Committer: isapego <is...@gridgain.com>
Committed: Wed Jan 13 18:11:38 2016 +0300

----------------------------------------------------------------------
 .../include/ignite/odbc/common_types.h          | 53 ------------
 .../include/ignite/odbc/type_traits.h           | 53 ++++++++++++
 .../cpp/odbc/odbc-driver/src/common_types.cpp   | 88 -------------------
 .../odbc/odbc-driver/src/meta/column_meta.cpp   |  3 +-
 .../src/query/column_metadata_query.cpp         |  2 +
 .../src/query/foreign_keys_query.cpp            |  2 +
 .../src/query/primary_keys_query.cpp            |  2 +
 .../src/query/table_metadata_query.cpp          |  2 +
 .../cpp/odbc/odbc-driver/src/type_traits.cpp    | 89 ++++++++++++++++++++
 9 files changed, 152 insertions(+), 142 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/77ba349b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/common_types.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/common_types.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/common_types.h
index 187568f..80562c5 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/common_types.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/common_types.h
@@ -20,56 +20,11 @@
 
 #include <stdint.h>
 
-#include <string>
-
 namespace ignite
 {
     namespace odbc
     {
         /**
-         * SQL type name constants.
-         */
-        class SqlTypeName
-        {
-        public:
-            /** VARCHAR SQL type name constant. */
-            static const std::string VARCHAR;
-
-            /** SMALLINT SQL type name constant. */
-            static const std::string SMALLINT;
-
-            /** INTEGER SQL type name constant. */
-            static const std::string INTEGER;
-
-            /** DECIMAL SQL type name constant. */
-            static const std::string DECIMAL;
-
-            /** FLOAT SQL type name constant. */
-            static const std::string FLOAT;
-
-            /** DOUBLE SQL type name constant. */
-            static const std::string DOUBLE;
-
-            /** BIT SQL type name constant. */
-            static const std::string BIT;
-
-            /** TINYINT SQL type name constant. */
-            static const std::string TINYINT;
-
-            /** BIGINT SQL type name constant. */
-            static const std::string BIGINT;
-
-            /** BINARY SQL type name constant. */
-            static const std::string BINARY;
-
-            /** DATE SQL type name constant. */
-            static const std::string DATE;
-
-            /** GUID SQL type name constant. */
-            static const std::string GUID;
-        };
-
-        /**
          * SQL result.
          */
         enum SqlResult
@@ -211,14 +166,6 @@ namespace ignite
         };
 
         /**
-         * Get SQL type name for the binary type.
-         *
-         * @param binaryType Binary type.
-         * @return Corresponding SQL type name.
-         */
-        const std::string& BinaryTypeToSqlTypeName(int8_t binaryType);
-
-        /**
          * Convert internal Ignite type into ODBC SQL return code.
          *
          * @param result Internal result type.

http://git-wip-us.apache.org/repos/asf/ignite/blob/77ba349b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/type_traits.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/type_traits.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/type_traits.h
index 7dac73f..094e189 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/type_traits.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/type_traits.h
@@ -20,6 +20,8 @@
 
 #include <stdint.h>
 
+#include <string>
+
 namespace ignite
 {
     namespace odbc
@@ -108,6 +110,57 @@ namespace ignite
             };
 
             /**
+             * SQL type name constants.
+             */
+            class SqlTypeName
+            {
+            public:
+                /** VARCHAR SQL type name constant. */
+                static const std::string VARCHAR;
+
+                /** SMALLINT SQL type name constant. */
+                static const std::string SMALLINT;
+
+                /** INTEGER SQL type name constant. */
+                static const std::string INTEGER;
+
+                /** DECIMAL SQL type name constant. */
+                static const std::string DECIMAL;
+
+                /** FLOAT SQL type name constant. */
+                static const std::string FLOAT;
+
+                /** DOUBLE SQL type name constant. */
+                static const std::string DOUBLE;
+
+                /** BIT SQL type name constant. */
+                static const std::string BIT;
+
+                /** TINYINT SQL type name constant. */
+                static const std::string TINYINT;
+
+                /** BIGINT SQL type name constant. */
+                static const std::string BIGINT;
+
+                /** BINARY SQL type name constant. */
+                static const std::string BINARY;
+
+                /** DATE SQL type name constant. */
+                static const std::string DATE;
+
+                /** GUID SQL type name constant. */
+                static const std::string GUID;
+            };
+
+            /**
+             * Get SQL type name for the binary type.
+             *
+             * @param binaryType Binary type.
+             * @return Corresponding SQL type name.
+             */
+            const std::string& BinaryTypeToSqlTypeName(int8_t binaryType);
+
+            /**
              * Check if the C type supported by the current implementation.
              *
              * @param type Application type.

http://git-wip-us.apache.org/repos/asf/ignite/blob/77ba349b/modules/platforms/cpp/odbc/odbc-driver/src/common_types.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/common_types.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/common_types.cpp
index f438717..9086321 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/common_types.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/common_types.cpp
@@ -24,94 +24,6 @@ namespace ignite
 {
     namespace odbc
     {
-        const std::string SqlTypeName::VARCHAR("LONG VARCHAR");
-
-        const std::string SqlTypeName::SMALLINT("SMALLINT");
-
-        const std::string SqlTypeName::INTEGER("INTEGER");
-
-        const std::string SqlTypeName::DECIMAL("DECIMAL");
-
-        const std::string SqlTypeName::FLOAT("FLOAT");
-
-        const std::string SqlTypeName::DOUBLE("DOUBLE");
-
-        const std::string SqlTypeName::BIT("BIT");
-
-        const std::string SqlTypeName::TINYINT("TINYINT");
-
-        const std::string SqlTypeName::BIGINT("BIGINT");
-
-        const std::string SqlTypeName::BINARY("LONG VARBINARY");
-
-        const std::string SqlTypeName::DATE("DATE");
-
-        const std::string SqlTypeName::GUID("GUID");
-
-        const std::string& BinaryTypeToSqlTypeName(int8_t binaryType)
-        {
-            using namespace ignite::impl::binary;
-
-            switch (binaryType)
-            {
-                case IGNITE_TYPE_STRING:
-                    return SqlTypeName::VARCHAR;
-
-                case IGNITE_TYPE_SHORT:
-                    return SqlTypeName::SMALLINT;
-
-                case IGNITE_TYPE_INT:
-                    return SqlTypeName::INTEGER;
-
-                case IGNITE_TYPE_DECIMAL:
-                    return SqlTypeName::DECIMAL;
-
-                case IGNITE_TYPE_FLOAT:
-                    return SqlTypeName::FLOAT;
-
-                case IGNITE_TYPE_DOUBLE:
-                    return SqlTypeName::DOUBLE;
-
-                case IGNITE_TYPE_BOOL:
-                    return SqlTypeName::BIT;
-
-                case IGNITE_TYPE_BYTE:
-                case IGNITE_TYPE_CHAR:
-                    return SqlTypeName::TINYINT;
-
-                case IGNITE_TYPE_LONG:
-                    return SqlTypeName::BIGINT;
-
-                case IGNITE_TYPE_UUID:
-                    return SqlTypeName::GUID;
-
-                case IGNITE_TYPE_DATE:
-                    return SqlTypeName::DATE;
-
-                case IGNITE_TYPE_OBJECT:
-                case IGNITE_TYPE_ARRAY_BYTE:
-                case IGNITE_TYPE_ARRAY_SHORT:
-                case IGNITE_TYPE_ARRAY_INT:
-                case IGNITE_TYPE_ARRAY_LONG:
-                case IGNITE_TYPE_ARRAY_FLOAT:
-                case IGNITE_TYPE_ARRAY_DOUBLE:
-                case IGNITE_TYPE_ARRAY_CHAR:
-                case IGNITE_TYPE_ARRAY_BOOL:
-                case IGNITE_TYPE_ARRAY_DECIMAL:
-                case IGNITE_TYPE_ARRAY_STRING:
-                case IGNITE_TYPE_ARRAY_UUID:
-                case IGNITE_TYPE_ARRAY_DATE:
-                case IGNITE_TYPE_ARRAY:
-                case IGNITE_TYPE_COLLECTION:
-                case IGNITE_TYPE_MAP:
-                case IGNITE_TYPE_MAP_ENTRY:
-                case IGNITE_TYPE_BINARY:
-                default:
-                    return SqlTypeName::BINARY;
-            }
-
-            return SqlTypeName::BINARY;
-        }
 
         int SqlResultToReturnCode(SqlResult result)
         {

http://git-wip-us.apache.org/repos/asf/ignite/blob/77ba349b/modules/platforms/cpp/odbc/odbc-driver/src/meta/column_meta.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/meta/column_meta.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/meta/column_meta.cpp
index b2eff6a..b0d5015 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/meta/column_meta.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/meta/column_meta.cpp
@@ -69,6 +69,7 @@ namespace ignite
             }
 
 #undef DBG_STR_CASE
+
 #endif
 
             void ColumnMeta::Read(ignite::impl::binary::BinaryReaderImpl& reader)
@@ -132,7 +133,7 @@ namespace ignite
                     case SQL_DESC_TYPE_NAME:
                     case SQL_DESC_LOCAL_TYPE_NAME:
                     {
-                        value = BinaryTypeToSqlTypeName(dataType);
+                        value = type_traits::BinaryTypeToSqlTypeName(dataType);
 
                         return true;
                     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/77ba349b/modules/platforms/cpp/odbc/odbc-driver/src/query/column_metadata_query.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/query/column_metadata_query.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/query/column_metadata_query.cpp
index a17fd36..a4db450 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/query/column_metadata_query.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/query/column_metadata_query.cpp
@@ -83,6 +83,8 @@ namespace ignite
                 columnsMeta()
             {
                 using namespace ignite::impl::binary;
+                using namespace ignite::odbc::type_traits;
+
                 using meta::ColumnMeta;
 
                 columnsMeta.reserve(12);

http://git-wip-us.apache.org/repos/asf/ignite/blob/77ba349b/modules/platforms/cpp/odbc/odbc-driver/src/query/foreign_keys_query.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/query/foreign_keys_query.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/query/foreign_keys_query.cpp
index 7fb16ce..83aba0c 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/query/foreign_keys_query.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/query/foreign_keys_query.cpp
@@ -44,6 +44,8 @@ namespace ignite
                 columnsMeta()
             {
                 using namespace ignite::impl::binary;
+                using namespace ignite::odbc::type_traits;
+
                 using meta::ColumnMeta;
 
                 columnsMeta.reserve(14);

http://git-wip-us.apache.org/repos/asf/ignite/blob/77ba349b/modules/platforms/cpp/odbc/odbc-driver/src/query/primary_keys_query.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/query/primary_keys_query.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/query/primary_keys_query.cpp
index 0b7ad9d..b1a508e 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/query/primary_keys_query.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/query/primary_keys_query.cpp
@@ -64,6 +64,8 @@ namespace ignite
                 columnsMeta()
             {
                 using namespace ignite::impl::binary;
+                using namespace ignite::odbc::type_traits;
+
                 using meta::ColumnMeta;
 
                 columnsMeta.reserve(6);

http://git-wip-us.apache.org/repos/asf/ignite/blob/77ba349b/modules/platforms/cpp/odbc/odbc-driver/src/query/table_metadata_query.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/query/table_metadata_query.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/query/table_metadata_query.cpp
index 779eb22..d381ee4 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/query/table_metadata_query.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/query/table_metadata_query.cpp
@@ -63,6 +63,8 @@ namespace ignite
                 columnsMeta()
             {
                 using namespace ignite::impl::binary;
+                using namespace ignite::odbc::type_traits;
+
                 using meta::ColumnMeta;
 
                 columnsMeta.reserve(5);

http://git-wip-us.apache.org/repos/asf/ignite/blob/77ba349b/modules/platforms/cpp/odbc/odbc-driver/src/type_traits.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/type_traits.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/type_traits.cpp
index 2986077..813d606 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/type_traits.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/type_traits.cpp
@@ -35,6 +35,29 @@ namespace ignite
     {
         namespace type_traits
         {
+            const std::string SqlTypeName::VARCHAR("LONG VARCHAR");
+
+            const std::string SqlTypeName::SMALLINT("SMALLINT");
+
+            const std::string SqlTypeName::INTEGER("INTEGER");
+
+            const std::string SqlTypeName::DECIMAL("DECIMAL");
+
+            const std::string SqlTypeName::FLOAT("FLOAT");
+
+            const std::string SqlTypeName::DOUBLE("DOUBLE");
+
+            const std::string SqlTypeName::BIT("BIT");
+
+            const std::string SqlTypeName::TINYINT("TINYINT");
+
+            const std::string SqlTypeName::BIGINT("BIGINT");
+
+            const std::string SqlTypeName::BINARY("LONG VARBINARY");
+
+            const std::string SqlTypeName::DATE("DATE");
+
+            const std::string SqlTypeName::GUID("GUID");
 
 #ifdef _DEBUG
 
@@ -86,6 +109,72 @@ namespace ignite
 #undef DBG_STR_CASE
 #endif
 
+            const std::string& BinaryTypeToSqlTypeName(int8_t binaryType)
+            {
+                using namespace ignite::impl::binary;
+
+                switch (binaryType)
+                {
+                case IGNITE_TYPE_STRING:
+                    return SqlTypeName::VARCHAR;
+
+                case IGNITE_TYPE_SHORT:
+                    return SqlTypeName::SMALLINT;
+
+                case IGNITE_TYPE_INT:
+                    return SqlTypeName::INTEGER;
+
+                case IGNITE_TYPE_DECIMAL:
+                    return SqlTypeName::DECIMAL;
+
+                case IGNITE_TYPE_FLOAT:
+                    return SqlTypeName::FLOAT;
+
+                case IGNITE_TYPE_DOUBLE:
+                    return SqlTypeName::DOUBLE;
+
+                case IGNITE_TYPE_BOOL:
+                    return SqlTypeName::BIT;
+
+                case IGNITE_TYPE_BYTE:
+                case IGNITE_TYPE_CHAR:
+                    return SqlTypeName::TINYINT;
+
+                case IGNITE_TYPE_LONG:
+                    return SqlTypeName::BIGINT;
+
+                case IGNITE_TYPE_UUID:
+                    return SqlTypeName::GUID;
+
+                case IGNITE_TYPE_DATE:
+                    return SqlTypeName::DATE;
+
+                case IGNITE_TYPE_OBJECT:
+                case IGNITE_TYPE_ARRAY_BYTE:
+                case IGNITE_TYPE_ARRAY_SHORT:
+                case IGNITE_TYPE_ARRAY_INT:
+                case IGNITE_TYPE_ARRAY_LONG:
+                case IGNITE_TYPE_ARRAY_FLOAT:
+                case IGNITE_TYPE_ARRAY_DOUBLE:
+                case IGNITE_TYPE_ARRAY_CHAR:
+                case IGNITE_TYPE_ARRAY_BOOL:
+                case IGNITE_TYPE_ARRAY_DECIMAL:
+                case IGNITE_TYPE_ARRAY_STRING:
+                case IGNITE_TYPE_ARRAY_UUID:
+                case IGNITE_TYPE_ARRAY_DATE:
+                case IGNITE_TYPE_ARRAY:
+                case IGNITE_TYPE_COLLECTION:
+                case IGNITE_TYPE_MAP:
+                case IGNITE_TYPE_MAP_ENTRY:
+                case IGNITE_TYPE_BINARY:
+                default:
+                    return SqlTypeName::BINARY;
+                }
+
+                return SqlTypeName::BINARY;
+            }
+
+
             bool IsApplicationTypeSupported(int16_t type)
             {
                 return ToDriverType(type) != IGNITE_ODBC_C_TYPE_UNSUPPORTED;


[11/50] ignite git commit: IGNITE-2223: Tests for Decimal buffers added.

Posted by vo...@apache.org.
IGNITE-2223: Tests for Decimal buffers added.


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

Branch: refs/heads/ignite-1786
Commit: f4ccbe65a28756b47e2c182d08d2030880e6ca45
Parents: d454724
Author: isapego <is...@gridgain.com>
Authored: Tue Jan 12 16:17:57 2016 +0300
Committer: isapego <is...@gridgain.com>
Committed: Tue Jan 12 16:17:57 2016 +0300

----------------------------------------------------------------------
 .../cpp/odbc/odbc-driver/src/decimal.cpp        |  2 +-
 .../src/application_data_buffer_test.cpp        | 85 ++++++++++++++++++++
 2 files changed, 86 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/f4ccbe65/modules/platforms/cpp/odbc/odbc-driver/src/decimal.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/decimal.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/decimal.cpp
index 128fb97..f88534b 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/decimal.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/decimal.cpp
@@ -61,7 +61,7 @@ namespace ignite
 
     Decimal::operator double() const
     {
-        double res = 1;
+        double res = 0;
 
         int32_t localScale = GetScale();
         

http://git-wip-us.apache.org/repos/asf/ignite/blob/f4ccbe65/modules/platforms/cpp/odbc/odbc-test/src/application_data_buffer_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-test/src/application_data_buffer_test.cpp b/modules/platforms/cpp/odbc/odbc-test/src/application_data_buffer_test.cpp
index db1195b..8194dad 100644
--- a/modules/platforms/cpp/odbc/odbc-test/src/application_data_buffer_test.cpp
+++ b/modules/platforms/cpp/odbc/odbc-test/src/application_data_buffer_test.cpp
@@ -22,10 +22,12 @@
 #include <boost/test/unit_test.hpp>
 
 #include <ignite/guid.h>
+#include <ignite/odbc/decimal.h>
 #include <ignite/odbc/app/application_data_buffer.h>
 
 #define FLOAT_PRECISION 0.0000001f
 
+using namespace ignite;
 using namespace ignite::odbc::app;
 using namespace ignite::odbc::type_traits;
 
@@ -244,6 +246,89 @@ BOOST_AUTO_TEST_CASE(TestPutFloatToShort)
     BOOST_REQUIRE(numBuf == -42);
 }
 
+BOOST_AUTO_TEST_CASE(TestPutDecimalToDouble)
+{
+    double numBuf;
+    int64_t reslen;
+
+    ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_DOUBLE, &numBuf, sizeof(numBuf), &reslen, 0);
+
+    Decimal decimal;
+
+    BOOST_REQUIRE_CLOSE_FRACTION(static_cast<double>(decimal), 0.0, FLOAT_PRECISION);
+
+    appBuf.PutDecimal(decimal);
+    BOOST_REQUIRE_CLOSE_FRACTION(numBuf, 0.0, FLOAT_PRECISION);
+
+    int8_t mag1[] = { 1, 0 };
+
+    decimal = Decimal(0, mag1, sizeof(mag1));
+
+    appBuf.PutDecimal(decimal);
+    BOOST_REQUIRE_CLOSE_FRACTION(numBuf, 256.0, FLOAT_PRECISION);
+
+    int8_t mag2[] = { 2, 23 };
+
+    decimal = Decimal(1 | 0x80000000, mag2, sizeof(mag2));
+
+    appBuf.PutDecimal(decimal);
+    BOOST_REQUIRE_CLOSE_FRACTION(numBuf, -53.5, FLOAT_PRECISION);
+}
+
+BOOST_AUTO_TEST_CASE(TestPutDecimalToLong)
+{
+    long numBuf;
+    int64_t reslen;
+
+    ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_SIGNED_LONG, &numBuf, sizeof(numBuf), &reslen, 0);
+
+    Decimal decimal;
+
+    appBuf.PutDecimal(decimal);
+    BOOST_REQUIRE(numBuf == 0);
+
+    int8_t mag1[] = { 1, 0 };
+
+    decimal = Decimal(0, mag1, sizeof(mag1));
+
+    appBuf.PutDecimal(decimal);
+    BOOST_REQUIRE(numBuf == 256);
+
+    int8_t mag2[] = { 2, 23 };
+
+    decimal = Decimal(1 | 0x80000000, mag2, sizeof(mag2));
+
+    appBuf.PutDecimal(decimal);
+    BOOST_REQUIRE(numBuf == -53);
+}
+
+BOOST_AUTO_TEST_CASE(TestPutDecimalToString)
+{
+    char strBuf[64];
+    int64_t reslen;
+
+    ApplicationDataBuffer appBuf(IGNITE_ODBC_C_TYPE_CHAR, &strBuf, sizeof(strBuf), &reslen, 0);
+
+    Decimal decimal;
+
+    appBuf.PutDecimal(decimal);
+    BOOST_REQUIRE(std::string(strBuf, reslen) == "0");
+
+    int8_t mag1[] = { 1, 0 };
+
+    decimal = Decimal(0, mag1, sizeof(mag1));
+
+    appBuf.PutDecimal(decimal);
+    BOOST_REQUIRE(std::string(strBuf, reslen) == "256");
+
+    int8_t mag2[] = { 2, 23 };
+
+    decimal = Decimal(1 | 0x80000000, mag2, sizeof(mag2));
+
+    appBuf.PutDecimal(decimal);
+    BOOST_REQUIRE(std::string(strBuf, reslen) == "-53.5");
+}
+
 BOOST_AUTO_TEST_CASE(TestGetStringFromLong)
 {
     long numBuf = 42;


[19/50] ignite git commit: IGNITE-2241: Implemented TypeInfoQuery.

Posted by vo...@apache.org.
IGNITE-2241: Implemented TypeInfoQuery.


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

Branch: refs/heads/ignite-1786
Commit: a7c3f277dd5bad124f7d73771e40a3816c27ea08
Parents: 77ba349
Author: isapego <is...@gridgain.com>
Authored: Thu Jan 14 18:05:01 2016 +0300
Committer: isapego <is...@gridgain.com>
Committed: Thu Jan 14 18:05:01 2016 +0300

----------------------------------------------------------------------
 .../include/ignite/odbc/query/type_info_query.h | 109 ++++++
 .../include/ignite/odbc/type_traits.h           |   8 +
 .../odbc-driver/project/vs/odbc-driver.vcxproj  |   2 +
 .../project/vs/odbc-driver.vcxproj.filters      |   6 +
 .../src/query/foreign_keys_query.cpp            |   4 +
 .../src/query/primary_keys_query.cpp            |   4 -
 .../odbc-driver/src/query/type_info_query.cpp   | 381 +++++++++++++++++++
 .../cpp/odbc/odbc-driver/src/type_traits.cpp    |  56 ++-
 8 files changed, 564 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/a7c3f277/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/type_info_query.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/type_info_query.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/type_info_query.h
new file mode 100644
index 0000000..ca9b879
--- /dev/null
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/query/type_info_query.h
@@ -0,0 +1,109 @@
+/*
+ * 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.
+ */
+
+#ifndef _IGNITE_ODBC_DRIVER_TYPE_INFO_QUERY
+#define _IGNITE_ODBC_DRIVER_TYPE_INFO_QUERY
+
+#include "ignite/odbc/query/query.h"
+
+namespace ignite
+{
+    namespace odbc
+    {
+        namespace query
+        {
+            /**
+             * Type info query.
+             */
+            class TypeInfoQuery : public Query
+            {
+            public:
+                /**
+                 * Constructor.
+                 *
+                 * @param diag Diagnostics collector.
+                 * @param sqlType SQL type.
+                 */
+                TypeInfoQuery(diagnostic::Diagnosable& diag, int16_t sqlType);
+
+                /**
+                 * Destructor.
+                 */
+                virtual ~TypeInfoQuery();
+
+                /**
+                 * Execute query.
+                 *
+                 * @return True on success.
+                 */
+                virtual SqlResult Execute();
+
+                /**
+                 * Get column metadata.
+                 *
+                 * @return Column metadata.
+                 */
+                virtual const meta::ColumnMetaVector& GetMeta() const;
+
+                /**
+                 * Fetch next result row to application buffers.
+                 *
+                 * @return Operation result.
+                 */
+                virtual SqlResult FetchNextRow(app::ColumnBindingMap& columnBindings);
+
+                /**
+                 * Close query.
+                 *
+                 * @return True on success.
+                 */
+                virtual SqlResult Close();
+
+                /**
+                 * Check if data is available.
+                 *
+                 * @return True if data is available.
+                 */
+                virtual bool DataAvailable() const;
+
+                /**
+                 * Get number of rows affected by the statement.
+                 *
+                 * @return Number of rows affected by the statement.
+                 */
+                virtual int64_t AffectedRows() const;
+                
+            private:
+                IGNITE_NO_COPY_ASSIGNMENT(TypeInfoQuery);
+
+                /** Columns metadata. */
+                meta::ColumnMetaVector columnsMeta;
+
+                /** Executed flag. */
+                bool executed;
+
+                /** Requested types. */
+                std::vector<int8_t> types;
+
+                /** Query cursor. */
+                std::vector<int8_t>::const_iterator cursor;
+            };
+        }
+    }
+}
+
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/a7c3f277/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/type_traits.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/type_traits.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/type_traits.h
index 094e189..ba7b78a 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/type_traits.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/type_traits.h
@@ -177,6 +177,14 @@ namespace ignite
             bool IsSqlTypeSupported(int16_t type);
 
             /**
+             * Get corresponding binary type for ODBC SQL type.
+             *
+             * @param sqlType SQL type.
+             * @return Binary type.
+             */
+            int8_t SqlTypeToBinary(int16_t sqlType);
+
+            /**
              * Convert ODBC type to driver type alias.
              *
              * @param ODBC type;

http://git-wip-us.apache.org/repos/asf/ignite/blob/a7c3f277/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj b/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj
index a85adf3..925b1b9 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj
+++ b/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj
@@ -170,6 +170,7 @@
     <ClCompile Include="..\..\src\query\foreign_keys_query.cpp" />
     <ClCompile Include="..\..\src\query\primary_keys_query.cpp" />
     <ClCompile Include="..\..\src\query\table_metadata_query.cpp" />
+    <ClCompile Include="..\..\src\query\type_info_query.cpp" />
     <ClCompile Include="..\..\src\result_page.cpp" />
     <ClCompile Include="..\..\src\row.cpp" />
     <ClCompile Include="..\..\src\statement.cpp" />
@@ -204,6 +205,7 @@
     <ClInclude Include="..\..\include\ignite\odbc\query\primary_keys_query.h" />
     <ClInclude Include="..\..\include\ignite\odbc\query\query.h" />
     <ClInclude Include="..\..\include\ignite\odbc\query\table_metadata_query.h" />
+    <ClInclude Include="..\..\include\ignite\odbc\query\type_info_query.h" />
     <ClInclude Include="..\..\include\ignite\odbc\result_page.h" />
     <ClInclude Include="..\..\include\ignite\odbc\row.h" />
     <ClInclude Include="..\..\include\ignite\odbc\statement.h" />

http://git-wip-us.apache.org/repos/asf/ignite/blob/a7c3f277/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj.filters
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj.filters b/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj.filters
index 650bfe4..69c3c10 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj.filters
+++ b/modules/platforms/cpp/odbc/odbc-driver/project/vs/odbc-driver.vcxproj.filters
@@ -106,6 +106,9 @@
     <ClCompile Include="..\..\src\decimal.cpp">
       <Filter>Code</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\src\query\type_info_query.cpp">
+      <Filter>Code\query</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <None Include="module.def">
@@ -207,5 +210,8 @@
     <ClInclude Include="..\..\include\ignite\odbc\decimal.h">
       <Filter>Code</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\include\ignite\odbc\query\type_info_query.h">
+      <Filter>Code\query</Filter>
+    </ClInclude>
   </ItemGroup>
 </Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/a7c3f277/modules/platforms/cpp/odbc/odbc-driver/src/query/foreign_keys_query.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/query/foreign_keys_query.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/query/foreign_keys_query.cpp
index 83aba0c..65246d6 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/query/foreign_keys_query.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/query/foreign_keys_query.cpp
@@ -89,7 +89,11 @@ namespace ignite
             SqlResult ForeignKeysQuery::FetchNextRow(app::ColumnBindingMap & columnBindings)
             {
                 if (!executed)
+                {
+                    diag.AddStatusRecord(SQL_STATE_HY010_SEQUENCE_ERROR, "Query was not executed.");
+
                     return SQL_RESULT_ERROR;
+                }
 
                 return SQL_RESULT_NO_DATA;
             }

http://git-wip-us.apache.org/repos/asf/ignite/blob/a7c3f277/modules/platforms/cpp/odbc/odbc-driver/src/query/primary_keys_query.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/query/primary_keys_query.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/query/primary_keys_query.cpp
index b1a508e..a6c7f67 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/query/primary_keys_query.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/query/primary_keys_query.cpp
@@ -114,13 +114,9 @@ namespace ignite
                     return SQL_RESULT_ERROR;
                 }
 
-                LOG_MSG("1\n");
-
                 if (cursor == meta.end())
                     return SQL_RESULT_NO_DATA;
 
-                LOG_MSG("2\n");
-
                 app::ColumnBindingMap::iterator it;
 
                 for (it = columnBindings.begin(); it != columnBindings.end(); ++it)

http://git-wip-us.apache.org/repos/asf/ignite/blob/a7c3f277/modules/platforms/cpp/odbc/odbc-driver/src/query/type_info_query.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/query/type_info_query.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/query/type_info_query.cpp
new file mode 100644
index 0000000..69766a1
--- /dev/null
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/query/type_info_query.cpp
@@ -0,0 +1,381 @@
+/*
+ * 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.
+ */
+
+#include <cassert>
+
+#include <ignite/impl/binary/binary_common.h>
+
+#include "ignite/odbc/system/odbc_constants.h"
+#include "ignite/odbc/type_traits.h"
+#include "ignite/odbc/query/type_info_query.h"
+
+namespace
+{
+    enum ResultColumn
+    {
+        /** Data source�dependent data-type name. */
+        TYPE_NAME = 1,
+
+        /** SQL data type. */
+        DATA_TYPE,
+
+        /** The maximum column size that the server supports for this data type. */
+        COLUMN_SIZE,
+
+        /** Character or characters used to prefix a literal. */
+        LITERAL_PREFIX,
+
+        /** Character or characters used to terminate a literal. */
+        LITERAL_SUFFIX,
+
+        /**
+         * A list of keywords, separated by commas, corresponding to each
+         * parameter that the application may specify in parentheses when using
+         * the name that is returned in the TYPE_NAME field.
+         */
+        CREATE_PARAMS,
+
+        /** Whether the data type accepts a NULL value. */
+        NULLABLE,
+
+        /**
+         * Whether a character data type is case-sensitive in collations and
+         * comparisons.
+         */
+        CASE_SENSITIVE,
+
+        /** How the data type is used in a WHERE clause. */
+        SEARCHABLE,
+
+        /** Whether the data type is unsigned. */
+        UNSIGNED_ATTRIBUTE,
+
+        /** Whether the data type has predefined fixed precision and scale. */
+        FIXED_PREC_SCALE,
+
+        /** Whether the data type is autoincrementing. */
+        AUTO_UNIQUE_VALUE,
+
+        /**
+         * Localized version of the data source�dependent name of the data
+         * type.
+         */
+        LOCAL_TYPE_NAME,
+
+        /** The minimum scale of the data type on the data source. */
+        MINIMUM_SCALE,
+
+        /** The maximum scale of the data type on the data source. */
+        MAXIMUM_SCALE,
+
+        /**
+         * The value of the SQL data type as it appears in the SQL_DESC_TYPE
+         * field of the descriptor.
+         */
+        SQL_DATA_TYPE,
+
+        /**
+         * When the value of SQL_DATA_TYPE is SQL_DATETIME or SQL_INTERVAL,
+         * this column contains the datetime/interval subcode.
+         */
+        SQL_DATETIME_SUB,
+
+        /**
+         * If the data type is an approximate numeric type, this column
+         * contains the value 2 to indicate that COLUMN_SIZE specifies a number
+         * of bits.
+         */
+        NUM_PREC_RADIX,
+
+        /**
+         * If the data type is an interval data type, then this column contains
+         * the value of the interval leading precision.
+         */
+        INTERVAL_PRECISION
+    };
+}
+
+namespace ignite
+{
+    namespace odbc
+    {
+        namespace query
+        {
+            TypeInfoQuery::TypeInfoQuery(diagnostic::Diagnosable& diag, int16_t sqlType) :
+                Query(diag),
+                columnsMeta(),
+                executed(false),
+                types(),
+                cursor(types.end())
+            {
+                using namespace ignite::impl::binary;
+                using namespace ignite::odbc::type_traits;
+
+                using meta::ColumnMeta;
+
+                columnsMeta.reserve(19);
+
+                const std::string sch("");
+                const std::string tbl("");
+
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "TYPE_NAME",          SqlTypeName::VARCHAR,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "DATA_TYPE",          SqlTypeName::SMALLINT, IGNITE_TYPE_SHORT));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "COLUMN_SIZE",        SqlTypeName::INTEGER,  IGNITE_TYPE_INT));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "LITERAL_PREFIX",     SqlTypeName::VARCHAR,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "LITERAL_SUFFIX",     SqlTypeName::VARCHAR,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "CREATE_PARAMS",      SqlTypeName::VARCHAR,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "NULLABLE",           SqlTypeName::SMALLINT, IGNITE_TYPE_SHORT));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "CASE_SENSITIVE",     SqlTypeName::SMALLINT, IGNITE_TYPE_SHORT));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "SEARCHABLE",         SqlTypeName::SMALLINT, IGNITE_TYPE_SHORT));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "UNSIGNED_ATTRIBUTE", SqlTypeName::SMALLINT, IGNITE_TYPE_SHORT));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "FIXED_PREC_SCALE",   SqlTypeName::SMALLINT, IGNITE_TYPE_SHORT));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "AUTO_UNIQUE_VALUE",  SqlTypeName::SMALLINT, IGNITE_TYPE_SHORT));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "LOCAL_TYPE_NAME",    SqlTypeName::VARCHAR,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "MINIMUM_SCALE",      SqlTypeName::SMALLINT, IGNITE_TYPE_SHORT));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "MAXIMUM_SCALE",      SqlTypeName::SMALLINT, IGNITE_TYPE_SHORT));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "SQL_DATA_TYPE",      SqlTypeName::SMALLINT, IGNITE_TYPE_SHORT));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "SQL_DATETIME_SUB",   SqlTypeName::SMALLINT, IGNITE_TYPE_SHORT));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "NUM_PREC_RADIX",     SqlTypeName::INTEGER,  IGNITE_TYPE_INT));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "INTERVAL_PRECISION", SqlTypeName::SMALLINT, IGNITE_TYPE_SHORT));
+
+                assert(IsSqlTypeSupported(sqlType));
+
+                if (sqlType == SQL_ALL_TYPES)
+                {
+                    types.push_back(IGNITE_TYPE_STRING);
+                    types.push_back(IGNITE_TYPE_SHORT);
+                    types.push_back(IGNITE_TYPE_INT);
+                    types.push_back(IGNITE_TYPE_DECIMAL);
+                    types.push_back(IGNITE_TYPE_FLOAT);
+                    types.push_back(IGNITE_TYPE_DOUBLE);
+                    types.push_back(IGNITE_TYPE_BOOL);
+                    types.push_back(IGNITE_TYPE_BYTE);
+                    types.push_back(IGNITE_TYPE_LONG);
+                    types.push_back(IGNITE_TYPE_UUID);
+                    types.push_back(IGNITE_TYPE_BINARY);
+                }
+                else
+                    types.push_back(SqlTypeToBinary(sqlType));
+            }
+
+            TypeInfoQuery::~TypeInfoQuery()
+            {
+                // No-op.
+            }
+
+            SqlResult TypeInfoQuery::Execute()
+            {
+                cursor = types.begin();
+
+                executed = true;
+
+                return SQL_RESULT_SUCCESS;
+            }
+
+            const meta::ColumnMetaVector & TypeInfoQuery::GetMeta() const
+            {
+                return columnsMeta;
+            }
+
+            SqlResult TypeInfoQuery::FetchNextRow(app::ColumnBindingMap & columnBindings)
+            {
+                using namespace ignite::impl::binary;
+
+                if (!executed)
+                {
+                    diag.AddStatusRecord(SQL_STATE_HY010_SEQUENCE_ERROR, "Query was not executed.");
+
+                    return SQL_RESULT_ERROR;
+                }
+
+                if (cursor == types.end())
+                    return SQL_RESULT_NO_DATA;
+
+                app::ColumnBindingMap::iterator it;
+
+                for (it = columnBindings.begin(); it != columnBindings.end(); ++it)
+                {
+                    uint16_t columnIdx = it->first;
+                    app::ApplicationDataBuffer& buffer = it->second;
+                    int8_t currentType = *cursor;
+
+                    switch (columnIdx)
+                    {
+                        case TYPE_NAME:
+                        {
+                            buffer.PutString(type_traits::BinaryTypeToSqlTypeName(currentType));
+
+                            break;
+                        }
+
+                        case DATA_TYPE:
+                        case SQL_DATA_TYPE:
+                        {
+                            buffer.PutInt16(type_traits::BinaryToSqlType(currentType));
+
+                            break;
+                        }
+
+                        case COLUMN_SIZE:
+                        {
+                            buffer.PutInt32(type_traits::BinaryTypeColumnSize(currentType));
+
+                            break;
+                        }
+
+                        case LITERAL_PREFIX:
+                        {
+                            if (currentType == IGNITE_TYPE_STRING)
+                                buffer.PutString("'");
+                            else if (currentType == IGNITE_TYPE_BINARY)
+                                buffer.PutString("0x");
+                            else
+                                buffer.PutNull();
+
+                            break;
+                        }
+
+                        case LITERAL_SUFFIX:
+                        {
+                            if (currentType == IGNITE_TYPE_STRING)
+                                buffer.PutString("'");
+                            else
+                                buffer.PutNull();
+
+                            break;
+                        }
+
+                        case CREATE_PARAMS:
+                        {
+                            buffer.PutNull();
+
+                            break;
+                        }
+
+                        case NULLABLE:
+                        {
+                            buffer.PutInt32(type_traits::BinaryTypeNullability(currentType));
+
+                            break;
+                        }
+
+                        case CASE_SENSITIVE:
+                        {
+                            if (currentType == IGNITE_TYPE_STRING)
+                                buffer.PutInt16(SQL_TRUE);
+                            else
+                                buffer.PutInt16(SQL_FALSE);
+
+                            break;
+                        }
+
+                        case SEARCHABLE:
+                        {
+                            buffer.PutInt16(SQL_SEARCHABLE);
+
+                            break;
+                        }
+
+                        case UNSIGNED_ATTRIBUTE:
+                        {
+                            buffer.PutInt16(type_traits::BinaryTypeUnsigned(currentType));
+
+                            break;
+                        }
+
+                        case FIXED_PREC_SCALE:
+                        {
+                            buffer.PutInt16(SQL_FALSE);
+
+                            break;
+                        }
+
+                        case AUTO_UNIQUE_VALUE:
+                        {
+                            buffer.PutInt16(SQL_FALSE);
+
+                            break;
+                        }
+
+                        case LOCAL_TYPE_NAME:
+                        {
+                            buffer.PutNull();
+
+                            break;
+                        }
+
+                        case MINIMUM_SCALE:
+                        case MAXIMUM_SCALE:
+                        {
+                            buffer.PutInt16(type_traits::BinaryTypeDecimalDigits(currentType));
+
+                            break;
+                        }
+
+                        case SQL_DATETIME_SUB:
+                        {
+                            buffer.PutNull();
+
+                            break;
+                        }
+
+                        case NUM_PREC_RADIX:
+                        {
+                            buffer.PutInt32(type_traits::BinaryTypeNumPrecRadix(currentType));
+
+                            break;
+                        }
+
+                        case INTERVAL_PRECISION:
+                        {
+                            buffer.PutNull();
+
+                            break;
+                        }
+
+                        default:
+                            break;
+                    }
+                }
+
+                ++cursor;
+
+                return SQL_RESULT_SUCCESS;
+            }
+
+            SqlResult TypeInfoQuery::Close()
+            {
+                cursor = types.end();
+
+                executed = false;
+
+                return SQL_RESULT_SUCCESS;
+            }
+
+            bool TypeInfoQuery::DataAvailable() const
+            {
+                return cursor != types.end();;
+            }
+
+            int64_t TypeInfoQuery::AffectedRows() const
+            {
+                return 0;
+            }
+        }
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/ignite/blob/a7c3f277/modules/platforms/cpp/odbc/odbc-driver/src/type_traits.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/type_traits.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/type_traits.cpp
index 813d606..8cf9aff 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/type_traits.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/type_traits.cpp
@@ -174,7 +174,6 @@ namespace ignite
                 return SqlTypeName::BINARY;
             }
 
-
             bool IsApplicationTypeSupported(int16_t type)
             {
                 return ToDriverType(type) != IGNITE_ODBC_C_TYPE_UNSUPPORTED;
@@ -198,13 +197,13 @@ namespace ignite
                     case SQL_VARBINARY:
                     case SQL_LONGVARBINARY:
                     case SQL_GUID:
+                    case SQL_DECIMAL:
                         return true;
 
                     case SQL_WCHAR:
                     case SQL_WVARCHAR:
                     case SQL_WLONGVARCHAR:
                     case SQL_REAL:
-                    case SQL_DECIMAL:
                     case SQL_NUMERIC:
                     case SQL_TYPE_DATE:
                     case SQL_TYPE_TIME:
@@ -227,6 +226,59 @@ namespace ignite
                 }
             }
 
+            int8_t SqlTypeToBinary(int16_t sqlType)
+            {
+                using namespace ignite::impl::binary;
+
+                switch (sqlType)
+                {
+                    case SQL_CHAR:
+                    case SQL_VARCHAR:
+                    case SQL_LONGVARCHAR:
+                        return IGNITE_TYPE_STRING;
+
+                    case SQL_SMALLINT:
+                        return IGNITE_TYPE_SHORT;
+
+                    case SQL_TINYINT:
+                        return IGNITE_TYPE_BYTE;
+
+                    case SQL_INTEGER:
+                        return IGNITE_TYPE_INT;
+
+                    case SQL_BIGINT:
+                        return IGNITE_TYPE_LONG;
+
+                    case SQL_FLOAT:
+                        return IGNITE_TYPE_FLOAT;
+
+                    case SQL_DOUBLE:
+                        return IGNITE_TYPE_DOUBLE;
+
+                    case SQL_BIT:
+                        return IGNITE_TYPE_BOOL;
+
+                    case SQL_BINARY:
+                    case SQL_VARBINARY:
+                    case SQL_LONGVARBINARY:
+                        return IGNITE_TYPE_BINARY;
+
+                    case SQL_DECIMAL:
+                        return IGNITE_TYPE_DECIMAL;
+
+                    case SQL_GUID:
+                        return IGNITE_TYPE_UUID;
+
+                    case SQL_TYPE_DATE:
+                        return IGNITE_TYPE_DATE;
+
+                    default:
+                        break;
+                }
+
+                return -1;
+            }
+
             IgniteSqlType ToDriverType(int16_t type)
             {
                 switch (type)


[17/50] ignite git commit: IGNITE-2241: Get from Binary types SQL type name.

Posted by vo...@apache.org.
IGNITE-2241: Get from Binary types SQL type name.


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

Branch: refs/heads/ignite-1786
Commit: 34834c6c1706f3a58f85e51e5a1b7cb7e7560a5a
Parents: dd0ccaf
Author: isapego <is...@gridgain.com>
Authored: Wed Jan 13 16:46:37 2016 +0300
Committer: isapego <is...@gridgain.com>
Committed: Wed Jan 13 16:46:37 2016 +0300

----------------------------------------------------------------------
 .../include/ignite/odbc/common_types.h          | 119 ++++++++++++-------
 .../cpp/odbc/odbc-driver/src/common_types.cpp   |  91 +++++++++++++-
 .../odbc/odbc-driver/src/meta/column_meta.cpp   |   3 +-
 .../src/query/column_metadata_query.cpp         |  24 ++--
 .../src/query/foreign_keys_query.cpp            |  28 ++---
 .../src/query/primary_keys_query.cpp            |  12 +-
 .../src/query/table_metadata_query.cpp          |  10 +-
 7 files changed, 204 insertions(+), 83 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/34834c6c/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/common_types.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/common_types.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/common_types.h
index a364791..187568f 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/common_types.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/common_types.h
@@ -33,13 +33,40 @@ namespace ignite
         {
         public:
             /** VARCHAR SQL type name constant. */
-            static const std::string varcharType;
+            static const std::string VARCHAR;
 
             /** SMALLINT SQL type name constant. */
-            static const std::string smallintType;
+            static const std::string SMALLINT;
 
             /** INTEGER SQL type name constant. */
-            static const std::string integerType;
+            static const std::string INTEGER;
+
+            /** DECIMAL SQL type name constant. */
+            static const std::string DECIMAL;
+
+            /** FLOAT SQL type name constant. */
+            static const std::string FLOAT;
+
+            /** DOUBLE SQL type name constant. */
+            static const std::string DOUBLE;
+
+            /** BIT SQL type name constant. */
+            static const std::string BIT;
+
+            /** TINYINT SQL type name constant. */
+            static const std::string TINYINT;
+
+            /** BIGINT SQL type name constant. */
+            static const std::string BIGINT;
+
+            /** BINARY SQL type name constant. */
+            static const std::string BINARY;
+
+            /** DATE SQL type name constant. */
+            static const std::string DATE;
+
+            /** GUID SQL type name constant. */
+            static const std::string GUID;
         };
 
         /**
@@ -61,16 +88,8 @@ namespace ignite
         };
 
         /**
-         * Convert internal Ignite type into ODBC SQL return code.
-         *
-         * @param result Internal result type.
-         * @return ODBC result type.
-         */
-        int SqlResultToReturnCode(SqlResult result);
-
-        /**
-         * Provides detailed information about the cause of a warning or error.
-         */
+        * Provides detailed information about the cause of a warning or error.
+        */
         enum SqlState
         {
             /** Undefined state. Internal, should never be exposed to user. */
@@ -86,69 +105,69 @@ namespace ignite
             SQL_STATE_24000_INVALID_CURSOR_STATE,
 
             /**
-             * The driver was unable to establish a connection with the data
-             * source.
-             */
+            * The driver was unable to establish a connection with the data
+            * source.
+            */
             SQL_STATE_08001_CANNOT_CONNECT,
 
             /**
-             * The specified ConnectionHandle had already been used
-             * to establish a connection with a data source, and the connection
-             * was still open.
-             */
+            * The specified ConnectionHandle had already been used
+            * to establish a connection with a data source, and the connection
+            * was still open.
+            */
             SQL_STATE_08002_ALREADY_CONNECTED,
 
             /** The connection specified was not open. */
             SQL_STATE_08003_NOT_CONNECTED,
 
             /**
-             * An error occurred for which there was no specific SQLSTATE
-             * and for which no implementation-specific SQLSTATE was defined.
-             */
+            * An error occurred for which there was no specific SQLSTATE
+            * and for which no implementation-specific SQLSTATE was defined.
+            */
             SQL_STATE_HY000_GENERAL_ERROR,
 
             /**
-             * The driver was unable to allocate memory for the specified
-             * handle.
-             */
+            * The driver was unable to allocate memory for the specified
+            * handle.
+            */
             SQL_STATE_HY001_MEMORY_ALLOCATION,
 
             /**
-             * Function sequence error.
-             */
+            * Function sequence error.
+            */
             SQL_STATE_HY010_SEQUENCE_ERROR,
 
             /**
-             * The driver does not support the feature of ODBC behavior that
-             * the application requested.
-             */
+            * The driver does not support the feature of ODBC behavior that
+            * the application requested.
+            */
             SQL_STATE_HYC00_OPTIONAL_FEATURE_NOT_IMPLEMENTED,
 
             /**
-             * The connection timeout period expired before the data source
-             * responded to the request.
-             */
+            * The connection timeout period expired before the data source
+            * responded to the request.
+            */
             SQL_STATE_HYT01_CONNECTIOIN_TIMEOUT
         };
 
         /**
-         * Diagnostic field type.
-         */
+        * Diagnostic field type.
+        */
         enum DiagnosticField
         {
             /** Header record field: Count of rows in the cursor. */
             IGNITE_SQL_DIAG_HEADER_CURSOR_ROW_COUNT,
 
             /**
-             * Header record field: String that describes the SQL statement
-             * that the underlying function executed.
-             */
+            * Header record field: String that describes the SQL statement
+            * that the underlying function executed.
+            */
             IGNITE_SQL_DIAG_HEADER_DYNAMIC_FUNCTION,
 
             /**
-             * Header record field: Numeric code that describes the SQL
-             * statement that was executed by the underlying function.
-             */
+            * Header record field: Numeric code that describes the SQL
+            * statement that was executed by the underlying function.
+            */
             IGNITE_SQL_DIAG_HEADER_DYNAMIC_FUNCTION_CODE,
 
             /** Header record field: Number of status records. */
@@ -192,6 +211,22 @@ namespace ignite
         };
 
         /**
+         * Get SQL type name for the binary type.
+         *
+         * @param binaryType Binary type.
+         * @return Corresponding SQL type name.
+         */
+        const std::string& BinaryTypeToSqlTypeName(int8_t binaryType);
+
+        /**
+         * Convert internal Ignite type into ODBC SQL return code.
+         *
+         * @param result Internal result type.
+         * @return ODBC result type.
+         */
+        int SqlResultToReturnCode(SqlResult result);
+
+        /**
          * Convert ODBC field type to internal DiagnosticField type value.
          *
          * @param field ODBC field type.

http://git-wip-us.apache.org/repos/asf/ignite/blob/34834c6c/modules/platforms/cpp/odbc/odbc-driver/src/common_types.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/common_types.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/common_types.cpp
index db2353d..f438717 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/common_types.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/common_types.cpp
@@ -15,6 +15,8 @@
  * limitations under the License.
  */
 
+#include <ignite/impl/binary/binary_common.h>
+
 #include "ignite/odbc/system/odbc_constants.h"
 #include "ignite/odbc/common_types.h"
 
@@ -22,11 +24,94 @@ namespace ignite
 {
     namespace odbc
     {
-        const std::string SqlTypeName::varcharType("VARCHAR");
+        const std::string SqlTypeName::VARCHAR("LONG VARCHAR");
+
+        const std::string SqlTypeName::SMALLINT("SMALLINT");
+
+        const std::string SqlTypeName::INTEGER("INTEGER");
+
+        const std::string SqlTypeName::DECIMAL("DECIMAL");
+
+        const std::string SqlTypeName::FLOAT("FLOAT");
+
+        const std::string SqlTypeName::DOUBLE("DOUBLE");
+
+        const std::string SqlTypeName::BIT("BIT");
+
+        const std::string SqlTypeName::TINYINT("TINYINT");
+
+        const std::string SqlTypeName::BIGINT("BIGINT");
 
-        const std::string SqlTypeName::smallintType("SMALLINT");
+        const std::string SqlTypeName::BINARY("LONG VARBINARY");
 
-        const std::string SqlTypeName::integerType("INTEGER");
+        const std::string SqlTypeName::DATE("DATE");
+
+        const std::string SqlTypeName::GUID("GUID");
+
+        const std::string& BinaryTypeToSqlTypeName(int8_t binaryType)
+        {
+            using namespace ignite::impl::binary;
+
+            switch (binaryType)
+            {
+                case IGNITE_TYPE_STRING:
+                    return SqlTypeName::VARCHAR;
+
+                case IGNITE_TYPE_SHORT:
+                    return SqlTypeName::SMALLINT;
+
+                case IGNITE_TYPE_INT:
+                    return SqlTypeName::INTEGER;
+
+                case IGNITE_TYPE_DECIMAL:
+                    return SqlTypeName::DECIMAL;
+
+                case IGNITE_TYPE_FLOAT:
+                    return SqlTypeName::FLOAT;
+
+                case IGNITE_TYPE_DOUBLE:
+                    return SqlTypeName::DOUBLE;
+
+                case IGNITE_TYPE_BOOL:
+                    return SqlTypeName::BIT;
+
+                case IGNITE_TYPE_BYTE:
+                case IGNITE_TYPE_CHAR:
+                    return SqlTypeName::TINYINT;
+
+                case IGNITE_TYPE_LONG:
+                    return SqlTypeName::BIGINT;
+
+                case IGNITE_TYPE_UUID:
+                    return SqlTypeName::GUID;
+
+                case IGNITE_TYPE_DATE:
+                    return SqlTypeName::DATE;
+
+                case IGNITE_TYPE_OBJECT:
+                case IGNITE_TYPE_ARRAY_BYTE:
+                case IGNITE_TYPE_ARRAY_SHORT:
+                case IGNITE_TYPE_ARRAY_INT:
+                case IGNITE_TYPE_ARRAY_LONG:
+                case IGNITE_TYPE_ARRAY_FLOAT:
+                case IGNITE_TYPE_ARRAY_DOUBLE:
+                case IGNITE_TYPE_ARRAY_CHAR:
+                case IGNITE_TYPE_ARRAY_BOOL:
+                case IGNITE_TYPE_ARRAY_DECIMAL:
+                case IGNITE_TYPE_ARRAY_STRING:
+                case IGNITE_TYPE_ARRAY_UUID:
+                case IGNITE_TYPE_ARRAY_DATE:
+                case IGNITE_TYPE_ARRAY:
+                case IGNITE_TYPE_COLLECTION:
+                case IGNITE_TYPE_MAP:
+                case IGNITE_TYPE_MAP_ENTRY:
+                case IGNITE_TYPE_BINARY:
+                default:
+                    return SqlTypeName::BINARY;
+            }
+
+            return SqlTypeName::BINARY;
+        }
 
         int SqlResultToReturnCode(SqlResult result)
         {

http://git-wip-us.apache.org/repos/asf/ignite/blob/34834c6c/modules/platforms/cpp/odbc/odbc-driver/src/meta/column_meta.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/meta/column_meta.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/meta/column_meta.cpp
index bea764e..b2eff6a 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/meta/column_meta.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/meta/column_meta.cpp
@@ -18,6 +18,7 @@
 #include "ignite/odbc/system/odbc_constants.h"
 #include "ignite/odbc/meta/column_meta.h"
 #include "ignite/odbc/type_traits.h"
+#include "ignite/odbc/common_types.h"
 
 namespace ignite
 {
@@ -131,7 +132,7 @@ namespace ignite
                     case SQL_DESC_TYPE_NAME:
                     case SQL_DESC_LOCAL_TYPE_NAME:
                     {
-                        value = typeName;
+                        value = BinaryTypeToSqlTypeName(dataType);
 
                         return true;
                     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/34834c6c/modules/platforms/cpp/odbc/odbc-driver/src/query/column_metadata_query.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/query/column_metadata_query.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/query/column_metadata_query.cpp
index a624fb5..a17fd36 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/query/column_metadata_query.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/query/column_metadata_query.cpp
@@ -90,18 +90,18 @@ namespace ignite
                 const std::string sch("");
                 const std::string tbl("");
 
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_CAT",      SqlTypeName::varcharType,  IGNITE_TYPE_STRING));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_SCHEM",    SqlTypeName::varcharType,  IGNITE_TYPE_STRING));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_NAME",     SqlTypeName::varcharType,  IGNITE_TYPE_STRING));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "COLUMN_NAME",    SqlTypeName::varcharType,  IGNITE_TYPE_STRING));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "DATA_TYPE",      SqlTypeName::smallintType, IGNITE_TYPE_SHORT));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "TYPE_NAME",      SqlTypeName::varcharType,  IGNITE_TYPE_STRING));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "COLUMN_SIZE",    SqlTypeName::integerType,  IGNITE_TYPE_INT));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "BUFFER_LENGTH",  SqlTypeName::integerType,  IGNITE_TYPE_INT));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "DECIMAL_DIGITS", SqlTypeName::smallintType, IGNITE_TYPE_SHORT));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "NUM_PREC_RADIX", SqlTypeName::smallintType, IGNITE_TYPE_SHORT));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "NULLABLE",       SqlTypeName::smallintType, IGNITE_TYPE_SHORT));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "REMARKS",        SqlTypeName::varcharType,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_CAT",      SqlTypeName::VARCHAR,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_SCHEM",    SqlTypeName::VARCHAR,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_NAME",     SqlTypeName::VARCHAR,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "COLUMN_NAME",    SqlTypeName::VARCHAR,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "DATA_TYPE",      SqlTypeName::SMALLINT, IGNITE_TYPE_SHORT));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "TYPE_NAME",      SqlTypeName::VARCHAR,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "COLUMN_SIZE",    SqlTypeName::INTEGER,  IGNITE_TYPE_INT));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "BUFFER_LENGTH",  SqlTypeName::INTEGER,  IGNITE_TYPE_INT));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "DECIMAL_DIGITS", SqlTypeName::SMALLINT, IGNITE_TYPE_SHORT));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "NUM_PREC_RADIX", SqlTypeName::SMALLINT, IGNITE_TYPE_SHORT));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "NULLABLE",       SqlTypeName::SMALLINT, IGNITE_TYPE_SHORT));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "REMARKS",        SqlTypeName::VARCHAR,  IGNITE_TYPE_STRING));
             }
 
             ColumnMetadataQuery::~ColumnMetadataQuery()

http://git-wip-us.apache.org/repos/asf/ignite/blob/34834c6c/modules/platforms/cpp/odbc/odbc-driver/src/query/foreign_keys_query.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/query/foreign_keys_query.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/query/foreign_keys_query.cpp
index 33cc440..7fb16ce 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/query/foreign_keys_query.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/query/foreign_keys_query.cpp
@@ -51,20 +51,20 @@ namespace ignite
                 const std::string sch("");
                 const std::string tbl("");
 
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "PKTABLE_CAT",   SqlTypeName::varcharType,  IGNITE_TYPE_STRING));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "PKTABLE_SCHEM", SqlTypeName::varcharType,  IGNITE_TYPE_STRING));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "PKTABLE_NAME",  SqlTypeName::varcharType,  IGNITE_TYPE_STRING));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "PKCOLUMN_NAME", SqlTypeName::varcharType,  IGNITE_TYPE_STRING));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "FKTABLE_CAT",   SqlTypeName::varcharType,  IGNITE_TYPE_STRING));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "FKTABLE_SCHEM", SqlTypeName::varcharType,  IGNITE_TYPE_STRING));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "FKTABLE_NAME",  SqlTypeName::varcharType,  IGNITE_TYPE_STRING));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "FKCOLUMN_NAME", SqlTypeName::varcharType,  IGNITE_TYPE_STRING));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "KEY_SEQ",       SqlTypeName::smallintType, IGNITE_TYPE_SHORT));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "UPDATE_RULE",   SqlTypeName::smallintType, IGNITE_TYPE_SHORT));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "DELETE_RULE",   SqlTypeName::smallintType, IGNITE_TYPE_SHORT));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "FK_NAME",       SqlTypeName::varcharType,  IGNITE_TYPE_STRING));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "PK_NAME",       SqlTypeName::varcharType,  IGNITE_TYPE_STRING));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "DEFERRABILITY", SqlTypeName::smallintType, IGNITE_TYPE_SHORT));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "PKTABLE_CAT",   SqlTypeName::VARCHAR,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "PKTABLE_SCHEM", SqlTypeName::VARCHAR,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "PKTABLE_NAME",  SqlTypeName::VARCHAR,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "PKCOLUMN_NAME", SqlTypeName::VARCHAR,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "FKTABLE_CAT",   SqlTypeName::VARCHAR,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "FKTABLE_SCHEM", SqlTypeName::VARCHAR,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "FKTABLE_NAME",  SqlTypeName::VARCHAR,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "FKCOLUMN_NAME", SqlTypeName::VARCHAR,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "KEY_SEQ",       SqlTypeName::SMALLINT, IGNITE_TYPE_SHORT));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "UPDATE_RULE",   SqlTypeName::SMALLINT, IGNITE_TYPE_SHORT));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "DELETE_RULE",   SqlTypeName::SMALLINT, IGNITE_TYPE_SHORT));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "FK_NAME",       SqlTypeName::VARCHAR,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "PK_NAME",       SqlTypeName::VARCHAR,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "DEFERRABILITY", SqlTypeName::SMALLINT, IGNITE_TYPE_SHORT));
             }
 
             ForeignKeysQuery::~ForeignKeysQuery()

http://git-wip-us.apache.org/repos/asf/ignite/blob/34834c6c/modules/platforms/cpp/odbc/odbc-driver/src/query/primary_keys_query.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/query/primary_keys_query.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/query/primary_keys_query.cpp
index 27e76ac..0b7ad9d 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/query/primary_keys_query.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/query/primary_keys_query.cpp
@@ -71,12 +71,12 @@ namespace ignite
                 const std::string sch("");
                 const std::string tbl("");
 
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_CAT",   SqlTypeName::varcharType,  IGNITE_TYPE_STRING));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_SCHEM", SqlTypeName::varcharType,  IGNITE_TYPE_STRING));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_NAME",  SqlTypeName::varcharType,  IGNITE_TYPE_STRING));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "COLUMN_NAME", SqlTypeName::varcharType,  IGNITE_TYPE_STRING));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "KEY_SEQ",     SqlTypeName::smallintType, IGNITE_TYPE_SHORT));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "PK_NAME",     SqlTypeName::varcharType,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_CAT",   SqlTypeName::VARCHAR,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_SCHEM", SqlTypeName::VARCHAR,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_NAME",  SqlTypeName::VARCHAR,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "COLUMN_NAME", SqlTypeName::VARCHAR,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "KEY_SEQ",     SqlTypeName::SMALLINT, IGNITE_TYPE_SHORT));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "PK_NAME",     SqlTypeName::VARCHAR,  IGNITE_TYPE_STRING));
             }
 
             PrimaryKeysQuery::~PrimaryKeysQuery()

http://git-wip-us.apache.org/repos/asf/ignite/blob/34834c6c/modules/platforms/cpp/odbc/odbc-driver/src/query/table_metadata_query.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/query/table_metadata_query.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/query/table_metadata_query.cpp
index e07da2e..779eb22 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/query/table_metadata_query.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/query/table_metadata_query.cpp
@@ -70,11 +70,11 @@ namespace ignite
                 const std::string sch("");
                 const std::string tbl("");
 
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_CAT",   SqlTypeName::varcharType, IGNITE_TYPE_STRING));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_SCHEM", SqlTypeName::varcharType, IGNITE_TYPE_STRING));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_NAME",  SqlTypeName::varcharType, IGNITE_TYPE_STRING));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_TYPE",  SqlTypeName::varcharType, IGNITE_TYPE_STRING));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "REMARKS",     SqlTypeName::varcharType, IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_CAT",   SqlTypeName::VARCHAR, IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_SCHEM", SqlTypeName::VARCHAR, IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_NAME",  SqlTypeName::VARCHAR, IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_TYPE",  SqlTypeName::VARCHAR, IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "REMARKS",     SqlTypeName::VARCHAR, IGNITE_TYPE_STRING));
             }
 
             TableMetadataQuery::~TableMetadataQuery()


[13/50] ignite git commit: IGNITE-2371: Schema and table name parsing fixed.

Posted by vo...@apache.org.
IGNITE-2371: Schema and table name parsing fixed.


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

Branch: refs/heads/ignite-1786
Commit: d9314b3696400b48e5d5ae8fcd74586b11ddcaac
Parents: 0b8487f
Author: isapego <is...@gridgain.com>
Authored: Wed Jan 13 12:35:38 2016 +0300
Committer: isapego <is...@gridgain.com>
Committed: Wed Jan 13 12:35:38 2016 +0300

----------------------------------------------------------------------
 .../processors/odbc/GridOdbcColumnMeta.java     |  2 +-
 .../processors/odbc/GridOdbcCommandHandler.java | 38 ++++++++++++++++++--
 .../src/query/column_metadata_query.cpp         |  1 +
 .../odbc/odbc-driver/src/query/data_query.cpp   |  1 +
 4 files changed, 38 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/d9314b36/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/GridOdbcColumnMeta.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/GridOdbcColumnMeta.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/GridOdbcColumnMeta.java
index 18df24b..0668366 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/GridOdbcColumnMeta.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/GridOdbcColumnMeta.java
@@ -61,7 +61,7 @@ public class GridOdbcColumnMeta {
         try {
             this.dataType = Class.forName(info.fieldTypeName());
         }
-        catch (Exception ignoreed) {
+        catch (Exception ignored) {
             this.dataType = Object.class;
         }
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/d9314b36/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/GridOdbcCommandHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/GridOdbcCommandHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/GridOdbcCommandHandler.java
index 644b0aa..4287319 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/GridOdbcCommandHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/GridOdbcCommandHandler.java
@@ -143,6 +143,18 @@ public class GridOdbcCommandHandler {
     }
 
     /**
+     * Remove quotation marks at the beginning and end of the string if present.
+     * @param str Input string.
+     * @return String without leading and trailing quotation marks.
+     */
+    private String RemoveQuotationMarksIfNeeded(String str) {
+        if (str.startsWith("\"") && str.endsWith("\""))
+            return str.substring(1, str.length() - 1);
+
+        return str;
+    }
+
+    /**
      * @param req Execute query request.
      * @param qryCurs Queries cursors.
      * @return Response.
@@ -245,10 +257,28 @@ public class GridOdbcCommandHandler {
         try {
             List<GridOdbcColumnMeta> meta = new ArrayList<>();
 
-            Collection<GridQueryTypeDescriptor> tablesMeta = ctx.query().types(req.cacheName());
+            String cacheName;
+            String tableName;
+
+            if (req.tableName().contains("."))
+            {
+                // Parsing two-part table name.
+                String[] parts = req.tableName().split("\\.");
+
+                cacheName = RemoveQuotationMarksIfNeeded(parts[0]);
+
+                tableName = parts[1];
+            }
+            else {
+                cacheName = RemoveQuotationMarksIfNeeded(req.cacheName());
+
+                tableName = req.tableName();
+            }
+
+            Collection<GridQueryTypeDescriptor> tablesMeta = ctx.query().types(cacheName);
 
             for (GridQueryTypeDescriptor table : tablesMeta) {
-                if (!matches(table.name(), req.tableName()))
+                if (!matches(table.name(), tableName))
                     continue;
 
                 for (Map.Entry<String, Class<?>> field : table.fields().entrySet()) {
@@ -279,7 +309,9 @@ public class GridOdbcCommandHandler {
         try {
             List<GridOdbcTableMeta> meta = new ArrayList<>();
 
-            Collection<GridQueryTypeDescriptor> tablesMeta = ctx.query().types(req.schema());
+            String realSchema = RemoveQuotationMarksIfNeeded(req.schema());
+
+            Collection<GridQueryTypeDescriptor> tablesMeta = ctx.query().types(realSchema);
 
             for (GridQueryTypeDescriptor table : tablesMeta) {
                 if (!matches(table.name(), req.table()))

http://git-wip-us.apache.org/repos/asf/ignite/blob/d9314b36/modules/platforms/cpp/odbc/odbc-driver/src/query/column_metadata_query.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/query/column_metadata_query.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/query/column_metadata_query.cpp
index 458679a..a624fb5 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/query/column_metadata_query.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/query/column_metadata_query.cpp
@@ -290,6 +290,7 @@ namespace ignite
                     LOG_MSG("[%d] TableName:      %s\n", i, meta[i].GetTableName().c_str());
                     LOG_MSG("[%d] ColumnName:     %s\n", i, meta[i].GetColumnName().c_str());
                     LOG_MSG("[%d] ColumnTypeName: %s\n", i, meta[i].GetColumnTypeName().c_str());
+                    LOG_MSG("[%d] ColumnType:     %d\n", i, meta[i].GetDataType());
                     LOG_MSG("\n");
                 }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/d9314b36/modules/platforms/cpp/odbc/odbc-driver/src/query/data_query.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/query/data_query.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/query/data_query.cpp
index ac3ed49..187ed65 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/query/data_query.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/query/data_query.cpp
@@ -180,6 +180,7 @@ namespace ignite
                     LOG_MSG("[%d] TypeName:       %s\n", i, rsp.GetMeta()[i].GetTableName().c_str());
                     LOG_MSG("[%d] ColumnName:     %s\n", i, rsp.GetMeta()[i].GetColumnName().c_str());
                     LOG_MSG("[%d] ColumnTypeName: %s\n", i, rsp.GetMeta()[i].GetColumnTypeName().c_str());
+                    LOG_MSG("[%d] ColumnType:     %d\n", i, rsp.GetMeta()[i].GetDataType());
                     LOG_MSG("\n");
                 }
 


[24/50] ignite git commit: IGNITE-1786: Fix for Autotools build system.

Posted by vo...@apache.org.
IGNITE-1786: Fix for Autotools build system.


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

Branch: refs/heads/ignite-1786
Commit: 97c7f847fb7053a84f431aacff4bba6573e47c51
Parents: a5b73aa
Author: isapego <is...@gridgain.com>
Authored: Fri Jan 15 17:41:45 2016 +0300
Committer: isapego <is...@gridgain.com>
Committed: Fri Jan 15 17:41:45 2016 +0300

----------------------------------------------------------------------
 .../platforms/cpp/odbc/odbc-driver/Makefile.am  | 50 ++++++++++----------
 .../platforms/cpp/odbc/odbc-test/Makefile.am    |  1 +
 2 files changed, 27 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/97c7f847/modules/platforms/cpp/odbc/odbc-driver/Makefile.am
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/Makefile.am b/modules/platforms/cpp/odbc/odbc-driver/Makefile.am
index bb4c27b..09f35fd 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/Makefile.am
+++ b/modules/platforms/cpp/odbc/odbc-driver/Makefile.am
@@ -24,31 +24,33 @@ AM_CPPFLAGS = -I$(srcdir)/include -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/
 AM_CXXFLAGS = -Wall -std=c++0x
 LIB_LDFLAGS = -no-undefined -version-info 1
 
-COMMON_SRC = os/linux/src/system/socket_client.cpp \
-             src/query/table_metadata_query.cpp \
-             src/query/data_query.cpp \
-             src/query/primary_keys_query.cpp \
-             src/query/foreign_keys_query.cpp \
-             src/query/column_metadata_query.cpp \
-             src/config/configuration.cpp \
-             src/config/connection_info.cpp \
-             src/row.cpp \
-             src/environment.cpp \
-             src/result_page.cpp \
-             src/utility.cpp \
-             src/app/parameter.cpp \
-             src/app/application_data_buffer.cpp \
-             src/common_types.cpp \
-             src/odbc.cpp \
-             src/meta/table_meta.cpp \
-             src/meta/column_meta.cpp \
-             src/type_traits.cpp \
+COMMON_SRC = os/linux/src/system/socket_client.cpp        \
+             src/app/application_data_buffer.cpp          \
+             src/app/parameter.cpp                        \
+             src/common_types.cpp                         \
+             src/config/configuration.cpp                 \
+             src/config/connection_info.cpp               \
+             src/connection.cpp                           \
+             src/cursor.cpp                               \
+             src/decimal.cpp                              \
+             src/diagnostic/diagnosable_adapter.cpp       \
+             src/diagnostic/diagnostic_record.cpp         \
              src/diagnostic/diagnostic_record_storage.cpp \
-             src/diagnostic/diagnosable_adapter.cpp \
-             src/diagnostic/diagnostic_record.cpp \
-             src/statement.cpp \
-             src/cursor.cpp \
-             src/connection.cpp
+             src/environment.cpp                          \
+             src/meta/column_meta.cpp                     \
+             src/meta/table_meta.cpp                      \
+             src/odbc.cpp                                 \
+             src/query/column_metadata_query.cpp          \
+             src/query/data_query.cpp                     \
+             src/query/foreign_keys_query.cpp             \
+             src/query/primary_keys_query.cpp             \
+             src/query/table_metadata_query.cpp           \
+             src/query/type_info_query.cpp                \
+             src/result_page.cpp                          \
+             src/row.cpp                                  \
+             src/statement.cpp                            \
+             src/type_traits.cpp                          \
+             src/utility.cpp
 
 
 lib_LTLIBRARIES = libignite-odbc.la

http://git-wip-us.apache.org/repos/asf/ignite/blob/97c7f847/modules/platforms/cpp/odbc/odbc-test/Makefile.am
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-test/Makefile.am b/modules/platforms/cpp/odbc/odbc-test/Makefile.am
index 6161071..32ca6b2 100644
--- a/modules/platforms/cpp/odbc/odbc-test/Makefile.am
+++ b/modules/platforms/cpp/odbc/odbc-test/Makefile.am
@@ -39,6 +39,7 @@ ignite_odbc_tests_SOURCES = src/teamcity_boost.cpp \
                        ../odbc-driver/src/app/application_data_buffer.cpp \
                        ../odbc-driver/src/config/configuration.cpp \
                        ../odbc-driver/src/row.cpp \
+                       ../odbc-driver/src/decimal.cpp \
                        ../odbc-driver/src/utility.cpp \
                        ../odbc-driver/src/result_page.cpp
 


[39/50] ignite git commit: IGNITE-2243: Implemented SQL_ATTR_ODBC_VERSION getting.

Posted by vo...@apache.org.
IGNITE-2243: Implemented SQL_ATTR_ODBC_VERSION getting.


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

Branch: refs/heads/ignite-1786
Commit: b60b3dc0af797d09a4bded0d355d077ffb7fbfd6
Parents: c847f8e
Author: isapego <is...@gridgain.com>
Authored: Wed Jan 20 21:10:04 2016 +0300
Committer: isapego <is...@gridgain.com>
Committed: Wed Jan 20 21:10:04 2016 +0300

----------------------------------------------------------------------
 .../cpp/odbc/odbc-driver/src/environment.cpp        | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/b60b3dc0/modules/platforms/cpp/odbc/odbc-driver/src/environment.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/environment.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/environment.cpp
index 1629e91..078d546 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/environment.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/environment.cpp
@@ -126,6 +126,22 @@ namespace ignite
 
         SqlResult Environment::InternalGetAttribute(int32_t attr, app::ApplicationDataBuffer& buffer)
         {
+            EnvironmentAttribute attribute = EnvironmentAttributeToInternal(attr);
+
+            switch (attribute)
+            {
+                case IGNITE_SQL_ENV_ATTR_ODBC_VERSION:
+                {
+                    buffer.PutInt32(odbcVersion);
+
+                    break;
+                }
+
+                case IGNITE_SQL_ENV_ATTR_UNKNOWN:
+                default:
+                    break;
+            }
+
             AddStatusRecord(SQL_STATE_HYC00_OPTIONAL_FEATURE_NOT_IMPLEMENTED,
                 "Attribute is not supported.");
 


[12/50] ignite git commit: IGNITE-2223: SQL types constants separated.

Posted by vo...@apache.org.
IGNITE-2223: SQL types constants separated.


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

Branch: refs/heads/ignite-1786
Commit: 0b8487f1b6908d396c1a3c76acb7fa66176b1b2a
Parents: f4ccbe6
Author: isapego <is...@gridgain.com>
Authored: Tue Jan 12 18:06:51 2016 +0300
Committer: isapego <is...@gridgain.com>
Committed: Tue Jan 12 18:06:51 2016 +0300

----------------------------------------------------------------------
 .../include/ignite/odbc/common_types.h          | 18 ++++++++++++
 .../cpp/odbc/odbc-driver/src/common_types.cpp   |  6 ++++
 .../src/query/column_metadata_query.cpp         | 28 ++++++++----------
 .../src/query/foreign_keys_query.cpp            | 31 +++++++++-----------
 .../src/query/primary_keys_query.cpp            | 15 ++++------
 .../src/query/table_metadata_query.cpp          | 12 ++++----
 .../platforms/cpp/odbc/odbc-driver/src/row.cpp  |  3 +-
 .../cpp/odbc/odbc-driver/src/utility.cpp        |  4 ++-
 8 files changed, 66 insertions(+), 51 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/0b8487f1/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/common_types.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/common_types.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/common_types.h
index c656fae..a364791 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/common_types.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/common_types.h
@@ -20,11 +20,29 @@
 
 #include <stdint.h>
 
+#include <string>
+
 namespace ignite
 {
     namespace odbc
     {
         /**
+         * SQL type name constants.
+         */
+        class SqlTypeName
+        {
+        public:
+            /** VARCHAR SQL type name constant. */
+            static const std::string varcharType;
+
+            /** SMALLINT SQL type name constant. */
+            static const std::string smallintType;
+
+            /** INTEGER SQL type name constant. */
+            static const std::string integerType;
+        };
+
+        /**
          * SQL result.
          */
         enum SqlResult

http://git-wip-us.apache.org/repos/asf/ignite/blob/0b8487f1/modules/platforms/cpp/odbc/odbc-driver/src/common_types.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/common_types.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/common_types.cpp
index 2b7144b..db2353d 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/common_types.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/common_types.cpp
@@ -22,6 +22,12 @@ namespace ignite
 {
     namespace odbc
     {
+        const std::string SqlTypeName::varcharType("VARCHAR");
+
+        const std::string SqlTypeName::smallintType("SMALLINT");
+
+        const std::string SqlTypeName::integerType("INTEGER");
+
         int SqlResultToReturnCode(SqlResult result)
         {
             switch (result)

http://git-wip-us.apache.org/repos/asf/ignite/blob/0b8487f1/modules/platforms/cpp/odbc/odbc-driver/src/query/column_metadata_query.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/query/column_metadata_query.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/query/column_metadata_query.cpp
index de531f2..458679a 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/query/column_metadata_query.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/query/column_metadata_query.cpp
@@ -90,22 +90,18 @@ namespace ignite
                 const std::string sch("");
                 const std::string tbl("");
 
-                const std::string varcharType("java.lang.String");
-                const std::string smallintType("java.lang.Short");
-                const std::string integerType("java.lang.Integer");
-
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_CAT",      varcharType,  IGNITE_TYPE_STRING));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_SCHEM",    varcharType,  IGNITE_TYPE_STRING));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_NAME",     varcharType,  IGNITE_TYPE_STRING));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "COLUMN_NAME",    varcharType,  IGNITE_TYPE_STRING));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "DATA_TYPE",      smallintType, IGNITE_TYPE_SHORT));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "TYPE_NAME",      varcharType,  IGNITE_TYPE_STRING));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "COLUMN_SIZE",    integerType,  IGNITE_TYPE_INT));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "BUFFER_LENGTH",  integerType,  IGNITE_TYPE_INT));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "DECIMAL_DIGITS", smallintType, IGNITE_TYPE_SHORT));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "NUM_PREC_RADIX", smallintType, IGNITE_TYPE_SHORT));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "NULLABLE",       smallintType, IGNITE_TYPE_SHORT));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "REMARKS",        varcharType,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_CAT",      SqlTypeName::varcharType,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_SCHEM",    SqlTypeName::varcharType,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_NAME",     SqlTypeName::varcharType,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "COLUMN_NAME",    SqlTypeName::varcharType,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "DATA_TYPE",      SqlTypeName::smallintType, IGNITE_TYPE_SHORT));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "TYPE_NAME",      SqlTypeName::varcharType,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "COLUMN_SIZE",    SqlTypeName::integerType,  IGNITE_TYPE_INT));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "BUFFER_LENGTH",  SqlTypeName::integerType,  IGNITE_TYPE_INT));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "DECIMAL_DIGITS", SqlTypeName::smallintType, IGNITE_TYPE_SHORT));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "NUM_PREC_RADIX", SqlTypeName::smallintType, IGNITE_TYPE_SHORT));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "NULLABLE",       SqlTypeName::smallintType, IGNITE_TYPE_SHORT));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "REMARKS",        SqlTypeName::varcharType,  IGNITE_TYPE_STRING));
             }
 
             ColumnMetadataQuery::~ColumnMetadataQuery()

http://git-wip-us.apache.org/repos/asf/ignite/blob/0b8487f1/modules/platforms/cpp/odbc/odbc-driver/src/query/foreign_keys_query.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/query/foreign_keys_query.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/query/foreign_keys_query.cpp
index 720a6a3..33cc440 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/query/foreign_keys_query.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/query/foreign_keys_query.cpp
@@ -51,23 +51,20 @@ namespace ignite
                 const std::string sch("");
                 const std::string tbl("");
 
-                const std::string varcharType("java.lang.String");
-                const std::string smallintType("java.lang.Short");
-
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "PKTABLE_CAT",   varcharType,  IGNITE_TYPE_STRING));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "PKTABLE_SCHEM", varcharType,  IGNITE_TYPE_STRING));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "PKTABLE_NAME",  varcharType,  IGNITE_TYPE_STRING));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "PKCOLUMN_NAME", varcharType,  IGNITE_TYPE_STRING));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "FKTABLE_CAT",   varcharType,  IGNITE_TYPE_STRING));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "FKTABLE_SCHEM", varcharType,  IGNITE_TYPE_STRING));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "FKTABLE_NAME",  varcharType,  IGNITE_TYPE_STRING));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "FKCOLUMN_NAME", varcharType,  IGNITE_TYPE_STRING));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "KEY_SEQ",       smallintType, IGNITE_TYPE_SHORT));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "UPDATE_RULE",   smallintType, IGNITE_TYPE_SHORT));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "DELETE_RULE",   smallintType, IGNITE_TYPE_SHORT));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "FK_NAME",       varcharType,  IGNITE_TYPE_STRING));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "PK_NAME",       varcharType,  IGNITE_TYPE_STRING));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "DEFERRABILITY", smallintType, IGNITE_TYPE_SHORT));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "PKTABLE_CAT",   SqlTypeName::varcharType,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "PKTABLE_SCHEM", SqlTypeName::varcharType,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "PKTABLE_NAME",  SqlTypeName::varcharType,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "PKCOLUMN_NAME", SqlTypeName::varcharType,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "FKTABLE_CAT",   SqlTypeName::varcharType,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "FKTABLE_SCHEM", SqlTypeName::varcharType,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "FKTABLE_NAME",  SqlTypeName::varcharType,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "FKCOLUMN_NAME", SqlTypeName::varcharType,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "KEY_SEQ",       SqlTypeName::smallintType, IGNITE_TYPE_SHORT));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "UPDATE_RULE",   SqlTypeName::smallintType, IGNITE_TYPE_SHORT));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "DELETE_RULE",   SqlTypeName::smallintType, IGNITE_TYPE_SHORT));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "FK_NAME",       SqlTypeName::varcharType,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "PK_NAME",       SqlTypeName::varcharType,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "DEFERRABILITY", SqlTypeName::smallintType, IGNITE_TYPE_SHORT));
             }
 
             ForeignKeysQuery::~ForeignKeysQuery()

http://git-wip-us.apache.org/repos/asf/ignite/blob/0b8487f1/modules/platforms/cpp/odbc/odbc-driver/src/query/primary_keys_query.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/query/primary_keys_query.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/query/primary_keys_query.cpp
index 0b9b523..27e76ac 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/query/primary_keys_query.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/query/primary_keys_query.cpp
@@ -71,15 +71,12 @@ namespace ignite
                 const std::string sch("");
                 const std::string tbl("");
 
-                const std::string varcharType("java.lang.String");
-                const std::string smallintType("java.lang.Short");
-
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_CAT",   varcharType,  IGNITE_TYPE_STRING));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_SCHEM", varcharType,  IGNITE_TYPE_STRING));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_NAME",  varcharType,  IGNITE_TYPE_STRING));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "COLUMN_NAME", varcharType,  IGNITE_TYPE_STRING));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "KEY_SEQ",     smallintType, IGNITE_TYPE_SHORT));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "PK_NAME",     varcharType,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_CAT",   SqlTypeName::varcharType,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_SCHEM", SqlTypeName::varcharType,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_NAME",  SqlTypeName::varcharType,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "COLUMN_NAME", SqlTypeName::varcharType,  IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "KEY_SEQ",     SqlTypeName::smallintType, IGNITE_TYPE_SHORT));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "PK_NAME",     SqlTypeName::varcharType,  IGNITE_TYPE_STRING));
             }
 
             PrimaryKeysQuery::~PrimaryKeysQuery()

http://git-wip-us.apache.org/repos/asf/ignite/blob/0b8487f1/modules/platforms/cpp/odbc/odbc-driver/src/query/table_metadata_query.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/query/table_metadata_query.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/query/table_metadata_query.cpp
index 1d1d747..e07da2e 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/query/table_metadata_query.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/query/table_metadata_query.cpp
@@ -70,13 +70,11 @@ namespace ignite
                 const std::string sch("");
                 const std::string tbl("");
 
-                const std::string varcharType("java.lang.String");
-
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_CAT",   varcharType, IGNITE_TYPE_STRING));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_SCHEM", varcharType, IGNITE_TYPE_STRING));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_NAME",  varcharType, IGNITE_TYPE_STRING));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_TYPE",  varcharType, IGNITE_TYPE_STRING));
-                columnsMeta.push_back(ColumnMeta(sch, tbl, "REMARKS",     varcharType, IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_CAT",   SqlTypeName::varcharType, IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_SCHEM", SqlTypeName::varcharType, IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_NAME",  SqlTypeName::varcharType, IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "TABLE_TYPE",  SqlTypeName::varcharType, IGNITE_TYPE_STRING));
+                columnsMeta.push_back(ColumnMeta(sch, tbl, "REMARKS",     SqlTypeName::varcharType, IGNITE_TYPE_STRING));
             }
 
             TableMetadataQuery::~TableMetadataQuery()

http://git-wip-us.apache.org/repos/asf/ignite/blob/0b8487f1/modules/platforms/cpp/odbc/odbc-driver/src/row.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/row.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/row.cpp
index c1ddcb1..d048674 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/row.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/row.cpp
@@ -213,7 +213,7 @@ namespace ignite
 
                     utility::ReadDecimal(reader, res);
 
-                    //dataBuf.putDecimal(res);
+                    dataBuf.PutDecimal(res);
 
                     break;
                 }
@@ -296,6 +296,7 @@ namespace ignite
                 case IGNITE_TYPE_UUID:
                 {
                     Guid guid = reader.ReadGuid();
+
                     break;
                 }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/0b8487f1/modules/platforms/cpp/odbc/odbc-driver/src/utility.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/utility.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/utility.cpp
index c7210c3..6f4ac22 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/utility.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/utility.cpp
@@ -17,6 +17,8 @@
 
 #include <cassert>
 
+#include <ignite/impl/binary/binary_utils.h>
+
 #include "ignite/odbc/utility.h"
 #include "ignite/odbc/system/odbc_constants.h"
 
@@ -75,7 +77,7 @@ namespace ignite
 
             mag.resize(len);
 
-            reader.ReadInt8Array(mag.data(), static_cast<int32_t>(mag.size()));
+            impl::binary::BinaryUtils::ReadInt8Array(reader.GetStream(), mag.data(), static_cast<int32_t>(mag.size()));
 
             Decimal res(scale, mag.data(), static_cast<int32_t>(mag.size()));
 


[20/50] ignite git commit: IGNITE-2241: Implemented SQLGetTypeInfo.

Posted by vo...@apache.org.
IGNITE-2241: Implemented SQLGetTypeInfo.


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

Branch: refs/heads/ignite-1786
Commit: 97c795bb3b34e55e3c06a19654f132f0442ead9b
Parents: a7c3f27
Author: isapego <is...@gridgain.com>
Authored: Thu Jan 14 18:38:20 2016 +0300
Committer: isapego <is...@gridgain.com>
Committed: Thu Jan 14 18:38:20 2016 +0300

----------------------------------------------------------------------
 .../odbc-driver/include/ignite/odbc/statement.h | 18 +++++++++++----
 .../platforms/cpp/odbc/odbc-driver/src/odbc.cpp | 24 ++++++++++++++------
 .../cpp/odbc/odbc-driver/src/statement.cpp      | 23 +++++++++++++++++++
 3 files changed, 54 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/97c795bb/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/statement.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/statement.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/statement.h
index 9a42a3e..a42da26 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/statement.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/statement.h
@@ -185,7 +185,6 @@ namespace ignite
              * @param schema Schema search pattern.
              * @param table Table search pattern.
              * @param column Column search pattern.
-             * @return True on success.
              */
             void ExecuteGetColumnsMetaQuery(const std::string& schema,
                 const std::string& table, const std::string& column);
@@ -197,7 +196,6 @@ namespace ignite
              * @param schema Schema search pattern.
              * @param table Table search pattern.
              * @param tableType Table type search pattern.
-             * @return True on success.
              */
             void ExecuteGetTablesMetaQuery(const std::string& catalog,
                 const std::string& schema, const std::string& table,
@@ -212,7 +210,6 @@ namespace ignite
              * @param foreignCatalog Foreign key catalog name.
              * @param foreignSchema Foreign key schema name.
              * @param foreignTable Foreign key table name.
-             * @return True on success.
              */
             void ExecuteGetForeignKeysQuery(const std::string& primaryCatalog,
                 const std::string& primarySchema, const std::string& primaryTable,
@@ -225,12 +222,18 @@ namespace ignite
              * @param catalog Catalog name.
              * @param schema Schema name.
              * @param table Table name.
-             * @return True on success.
              */
             void ExecuteGetPrimaryKeysQuery(const std::string& catalog,
                 const std::string& schema, const std::string& table);
 
             /**
+             * Get type info.
+             *
+             * @param sqlType SQL type for which to return info or SQL_ALL_TYPES.
+             */
+            void ExecuteGetTypeInfoQuery(int16_t sqlType);
+
+            /**
              * Close statement.
              */
             void Close();
@@ -408,6 +411,13 @@ namespace ignite
                 const std::string& schema, const std::string& table);
 
             /**
+             * Get type info.
+             *
+             * @param sqlType SQL type for which to return info or SQL_ALL_TYPES.
+             */
+            SqlResult InternalExecuteGetTypeInfoQuery(int16_t sqlType);
+
+            /**
              * Get column attribute.
              *
              * @param colIdx Column index.

http://git-wip-us.apache.org/repos/asf/ignite/blob/97c795bb/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp
index a27e260..824cb32 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp
@@ -1193,6 +1193,23 @@ SQLRETURN SQL_API SQLGetDiagRec(SQLSMALLINT     handleType,
     return SQL_SUCCESS;
 }
 
+SQLRETURN SQL_API SQLGetTypeInfo(SQLHSTMT       stmt,
+                                 SQLSMALLINT    type)
+{
+    using ignite::odbc::Statement;
+
+    LOG_MSG("SQLGetTypeInfo called\n");
+
+    Statement *statement = reinterpret_cast<Statement*>(stmt);
+
+    if (!statement)
+        return SQL_INVALID_HANDLE;
+
+    statement->ExecuteGetTypeInfoQuery(static_cast<int16_t>(type));
+
+    return statement->GetDiagnosticRecords().GetReturnCode();
+}
+
 //
 // ==== Not implemented ====
 //
@@ -1280,13 +1297,6 @@ SQLRETURN SQL_API SQLGetStmtOption(SQLHSTMT     stmt,
     return SQL_SUCCESS;
 }
 
-SQLRETURN SQL_API SQLGetTypeInfo(SQLHSTMT       stmt,
-                                 SQLSMALLINT    type)
-{
-    LOG_MSG("SQLGetTypeInfo called\n");
-    return SQL_SUCCESS;
-}
-
 SQLRETURN SQL_API SQLParamData(SQLHSTMT    stmt,
                                SQLPOINTER* value)
 {

http://git-wip-us.apache.org/repos/asf/ignite/blob/97c795bb/modules/platforms/cpp/odbc/odbc-driver/src/statement.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/statement.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/statement.cpp
index b59a993..506afcd 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/statement.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/statement.cpp
@@ -21,6 +21,7 @@
 #include "ignite/odbc/query/table_metadata_query.h"
 #include "ignite/odbc/query/foreign_keys_query.h"
 #include "ignite/odbc/query/primary_keys_query.h"
+#include "ignite/odbc/query/type_info_query.h"
 #include "ignite/odbc/connection.h"
 #include "ignite/odbc/utility.h"
 #include "ignite/odbc/message.h"
@@ -301,6 +302,28 @@ namespace ignite
             return currentQuery->Execute();
         }
 
+        void Statement::ExecuteGetTypeInfoQuery(int16_t sqlType)
+        {
+            IGNITE_ODBC_API_CALL(InternalExecuteGetTypeInfoQuery(sqlType));
+        }
+
+        SqlResult Statement::InternalExecuteGetTypeInfoQuery(int16_t sqlType)
+        {
+            if (!type_traits::IsSqlTypeSupported(sqlType))
+            {
+                AddStatusRecord(SQL_STATE_HYC00_OPTIONAL_FEATURE_NOT_IMPLEMENTED, "Data type is not supported.");
+
+                return SQL_RESULT_ERROR;
+            }
+
+            if (currentQuery.get())
+                currentQuery->Close();
+
+            currentQuery.reset(new query::TypeInfoQuery(*this, sqlType));
+
+            return currentQuery->Execute();
+        }
+
         void Statement::Close()
         {
             IGNITE_ODBC_API_CALL(InternalClose());


[15/50] ignite git commit: Merge branch 'ignite-1786' into ignite-2371

Posted by vo...@apache.org.
Merge branch 'ignite-1786' into ignite-2371


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

Branch: refs/heads/ignite-1786
Commit: 03efe367de39dcfb2f73dbe6aac3818b4431e21d
Parents: d9314b3 578167c
Author: isapego <is...@gridgain.com>
Authored: Wed Jan 13 13:10:29 2016 +0300
Committer: isapego <is...@gridgain.com>
Committed: Wed Jan 13 13:10:29 2016 +0300

----------------------------------------------------------------------
 examples/pom.xml                                |   2 +-
 examples/schema-import/pom.xml                  |   2 +-
 modules/aop/pom.xml                             |   4 +-
 modules/apache-license-gen/pom.xml              |   2 +-
 modules/aws/pom.xml                             |   2 +-
 modules/camel/pom.xml                           |   2 +-
 modules/clients/pom.xml                         |   2 +-
 modules/cloud/pom.xml                           |   2 +-
 modules/codegen/pom.xml                         |   2 +-
 modules/core/pom.xml                            |   2 +-
 .../configuration/FileSystemConfiguration.java  |  54 +-
 .../org/apache/ignite/igfs/IgfsUserContext.java |  16 +-
 .../igfs/secondary/IgfsSecondaryFileSystem.java |  14 -
 .../ignite/internal/MarshallerContextImpl.java  |  86 ++-
 .../internal/binary/BinaryClassDescriptor.java  |  15 +-
 .../version/GridCachePlainVersionedEntry.java   |   2 +-
 .../processors/hadoop/HadoopPayloadAware.java   |  28 +
 .../ignite/internal/processors/igfs/IgfsEx.java |  13 -
 .../internal/processors/igfs/IgfsImpl.java      |  28 +-
 .../internal/processors/igfs/IgfsPaths.java     |  62 +-
 .../igfs/IgfsSecondaryFileSystemImpl.java       |  11 -
 .../visor/node/VisorIgfsConfiguration.java      |  43 --
 .../core/src/main/resources/ignite.properties   |   2 +-
 ...eMarshallerCacheConcurrentReadWriteTest.java | 189 +++++
 .../dht/GridCacheTxNodeFailureSelfTest.java     |   6 +-
 .../processors/igfs/IgfsAbstractSelfTest.java   |   8 +-
 .../igfs/IgfsExUniversalFileSystemAdapter.java  |  11 +-
 .../igfs/UniversalFileSystemAdapter.java        |   5 +-
 .../ignite/testsuites/IgniteBasicTestSuite.java |   2 +
 modules/extdata/p2p/pom.xml                     |   2 +-
 .../extdata/uri/modules/uri-dependency/pom.xml  |   2 +-
 modules/extdata/uri/pom.xml                     |   2 +-
 modules/flume/pom.xml                           |   2 +-
 modules/gce/pom.xml                             |   2 +-
 modules/geospatial/pom.xml                      |  10 +-
 modules/hadoop/pom.xml                          |   2 +-
 .../hadoop/fs/BasicHadoopFileSystemFactory.java | 226 ++++++
 .../fs/CachingHadoopFileSystemFactory.java      |  86 +++
 .../hadoop/fs/HadoopFileSystemFactory.java      |  52 ++
 .../fs/IgniteHadoopIgfsSecondaryFileSystem.java | 260 +++----
 .../hadoop/fs/v1/IgniteHadoopFileSystem.java    | 154 +++--
 .../hadoop/fs/v2/IgniteHadoopFileSystem.java    | 122 ++--
 .../processors/hadoop/HadoopClassLoader.java    | 689 ++++++++++++++-----
 .../hadoop/SecondaryFileSystemProvider.java     | 139 ----
 .../hadoop/fs/HadoopFileSystemCacheUtils.java   |   8 +-
 .../hadoop/fs/HadoopLazyConcurrentMap.java      |   5 +-
 .../hadoop/v2/HadoopNativeCodeLoader.java       |  74 --
 .../ignite/igfs/Hadoop1DualAbstractTest.java    |  14 +-
 .../igfs/HadoopFIleSystemFactorySelfTest.java   | 326 +++++++++
 ...oopFileSystemUniversalFileSystemAdapter.java |  53 +-
 ...oopSecondaryFileSystemConfigurationTest.java |  27 +-
 .../IgniteHadoopFileSystemAbstractSelfTest.java |  71 +-
 ...condaryFileSystemInitializationSelfTest.java | 214 ++++++
 .../hadoop/HadoopAbstractWordCountTest.java     |  46 +-
 .../hadoop/HadoopClassLoaderTest.java           | 101 ++-
 .../hadoop/HadoopMapReduceEmbeddedSelfTest.java |   2 +-
 .../processors/hadoop/HadoopMapReduceTest.java  |  15 +-
 .../hadoop/HadoopSnappyFullMapReduceTest.java   |  28 +
 .../processors/hadoop/HadoopSnappyTest.java     | 102 +++
 .../processors/hadoop/HadoopTasksV2Test.java    |   2 +-
 .../hadoop/deps/CircularWIthHadoop.java         |  32 +
 .../hadoop/deps/CircularWithoutHadoop.java      |  27 +
 .../processors/hadoop/deps/WithCast.java        |  41 ++
 .../hadoop/deps/WithClassAnnotation.java        |  28 +
 .../hadoop/deps/WithConstructorInvocation.java  |  31 +
 .../processors/hadoop/deps/WithExtends.java     |  27 +
 .../processors/hadoop/deps/WithField.java       |  29 +
 .../processors/hadoop/deps/WithImplements.java  |  36 +
 .../hadoop/deps/WithIndirectField.java          |  27 +
 .../processors/hadoop/deps/WithInitializer.java |  33 +
 .../processors/hadoop/deps/WithInnerClass.java  |  31 +
 .../hadoop/deps/WithLocalVariable.java          |  38 +
 .../hadoop/deps/WithMethodAnnotation.java       |  32 +
 .../hadoop/deps/WithMethodArgument.java         |  31 +
 .../hadoop/deps/WithMethodCheckedException.java |  31 +
 .../hadoop/deps/WithMethodInvocation.java       |  31 +
 .../hadoop/deps/WithMethodReturnType.java       |  31 +
 .../hadoop/deps/WithMethodRuntimeException.java |  31 +
 .../processors/hadoop/deps/WithOuterClass.java  |  38 +
 .../hadoop/deps/WithParameterAnnotation.java    |  31 +
 .../processors/hadoop/deps/WithStaticField.java |  29 +
 .../hadoop/deps/WithStaticInitializer.java      |  34 +
 .../processors/hadoop/deps/Without.java         |  25 +
 .../hadoop/examples/HadoopWordCount1Reduce.java |   1 +
 .../hadoop/examples/HadoopWordCount2.java       |  18 +-
 .../examples/HadoopWordCount2Reducer.java       |   1 +
 .../testsuites/IgniteHadoopTestSuite.java       |  26 +-
 modules/hibernate/pom.xml                       |   2 +-
 modules/indexing/pom.xml                        |  10 +-
 modules/jcl/pom.xml                             |   4 +-
 modules/jms11/pom.xml                           |   2 +-
 modules/jta/pom.xml                             |   2 +-
 modules/kafka/pom.xml                           |   2 +-
 modules/log4j/pom.xml                           |   2 +-
 modules/log4j2/pom.xml                          |   4 +-
 modules/mesos/pom.xml                           |   2 +-
 modules/mqtt/pom.xml                            |   2 +-
 modules/osgi-karaf/pom.xml                      |   6 +-
 modules/osgi-paxlogging/pom.xml                 |   2 +-
 modules/osgi/pom.xml                            |  10 +-
 modules/platforms/cpp/common/configure.ac       |   2 +-
 modules/platforms/cpp/core-test/configure.ac    |   2 +-
 modules/platforms/cpp/core/configure.ac         |   2 +-
 modules/platforms/cpp/examples/configure.ac     |   2 +-
 modules/platforms/cpp/ignite/configure.ac       |   2 +-
 .../Properties/AssemblyInfo.cs                  |   8 +-
 .../Properties/AssemblyInfo.cs                  |   8 +-
 .../Properties/AssemblyInfo.cs                  |   8 +-
 .../Properties/AssemblyInfo.cs                  |   8 +-
 .../Apache.Ignite/Properties/AssemblyInfo.cs    |   8 +-
 .../Properties/AssemblyInfo.cs                  |   8 +-
 .../Properties/AssemblyInfo.cs                  |   8 +-
 modules/rest-http/pom.xml                       |   2 +-
 modules/scalar-2.10/pom.xml                     |   2 +-
 modules/scalar/pom.xml                          |   2 +-
 modules/schedule/pom.xml                        |   4 +-
 modules/schema-import/pom.xml                   |   2 +-
 modules/slf4j/pom.xml                           |   2 +-
 modules/spark-2.10/pom.xml                      |   2 +-
 modules/spark/pom.xml                           |   2 +-
 modules/spring/pom.xml                          |   4 +-
 modules/ssh/pom.xml                             |   2 +-
 modules/tools/pom.xml                           |   2 +-
 modules/twitter/pom.xml                         |   2 +-
 modules/urideploy/pom.xml                       |   2 +-
 modules/visor-console-2.10/pom.xml              |   2 +-
 modules/visor-console/pom.xml                   |   2 +-
 modules/visor-plugins/pom.xml                   |   2 +-
 modules/web/pom.xml                             |   4 +-
 modules/yardstick/pom.xml                       |   2 +-
 modules/yarn/pom.xml                            |   2 +-
 modules/zookeeper/pom.xml                       |   2 +-
 pom.xml                                         |   2 +-
 133 files changed, 3424 insertions(+), 965 deletions(-)
----------------------------------------------------------------------



[40/50] ignite git commit: IGNITE-2243: SQL_ATTR_OUTPUT_NTS implemented.

Posted by vo...@apache.org.
IGNITE-2243: SQL_ATTR_OUTPUT_NTS implemented.


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

Branch: refs/heads/ignite-1786
Commit: 0346daf3739cc77c0ad9c0181533730e444350d4
Parents: b60b3dc
Author: isapego <is...@gridgain.com>
Authored: Wed Jan 20 21:28:19 2016 +0300
Committer: isapego <is...@gridgain.com>
Committed: Wed Jan 20 21:28:19 2016 +0300

----------------------------------------------------------------------
 .../include/ignite/odbc/common_types.h          |  7 +++--
 .../include/ignite/odbc/environment.h           |  3 ++
 .../cpp/odbc/odbc-driver/src/common_types.cpp   |  3 ++
 .../cpp/odbc/odbc-driver/src/environment.cpp    | 30 ++++++++++++++++++--
 4 files changed, 38 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/0346daf3/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/common_types.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/common_types.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/common_types.h
index e79a572..c065872 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/common_types.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/common_types.h
@@ -186,8 +186,11 @@ namespace ignite
             /** ODBC attribute is unknown to the driver. */
             IGNITE_SQL_ENV_ATTR_UNKNOWN,
 
-            /** ODBC attribute. */
-            IGNITE_SQL_ENV_ATTR_ODBC_VERSION
+            /** ODBC version. */
+            IGNITE_SQL_ENV_ATTR_ODBC_VERSION,
+
+            /** Null-termination of strings. */
+            IGNITE_SQL_ENV_ATTR_OUTPUT_NTS
         };
 
         /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/0346daf3/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/environment.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/environment.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/environment.h
index a9c4889..7168aa3 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/environment.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/environment.h
@@ -127,6 +127,9 @@ namespace ignite
 
             /** ODBC version. */
             int32_t odbcVersion;
+
+            /** ODBC null-termintaion of string behaviour. */
+            int32_t odbcNts;
         };
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/0346daf3/modules/platforms/cpp/odbc/odbc-driver/src/common_types.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/common_types.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/common_types.cpp
index 83bfe4c..276d9fd 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/common_types.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/common_types.cpp
@@ -106,6 +106,9 @@ namespace ignite
                 case SQL_ATTR_ODBC_VERSION:
                     return IGNITE_SQL_ENV_ATTR_ODBC_VERSION;
 
+                case SQL_ATTR_OUTPUT_NTS:
+                    return IGNITE_SQL_ENV_ATTR_OUTPUT_NTS;
+
                 default:
                     break;
             }

http://git-wip-us.apache.org/repos/asf/ignite/blob/0346daf3/modules/platforms/cpp/odbc/odbc-driver/src/environment.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/environment.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/environment.cpp
index 078d546..01f606f 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/environment.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/environment.cpp
@@ -24,7 +24,7 @@ namespace ignite
     namespace odbc
     {
         Environment::Environment() : 
-            odbcVersion(SQL_OV_ODBC3)
+            odbcVersion(SQL_OV_ODBC3), odbcNts(SQL_TRUE)
         {
             // No-op.
         }
@@ -105,7 +105,24 @@ namespace ignite
                         return SQL_RESULT_SUCCESS_WITH_INFO;
                     }
 
-                    break;
+                    return SQL_RESULT_SUCCESS;
+                }
+
+                case IGNITE_SQL_ENV_ATTR_OUTPUT_NTS:
+                {
+                    int32_t* nts = reinterpret_cast<int32_t*>(value);
+
+                    if (*nts != odbcNts)
+                    {
+                        AddStatusRecord(SQL_STATE_01S02_OPTION_VALUE_CHANGED,
+                            "Only null-termination of strings is supported.");
+
+                        *nts = odbcNts;
+
+                        return SQL_RESULT_SUCCESS_WITH_INFO;
+                    }
+
+                    return SQL_RESULT_SUCCESS;
                 }
 
                 case IGNITE_SQL_ENV_ATTR_UNKNOWN:
@@ -134,7 +151,14 @@ namespace ignite
                 {
                     buffer.PutInt32(odbcVersion);
 
-                    break;
+                    return SQL_RESULT_SUCCESS;
+                }
+
+                case IGNITE_SQL_ENV_ATTR_OUTPUT_NTS:
+                {
+                    buffer.PutInt32(odbcNts);
+
+                    return SQL_RESULT_SUCCESS;
                 }
 
                 case IGNITE_SQL_ENV_ATTR_UNKNOWN:


[41/50] ignite git commit: IGNITE-2248: Implemented SQLSpecialColumns with a stub in Statement.

Posted by vo...@apache.org.
IGNITE-2248: Implemented SQLSpecialColumns with a stub in Statement.


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

Branch: refs/heads/ignite-1786
Commit: bf566a82e9da56086a9e4d53a1d59f167736abab
Parents: 0346daf
Author: isapego <is...@gridgain.com>
Authored: Thu Jan 21 16:14:51 2016 +0300
Committer: isapego <is...@gridgain.com>
Committed: Thu Jan 21 16:14:51 2016 +0300

----------------------------------------------------------------------
 .../odbc-driver/include/ignite/odbc/statement.h | 31 ++++++++++++
 .../platforms/cpp/odbc/odbc-driver/src/odbc.cpp | 50 ++++++++++++++------
 .../cpp/odbc/odbc-driver/src/statement.cpp      | 15 ++++++
 3 files changed, 81 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/bf566a82/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/statement.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/statement.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/statement.h
index 43ba239..4c49a76 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/statement.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/statement.h
@@ -235,6 +235,21 @@ namespace ignite
                 const std::string& schema, const std::string& table);
 
             /**
+             * Get special columns.
+             *
+             * @param type Special column type.
+             * @param catalog Catalog name.
+             * @param schema Schema name.
+             * @param table Table name.
+             * @param scope Minimum required scope of the rowid.
+             * @param type Determines whether to return special columns that
+             *             can have a NULL value.
+             */
+            void ExecuteGetSpecialColumnsQuery(int16_t type,
+                const std::string& catalog, const std::string& schema,
+                const std::string& table, int16_t scope, int16_t nullable);
+
+            /**
              * Get type info.
              *
              * @param sqlType SQL type for which to return info or SQL_ALL_TYPES.
@@ -428,6 +443,22 @@ namespace ignite
                 const std::string& schema, const std::string& table);
 
             /**
+             * Get special columns.
+             *
+             * @param type Special column type.
+             * @param catalog Catalog name.
+             * @param schema Schema name.
+             * @param table Table name.
+             * @param scope Minimum required scope of the rowid.
+             * @param type Determines whether to return special columns that
+             *             can have a NULL value.
+             * @return Operation result.
+             */
+            SqlResult InternalExecuteGetSpecialColumnsQuery(int16_t type,
+                const std::string& catalog, const std::string& schema,
+                const std::string& table, int16_t scope, int16_t nullable);
+
+            /**
              * Get type info.
              *
              * @param sqlType SQL type for which to return info or SQL_ALL_TYPES.

http://git-wip-us.apache.org/repos/asf/ignite/blob/bf566a82/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp
index 2b0e074..7199ad3 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp
@@ -1338,6 +1338,41 @@ SQLRETURN SQL_API SQLGetEnvAttr(SQLHENV     env,
     return environment->GetDiagnosticRecords().GetReturnCode();
 }
 
+SQLRETURN SQL_API SQLSpecialColumns(SQLHSTMT    stmt,
+                                    SQLSMALLINT idType,
+                                    SQLCHAR*    catalogName,
+                                    SQLSMALLINT catalogNameLen,
+                                    SQLCHAR*    schemaName,
+                                    SQLSMALLINT schemaNameLen,
+                                    SQLCHAR*    tableName,
+                                    SQLSMALLINT tableNameLen,
+                                    SQLSMALLINT scope,
+                                    SQLSMALLINT nullable)
+{
+    using namespace ignite::odbc;
+
+    using ignite::utility::SqlStringToString;
+
+    LOG_MSG("SQLSpecialColumns called\n");
+
+    Statement *statement = reinterpret_cast<Statement*>(stmt);
+
+    if (!statement)
+        return SQL_INVALID_HANDLE;
+
+    std::string catalog = SqlStringToString(catalogName, catalogNameLen);
+    std::string schema = SqlStringToString(schemaName, schemaNameLen);
+    std::string table = SqlStringToString(tableName, tableNameLen);
+
+    LOG_MSG("catalog: %s\n", catalog.c_str());
+    LOG_MSG("schema: %s\n", schema.c_str());
+    LOG_MSG("table: %s\n", table.c_str());
+
+    statement->ExecuteGetSpecialColumnsQuery(idType, catalog, schema, table, scope, nullable);
+
+    return statement->GetDiagnosticRecords().GetReturnCode();
+}
+
 //
 // ==== Not implemented ====
 //
@@ -1445,21 +1480,6 @@ SQLRETURN SQL_API SQLSetStmtOption(SQLHSTMT     stmt,
     return SQL_SUCCESS;
 }
 
-SQLRETURN SQL_API SQLSpecialColumns(SQLHSTMT    stmt,
-                                    SQLSMALLINT idType,
-                                    SQLCHAR*    catalogName,
-                                    SQLSMALLINT catalogNameLen,
-                                    SQLCHAR*    schemaName,
-                                    SQLSMALLINT schemaNameLen,
-                                    SQLCHAR*    tableName,
-                                    SQLSMALLINT tableNameLen,
-                                    SQLSMALLINT scope,
-                                    SQLSMALLINT nullable)
-{
-    LOG_MSG("SQLSpecialColumns called\n");
-    return SQL_SUCCESS;
-}
-
 SQLRETURN SQL_API SQLStatistics(SQLHSTMT        stmt,
                                 SQLCHAR*        catalogName,
                                 SQLSMALLINT     catalogNameLen,

http://git-wip-us.apache.org/repos/asf/ignite/blob/bf566a82/modules/platforms/cpp/odbc/odbc-driver/src/statement.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/statement.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/statement.cpp
index 81cb523..4fd0294 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/statement.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/statement.cpp
@@ -321,6 +321,21 @@ namespace ignite
             return currentQuery->Execute();
         }
 
+        void Statement::ExecuteGetSpecialColumnsQuery(int16_t type,
+            const std::string& catalog, const std::string& schema,
+            const std::string& table, int16_t scope, int16_t nullable)
+        {
+            IGNITE_ODBC_API_CALL(InternalExecuteGetSpecialColumnsQuery(type,
+                catalog, schema, table, scope, nullable));
+        }
+
+        SqlResult Statement::InternalExecuteGetSpecialColumnsQuery(int16_t type,
+            const std::string& catalog, const std::string& schema,
+            const std::string& table, int16_t scope, int16_t nullable)
+        {
+            return SQL_RESULT_ERROR;
+        }
+
         void Statement::ExecuteGetTypeInfoQuery(int16_t sqlType)
         {
             IGNITE_ODBC_API_CALL(InternalExecuteGetTypeInfoQuery(sqlType));


[38/50] ignite git commit: IGNITE-2243: Implemented setting of SQL_ATTR_ODBC_VERSION.

Posted by vo...@apache.org.
IGNITE-2243: Implemented setting of SQL_ATTR_ODBC_VERSION.


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

Branch: refs/heads/ignite-1786
Commit: c847f8eed7b5b31c13cc4d6cdb980e5ad3bec1e4
Parents: a172649
Author: isapego <is...@gridgain.com>
Authored: Wed Jan 20 21:08:41 2016 +0300
Committer: isapego <is...@gridgain.com>
Committed: Wed Jan 20 21:08:41 2016 +0300

----------------------------------------------------------------------
 .../include/ignite/odbc/common_types.h          |  6 ++++
 .../include/ignite/odbc/environment.h           |  3 ++
 .../cpp/odbc/odbc-driver/src/environment.cpp    | 30 +++++++++++++++++++-
 3 files changed, 38 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/c847f8ee/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/common_types.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/common_types.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/common_types.h
index 2e64857..e79a572 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/common_types.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/common_types.h
@@ -63,6 +63,12 @@ namespace ignite
             /** Error in row. */
             SQL_STATE_01S01_ERROR_IN_ROW,
 
+            /**
+             * The driver did not support the specified value and
+             * substituted a similar value.
+             */
+            SQL_STATE_01S02_OPTION_VALUE_CHANGED,
+
             /** Invalid cursor state. */
             SQL_STATE_24000_INVALID_CURSOR_STATE,
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/c847f8ee/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/environment.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/environment.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/environment.h
index c88a7bf..a9c4889 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/environment.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/environment.h
@@ -124,6 +124,9 @@ namespace ignite
              * @return Operation result.
              */
             SqlResult InternalGetAttribute(int32_t attr, app::ApplicationDataBuffer& buffer);
+
+            /** ODBC version. */
+            int32_t odbcVersion;
         };
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/c847f8ee/modules/platforms/cpp/odbc/odbc-driver/src/environment.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/environment.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/environment.cpp
index 186fdc1..1629e91 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/environment.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/environment.cpp
@@ -15,6 +15,7 @@
  * limitations under the License.
  */
 
+#include "ignite/odbc/system/odbc_constants.h"
 #include "ignite/odbc/connection.h"
 #include "ignite/odbc/environment.h"
 
@@ -22,7 +23,8 @@ namespace ignite
 {
     namespace odbc
     {
-        Environment::Environment()
+        Environment::Environment() : 
+            odbcVersion(SQL_OV_ODBC3)
         {
             // No-op.
         }
@@ -85,6 +87,32 @@ namespace ignite
 
         SqlResult Environment::InternalSetAttribute(int32_t attr, void* value, int32_t len)
         {
+            EnvironmentAttribute attribute = EnvironmentAttributeToInternal(attr);
+
+            switch (attribute)
+            {
+                case IGNITE_SQL_ENV_ATTR_ODBC_VERSION:
+                {
+                    int32_t* version = reinterpret_cast<int32_t*>(value);
+
+                    if (*version != odbcVersion)
+                    {
+                        AddStatusRecord(SQL_STATE_01S02_OPTION_VALUE_CHANGED,
+                            "ODBC version is not supported.");
+
+                        *version = odbcVersion;
+
+                        return SQL_RESULT_SUCCESS_WITH_INFO;
+                    }
+
+                    break;
+                }
+
+                case IGNITE_SQL_ENV_ATTR_UNKNOWN:
+                default:
+                    break;
+            }
+
             AddStatusRecord(SQL_STATE_HYC00_OPTIONAL_FEATURE_NOT_IMPLEMENTED,
                 "Attribute is not supported.");
 


[36/50] ignite git commit: IGNITE-2243: Implmented SQLGetEnvAttr.

Posted by vo...@apache.org.
IGNITE-2243: Implmented SQLGetEnvAttr.


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

Branch: refs/heads/ignite-1786
Commit: 70370696fd136d0d0e1230957ac21837f3f2b4d1
Parents: 6c18d64
Author: isapego <is...@gridgain.com>
Authored: Wed Jan 20 20:33:32 2016 +0300
Committer: isapego <is...@gridgain.com>
Committed: Wed Jan 20 20:33:32 2016 +0300

----------------------------------------------------------------------
 .../include/ignite/odbc/environment.h           | 21 +++++++++++++++++++-
 .../cpp/odbc/odbc-driver/src/environment.cpp    | 10 ++++++++++
 .../platforms/cpp/odbc/odbc-driver/src/odbc.cpp | 21 +++++++++++++++++++-
 3 files changed, 50 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/70370696/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/environment.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/environment.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/environment.h
index 4fff8d2..c88a7bf 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/environment.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/environment.h
@@ -68,6 +68,14 @@ namespace ignite
              */
             void SetAttribute(int32_t attr, void* value, int32_t len);
 
+            /**
+             * Get attribute.
+             *
+             * @param attr Attribute to set.
+             * @param buffer Buffer to put value to.
+             */
+            void GetAttribute(int32_t attr, app::ApplicationDataBuffer& buffer);
+
         private:
             IGNITE_NO_COPY_ASSIGNMENT(Environment);
 
@@ -95,9 +103,10 @@ namespace ignite
              * @return Operation result.
              */
             SqlResult InternalTransactionRollback();
-            
+
             /**
              * Set attribute.
+             * Internal call.
              *
              * @param attr Attribute to set.
              * @param value Value.
@@ -105,6 +114,16 @@ namespace ignite
              * @return Operation result.
              */
             SqlResult InternalSetAttribute(int32_t attr, void* value, int32_t len);
+
+            /**
+             * Get attribute.
+             * Internal call.
+             *
+             * @param attr Attribute to set.
+             * @param buffer Buffer to put value to.
+             * @return Operation result.
+             */
+            SqlResult InternalGetAttribute(int32_t attr, app::ApplicationDataBuffer& buffer);
         };
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/70370696/modules/platforms/cpp/odbc/odbc-driver/src/environment.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/environment.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/environment.cpp
index 58e018b..c5e4808 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/environment.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/environment.cpp
@@ -87,6 +87,16 @@ namespace ignite
         {
             return SQL_RESULT_SUCCESS;
         }
+
+        void Environment::GetAttribute(int32_t attr, app::ApplicationDataBuffer& buffer)
+        {
+            IGNITE_ODBC_API_CALL(InternalGetAttribute(attr, buffer));
+        }
+
+        SqlResult Environment::InternalGetAttribute(int32_t attr, app::ApplicationDataBuffer& buffer)
+        {
+            return SQL_RESULT_SUCCESS;
+        }
     }
 }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/70370696/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp
index 2f206b4..2b0e074 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp
@@ -1315,8 +1315,27 @@ SQLRETURN SQL_API SQLGetEnvAttr(SQLHENV     env,
                                 SQLINTEGER  valueBufLen,
                                 SQLINTEGER* valueResLen)
 {
+    using namespace ignite::odbc;
+    using namespace ignite::odbc::type_traits;
+
+    using ignite::odbc::app::ApplicationDataBuffer;
+
     LOG_MSG("SQLGetEnvAttr called\n");
-    return SQL_SUCCESS;
+
+    Environment *environment = reinterpret_cast<Environment*>(env);
+
+    if (!environment)
+        return SQL_INVALID_HANDLE;
+
+    SqlLen outResLen;
+    ApplicationDataBuffer outBuffer(IGNITE_ODBC_C_TYPE_DEFAULT, valueBuf,
+        static_cast<int32_t>(valueBufLen), &outResLen);
+
+    environment->GetAttribute(attr, outBuffer);
+
+    *valueResLen = static_cast<SQLSMALLINT>(outResLen);
+
+    return environment->GetDiagnosticRecords().GetReturnCode();
 }
 
 //


[06/50] ignite git commit: IGNITE-2223: Better support for the NUMERIC type.

Posted by vo...@apache.org.
IGNITE-2223: Better support for the NUMERIC type.


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

Branch: refs/heads/ignite-1786
Commit: 2a1f1c0f5f32c56ba5a44588d6ed4702c9678a1d
Parents: 0ea8e06
Author: isapego <is...@gridgain.com>
Authored: Mon Jan 11 18:52:36 2016 +0300
Committer: isapego <is...@gridgain.com>
Committed: Mon Jan 11 18:52:36 2016 +0300

----------------------------------------------------------------------
 .../include/ignite/odbc/type_traits.h           | 30 ++++++++++----------
 .../src/app/application_data_buffer.cpp         | 26 +++++++++++++++++
 2 files changed, 41 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/2a1f1c0f/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/type_traits.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/type_traits.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/type_traits.h
index 0bdb5ab..7dac73f 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/type_traits.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/type_traits.h
@@ -55,49 +55,49 @@ namespace ignite
                 /** Alias for the SQL_C_USHORT type. */
                 IGNITE_ODBC_C_TYPE_UNSIGNED_SHORT,
 
-                /** Alias for the SQL_C_WCHAR type. */
+                /** Alias for the SQL_C_SLONG type. */
                 IGNITE_ODBC_C_TYPE_SIGNED_LONG,
 
-                /** Alias for the SQL_C_WCHAR type. */
+                /** Alias for the SQL_C_ULONG type. */
                 IGNITE_ODBC_C_TYPE_UNSIGNED_LONG,
 
-                /** Alias for the SQL_C_WCHAR type. */
+                /** Alias for the SQL_C_FLOAT type. */
                 IGNITE_ODBC_C_TYPE_FLOAT,
 
-                /** Alias for the SQL_C_WCHAR type. */
+                /** Alias for the SQL_C_DOUBLE type. */
                 IGNITE_ODBC_C_TYPE_DOUBLE,
 
-                /** Alias for the SQL_C_WCHAR type. */
+                /** Alias for the SQL_C_BIT type. */
                 IGNITE_ODBC_C_TYPE_BIT,
 
-                /** Alias for the SQL_C_WCHAR type. */
+                /** Alias for the SQL_C_STINYINT type. */
                 IGNITE_ODBC_C_TYPE_SIGNED_TINYINT,
 
-                /** Alias for the SQL_C_WCHAR type. */
+                /** Alias for the SQL_C_UTINYINT type. */
                 IGNITE_ODBC_C_TYPE_UNSIGNED_TINYINT,
 
-                /** Alias for the SQL_C_WCHAR type. */
+                /** Alias for the SQL_C_SBIGINT type. */
                 IGNITE_ODBC_C_TYPE_SIGNED_BIGINT,
 
-                /** Alias for the SQL_C_WCHAR type. */
+                /** Alias for the SQL_C_UBIGINT type. */
                 IGNITE_ODBC_C_TYPE_UNSIGNED_BIGINT,
 
-                /** Alias for the SQL_C_WCHAR type. */
+                /** Alias for the SQL_C_BINARY type. */
                 IGNITE_ODBC_C_TYPE_BINARY,
 
-                /** Alias for the SQL_C_WCHAR type. */
+                /** Alias for the SQL_C_TDATE type. */
                 IGNITE_ODBC_C_TYPE_TDATE,
 
-                /** Alias for the SQL_C_WCHAR type. */
+                /** Alias for the SQL_C_TTIME type. */
                 IGNITE_ODBC_C_TYPE_TTIME,
 
-                /** Alias for the SQL_C_WCHAR type. */
+                /** Alias for the SQL_C_TTIMESTAMP type. */
                 IGNITE_ODBC_C_TYPE_TTIMESTAMP,
 
-                /** Alias for the SQL_C_WCHAR type. */
+                /** Alias for the SQL_C_NUMERIC type. */
                 IGNITE_ODBC_C_TYPE_NUMERIC,
 
-                /** Alias for the SQL_C_WCHAR type. */
+                /** Alias for the SQL_C_GUID type. */
                 IGNITE_ODBC_C_TYPE_GUID,
 
                 /** Alias for the SQL_DEFAULT. */

http://git-wip-us.apache.org/repos/asf/ignite/blob/2a1f1c0f/modules/platforms/cpp/odbc/odbc-driver/src/app/application_data_buffer.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/app/application_data_buffer.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/app/application_data_buffer.cpp
index 36204cb..e3e4400 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/app/application_data_buffer.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/app/application_data_buffer.cpp
@@ -154,6 +154,8 @@ namespace ignite
                             out->scale = 0;
                             out->sign = value > 0 ? 1 : 0;
 
+                            memset(out->val, 0, SQL_MAX_NUMERIC_LEN);
+
                             // TODO: implement propper conversation to numeric type.
                             int64_t intVal = static_cast<int64_t>(std::abs(value));
 
@@ -541,6 +543,7 @@ namespace ignite
                         break;
                     }
 
+                    case IGNITE_ODBC_C_TYPE_NUMERIC:
                     case IGNITE_ODBC_C_TYPE_DOUBLE:
                     {
                         std::stringstream converter;
@@ -701,6 +704,29 @@ namespace ignite
                         break;
                     }
 
+                    case IGNITE_ODBC_C_TYPE_NUMERIC:
+                    {
+                        const SQL_NUMERIC_STRUCT* numeric =
+                            reinterpret_cast<const SQL_NUMERIC_STRUCT*>(GetData());
+
+                        int64_t resInt;
+
+                        // TODO: implement propper conversation from numeric type.
+                        memcpy(&resInt, numeric->val, std::min<int>(SQL_MAX_NUMERIC_LEN, sizeof(resInt)));
+
+                        if (numeric->sign)
+                            resInt *= -1;
+
+                        double resDouble = static_cast<double>(resInt);
+
+                        for (SQLSCHAR scale = numeric->scale; scale > 0; --scale)
+                            resDouble /= 10.0;
+
+                        res = static_cast<T>(resDouble);
+
+                        break;
+                    }
+
                     default:
                         break;
                 }


[05/50] ignite git commit: Merge branch 'ignite-2061' into ignite-1786

Posted by vo...@apache.org.
Merge branch 'ignite-2061' into ignite-1786


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

Branch: refs/heads/ignite-1786
Commit: 0ea8e06f194021f9abb357ba6baf9459869435f8
Parents: 1add4f1 d8692ef
Author: isapego <is...@gridgain.com>
Authored: Mon Jan 11 16:17:04 2016 +0300
Committer: isapego <is...@gridgain.com>
Committed: Mon Jan 11 16:17:04 2016 +0300

----------------------------------------------------------------------
 .../src/diagnostic/diagnostic_record.cpp        | 24 ++++++++++++++++++++
 1 file changed, 24 insertions(+)
----------------------------------------------------------------------



[29/50] ignite git commit: IGNITE-1786: Fixed boost test library version for release.

Posted by vo...@apache.org.
IGNITE-1786: Fixed boost test library version for release.


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

Branch: refs/heads/ignite-1786
Commit: 8cd80ba20dc17d332cc8055acf3c66d37d3f99cb
Parents: f132bad
Author: isapego <is...@gridgain.com>
Authored: Mon Jan 18 17:09:27 2016 +0300
Committer: isapego <is...@gridgain.com>
Committed: Mon Jan 18 17:09:27 2016 +0300

----------------------------------------------------------------------
 .../platforms/cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/8cd80ba2/modules/platforms/cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj b/modules/platforms/cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj
index 2089f6f..1572340 100644
--- a/modules/platforms/cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj
+++ b/modules/platforms/cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj
@@ -130,7 +130,7 @@
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
-      <AdditionalDependencies>$(BOOST_HOME)\lib64-msvc-10.0\libboost_unit_test_framework-vc100-mt-gd-1_58.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>$(BOOST_HOME)\lib64-msvc-10.0\libboost_unit_test_framework-vc100-mt-1_58.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@@ -148,7 +148,7 @@
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
-      <AdditionalDependencies>$(BOOST_HOME)\lib64-msvc-10.0\libboost_unit_test_framework-vc100-mt-gd-1_58.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>$(BOOST_HOME)\lib64-msvc-10.0\libboost_unit_test_framework-vc100-mt-1_58.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>


[26/50] ignite git commit: IGNITE-1786: Fixed realease build.

Posted by vo...@apache.org.
IGNITE-1786: Fixed realease build.


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

Branch: refs/heads/ignite-1786
Commit: 9250352c82875de1f9167d14b53f34cb37067b1e
Parents: 4528863
Author: isapego <is...@gridgain.com>
Authored: Mon Jan 18 16:33:47 2016 +0300
Committer: isapego <is...@gridgain.com>
Committed: Mon Jan 18 16:33:47 2016 +0300

----------------------------------------------------------------------
 .../include/ignite/odbc/connection.h            | 16 ++++++++++++
 .../cpp/odbc/odbc-driver/src/connection.cpp     | 20 +++++++++++++++
 .../platforms/cpp/odbc/odbc-driver/src/odbc.cpp | 10 ++------
 .../odbc/odbc-test/project/vs/odbc-test.vcxproj | 27 +++++++++++---------
 4 files changed, 53 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/9250352c/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/connection.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/connection.h b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/connection.h
index f0f22cf..56037f5 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/connection.h
+++ b/modules/platforms/cpp/odbc/odbc-driver/include/ignite/odbc/connection.h
@@ -65,6 +65,13 @@ namespace ignite
             /**
              * Establish connection to ODBC server.
              *
+             * @param server Server (DSN).
+             */
+            void Establish(const std::string& server);
+
+            /**
+             * Establish connection to ODBC server.
+             *
              * @param host Host.
              * @param port Port.
              * @param cache Cache name to connect to.
@@ -167,6 +174,15 @@ namespace ignite
              * Establish connection to ODBC server.
              * Internal call.
              *
+             * @param server Server (DNS).
+             * @return Operation result.
+             */
+            SqlResult InternalEstablish(const std::string& server);
+
+            /**
+             * Establish connection to ODBC server.
+             * Internal call.
+             *
              * @param host Host.
              * @param port Port.
              * @param cache Cache name to connect to.

http://git-wip-us.apache.org/repos/asf/ignite/blob/9250352c/modules/platforms/cpp/odbc/odbc-driver/src/connection.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/connection.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/connection.cpp
index 47494eb..28cd7ca 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/connection.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/connection.cpp
@@ -22,6 +22,7 @@
 #include "ignite/odbc/utility.h"
 #include "ignite/odbc/statement.h"
 #include "ignite/odbc/connection.h"
+#include "ignite/odbc/config/configuration.h"
 
 // TODO: implement appropriate protocol with de-/serialisation.
 namespace
@@ -73,6 +74,25 @@ namespace ignite
             return res;
         }
 
+        void Connection::Establish(const std::string& server)
+        {
+            IGNITE_ODBC_API_CALL(InternalEstablish(server));
+        }
+
+        SqlResult Connection::InternalEstablish(const std::string& server)
+        {
+            config::Configuration config;
+
+            if (server != config.GetDsn())
+            {
+                AddStatusRecord(SQL_STATE_HY000_GENERAL_ERROR, "Unknown DNS.");
+
+                return SQL_RESULT_ERROR;
+            }
+
+            return InternalEstablish(config.GetHost(), config.GetPort(), config.GetCache());
+        }
+
         void Connection::Establish(const std::string& host, uint16_t port, const std::string& cache)
         {
             IGNITE_ODBC_API_CALL(InternalEstablish(host, port, cache));

http://git-wip-us.apache.org/repos/asf/ignite/blob/9250352c/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp
index 6b2f4ae..4c8a172 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/odbc.cpp
@@ -165,7 +165,7 @@ SQLRETURN SQL_API SQLAllocConnect(SQLHENV env, SQLHDBC* conn)
     Connection *connection = environment->CreateConnection();
 
     if (!connection)
-        return SQL_ERROR;
+        return environment->GetDiagnosticRecords().GetReturnCode();
 
     *conn = reinterpret_cast<SQLHDBC>(connection);
 
@@ -375,15 +375,9 @@ SQLRETURN SQL_API SQLConnect(SQLHDBC        conn,
     if (!connection)
         return SQL_INVALID_HANDLE;
 
-    ignite::odbc::config::Configuration config;
-
     std::string server = SqlStringToString(serverName, serverNameLen);
 
-    //TODO: move into Establish()
-    if (server != config.GetDsn())
-        return SQL_ERROR;
-
-    connection->Establish(config.GetHost(), config.GetPort(), config.GetCache());
+    connection->Establish(server);
 
     return connection->GetDiagnosticRecords().GetReturnCode();
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/9250352c/modules/platforms/cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj b/modules/platforms/cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj
index 8c90fa6..2089f6f 100644
--- a/modules/platforms/cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj
+++ b/modules/platforms/cpp/odbc/odbc-test/project/vs/odbc-test.vcxproj
@@ -29,26 +29,28 @@
     <UseDebugLibraries>true</UseDebugLibraries>
     <PlatformToolset>v100</PlatformToolset>
     <CharacterSet>MultiByte</CharacterSet>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
     <PlatformToolset>v100</PlatformToolset>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>MultiByte</CharacterSet>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <PlatformToolset>v100</PlatformToolset>
     <CharacterSet>MultiByte</CharacterSet>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
     <PlatformToolset>v100</PlatformToolset>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>MultiByte</CharacterSet>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <ImportGroup Label="ExtensionSettings">
@@ -88,9 +90,9 @@
     <ClCompile>
       <WarningLevel>Level3</WarningLevel>
       <Optimization>Disabled</Optimization>
-      <SDLCheck>false</SDLCheck>
+      <SDLCheck>true</SDLCheck>
       <AdditionalIncludeDirectories>$(ProjectDir)\..\..\..\..\common\include;$(ProjectDir)\..\..\..\..\common\os\win\include;$(ProjectDir)\..\..\src;$(ProjectDir)\..\..\os\win;$(ProjectDir)\..\..\..\..\binary\include;$(ProjectDir)\..\..\..\..\binary\os\win\include;$(ProjectDir)\..\..\..\odbc-driver\include;$(ProjectDir)\..\..\include;$(BOOST_HOME)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;BOOST_DATE_TIME_NO_LIB;BOOST_REGEX_NO_LIB;IGNITE_IMPL;IGNITE_FRIEND;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;BOOST_DATE_TIME_NO_LIB;BOOST_REGEX_NO_LIB;IGNITE_IMPL;IGNITE_FRIEND;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ExceptionHandling>Async</ExceptionHandling>
     </ClCompile>
     <Link>
@@ -102,14 +104,15 @@
     <ClCompile>
       <WarningLevel>Level3</WarningLevel>
       <Optimization>Disabled</Optimization>
-      <SDLCheck>false</SDLCheck>
+      <SDLCheck>true</SDLCheck>
       <AdditionalIncludeDirectories>$(ProjectDir)\..\..\..\..\common\include;$(ProjectDir)\..\..\..\..\common\os\win\include;$(ProjectDir)\..\..\src;$(ProjectDir)\..\..\os\win;$(ProjectDir)\..\..\..\..\binary\include;$(ProjectDir)\..\..\..\..\binary\os\win\include;$(ProjectDir)\..\..\..\odbc-driver\include;$(ProjectDir)\..\..\include;$(BOOST_HOME)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;BOOST_DATE_TIME_NO_LIB;BOOST_REGEX_NO_LIB;IGNITE_IMPL;IGNITE_FRIEND;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;BOOST_DATE_TIME_NO_LIB;BOOST_REGEX_NO_LIB;IGNITE_IMPL;IGNITE_FRIEND;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ExceptionHandling>Async</ExceptionHandling>
     </ClCompile>
     <Link>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <AdditionalDependencies>$(BOOST_HOME)\lib64-msvc-10.0\libboost_unit_test_framework-vc100-mt-gd-1_58.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <SubSystem>Console</SubSystem>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -118,16 +121,16 @@
       <Optimization>MaxSpeed</Optimization>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <SDLCheck>false</SDLCheck>
+      <SDLCheck>true</SDLCheck>
       <AdditionalIncludeDirectories>$(ProjectDir)\..\..\..\..\common\include;$(ProjectDir)\..\..\..\..\common\os\win\include;$(ProjectDir)\..\..\src;$(ProjectDir)\..\..\os\win;$(ProjectDir)\..\..\..\..\binary\include;$(ProjectDir)\..\..\..\..\binary\os\win\include;$(ProjectDir)\..\..\..\odbc-driver\include;$(ProjectDir)\..\..\include;$(BOOST_HOME)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;BOOST_DATE_TIME_NO_LIB;BOOST_REGEX_NO_LIB;IGNITE_IMPL;IGNITE_FRIEND;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;BOOST_DATE_TIME_NO_LIB;BOOST_REGEX_NO_LIB;IGNITE_IMPL;IGNITE_FRIEND;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ExceptionHandling>Async</ExceptionHandling>
     </ClCompile>
     <Link>
       <GenerateDebugInformation>true</GenerateDebugInformation>
-      <AdditionalDependencies>$(BOOST_HOME)\lib64-msvc-10.0\libboost_unit_test_framework-vc100-mt-gd-1_58.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalDependencies>$(BOOST_HOME)\lib64-msvc-10.0\libboost_unit_test_framework-vc100-mt-gd-1_58.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@@ -136,16 +139,16 @@
       <Optimization>MaxSpeed</Optimization>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <SDLCheck>false</SDLCheck>
+      <SDLCheck>true</SDLCheck>
       <AdditionalIncludeDirectories>$(ProjectDir)\..\..\..\..\common\include;$(ProjectDir)\..\..\..\..\common\os\win\include;$(ProjectDir)\..\..\src;$(ProjectDir)\..\..\os\win;$(ProjectDir)\..\..\..\..\binary\include;$(ProjectDir)\..\..\..\..\binary\os\win\include;$(ProjectDir)\..\..\..\odbc-driver\include;$(ProjectDir)\..\..\include;$(BOOST_HOME)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;BOOST_DATE_TIME_NO_LIB;BOOST_REGEX_NO_LIB;IGNITE_IMPL;IGNITE_FRIEND;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;BOOST_DATE_TIME_NO_LIB;BOOST_REGEX_NO_LIB;IGNITE_IMPL;IGNITE_FRIEND;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ExceptionHandling>Async</ExceptionHandling>
     </ClCompile>
     <Link>
       <GenerateDebugInformation>true</GenerateDebugInformation>
-      <AdditionalDependencies>$(BOOST_HOME)\lib64-msvc-10.0\libboost_unit_test_framework-vc100-mt-gd-1_58.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalDependencies>$(BOOST_HOME)\lib64-msvc-10.0\libboost_unit_test_framework-vc100-mt-gd-1_58.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>


[49/50] ignite git commit: IGNITE-1786: Reverting version changes.

Posted by vo...@apache.org.
IGNITE-1786: Reverting version changes.


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

Branch: refs/heads/ignite-1786
Commit: 12835b4ed9b93ad6213ca1731f8e7de5c5e6445c
Parents: a26dfb3
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Mon Jan 25 14:50:55 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Mon Jan 25 14:50:55 2016 +0300

----------------------------------------------------------------------
 examples/pom.xml                                   | 2 +-
 examples/schema-import/pom.xml                     | 2 +-
 modules/aop/pom.xml                                | 2 +-
 modules/apache-license-gen/pom.xml                 | 2 +-
 modules/aws/pom.xml                                | 2 +-
 modules/camel/pom.xml                              | 2 +-
 modules/clients/pom.xml                            | 2 +-
 modules/cloud/pom.xml                              | 2 +-
 modules/codegen/pom.xml                            | 2 +-
 modules/core/pom.xml                               | 2 +-
 modules/core/src/main/resources/ignite.properties  | 2 +-
 modules/extdata/p2p/pom.xml                        | 2 +-
 modules/extdata/uri/modules/uri-dependency/pom.xml | 2 +-
 modules/extdata/uri/pom.xml                        | 2 +-
 modules/flume/pom.xml                              | 2 +-
 modules/gce/pom.xml                                | 2 +-
 modules/geospatial/pom.xml                         | 2 +-
 modules/hadoop/pom.xml                             | 2 +-
 modules/hibernate/pom.xml                          | 2 +-
 modules/indexing/pom.xml                           | 2 +-
 modules/jcl/pom.xml                                | 2 +-
 modules/jms11/pom.xml                              | 2 +-
 modules/jta/pom.xml                                | 2 +-
 modules/kafka/pom.xml                              | 2 +-
 modules/log4j/pom.xml                              | 2 +-
 modules/log4j2/pom.xml                             | 2 +-
 modules/mesos/pom.xml                              | 2 +-
 modules/mqtt/pom.xml                               | 2 +-
 modules/osgi-karaf/pom.xml                         | 2 +-
 modules/osgi-paxlogging/pom.xml                    | 2 +-
 modules/osgi/pom.xml                               | 2 +-
 modules/rest-http/pom.xml                          | 2 +-
 modules/scalar-2.10/pom.xml                        | 2 +-
 modules/scalar/pom.xml                             | 2 +-
 modules/schedule/pom.xml                           | 2 +-
 modules/schema-import/pom.xml                      | 2 +-
 modules/slf4j/pom.xml                              | 2 +-
 modules/spark-2.10/pom.xml                         | 2 +-
 modules/spark/pom.xml                              | 2 +-
 modules/spring/pom.xml                             | 2 +-
 modules/ssh/pom.xml                                | 2 +-
 modules/tools/pom.xml                              | 2 +-
 modules/twitter/pom.xml                            | 2 +-
 modules/urideploy/pom.xml                          | 2 +-
 modules/visor-console-2.10/pom.xml                 | 2 +-
 modules/visor-console/pom.xml                      | 2 +-
 modules/visor-plugins/pom.xml                      | 2 +-
 modules/web/pom.xml                                | 2 +-
 modules/yardstick/pom.xml                          | 2 +-
 modules/yarn/pom.xml                               | 2 +-
 modules/zookeeper/pom.xml                          | 2 +-
 pom.xml                                            | 2 +-
 52 files changed, 52 insertions(+), 52 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index e1ec7aa..41ad2b8 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -28,7 +28,7 @@
     </parent>
 
     <artifactId>ignite-examples</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/examples/schema-import/pom.xml
----------------------------------------------------------------------
diff --git a/examples/schema-import/pom.xml b/examples/schema-import/pom.xml
index 73b37f3..175ae1d 100644
--- a/examples/schema-import/pom.xml
+++ b/examples/schema-import/pom.xml
@@ -35,7 +35,7 @@
     </properties>
 
     <artifactId>ignite-schema-import-demo</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/aop/pom.xml
----------------------------------------------------------------------
diff --git a/modules/aop/pom.xml b/modules/aop/pom.xml
index 0614f62..5b16aa2 100644
--- a/modules/aop/pom.xml
+++ b/modules/aop/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-aop</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/apache-license-gen/pom.xml
----------------------------------------------------------------------
diff --git a/modules/apache-license-gen/pom.xml b/modules/apache-license-gen/pom.xml
index 3f0d6a9..e31d434 100644
--- a/modules/apache-license-gen/pom.xml
+++ b/modules/apache-license-gen/pom.xml
@@ -31,7 +31,7 @@
 
     <groupId>org.apache.ignite</groupId>
     <artifactId>ignite-apache-license-gen</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <build>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/aws/pom.xml
----------------------------------------------------------------------
diff --git a/modules/aws/pom.xml b/modules/aws/pom.xml
index c10284e..efd3b36 100644
--- a/modules/aws/pom.xml
+++ b/modules/aws/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-aws</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/camel/pom.xml
----------------------------------------------------------------------
diff --git a/modules/camel/pom.xml b/modules/camel/pom.xml
index dbb47c1..ca8cb29 100644
--- a/modules/camel/pom.xml
+++ b/modules/camel/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-camel</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <properties>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/clients/pom.xml
----------------------------------------------------------------------
diff --git a/modules/clients/pom.xml b/modules/clients/pom.xml
index c6856ce..1b06685 100644
--- a/modules/clients/pom.xml
+++ b/modules/clients/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-clients</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/cloud/pom.xml
----------------------------------------------------------------------
diff --git a/modules/cloud/pom.xml b/modules/cloud/pom.xml
index 920cd09..b4a84c3 100644
--- a/modules/cloud/pom.xml
+++ b/modules/cloud/pom.xml
@@ -29,7 +29,7 @@
     </parent>
 
     <artifactId>ignite-cloud</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <properties>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/codegen/pom.xml
----------------------------------------------------------------------
diff --git a/modules/codegen/pom.xml b/modules/codegen/pom.xml
index 5cc7117..e5b1d05 100644
--- a/modules/codegen/pom.xml
+++ b/modules/codegen/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-codegen</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <properties>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/core/pom.xml
----------------------------------------------------------------------
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index eba99dd..bdf822b 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-core</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <repositories>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/core/src/main/resources/ignite.properties
----------------------------------------------------------------------
diff --git a/modules/core/src/main/resources/ignite.properties b/modules/core/src/main/resources/ignite.properties
index 0f4cace..05d5253 100644
--- a/modules/core/src/main/resources/ignite.properties
+++ b/modules/core/src/main/resources/ignite.properties
@@ -15,7 +15,7 @@
 # limitations under the License.
 #
 
-ignite.version=1.5.3-SNAPSHOT
+ignite.version=1.5.1.final-SNAPSHOT
 ignite.build=0
 ignite.revision=DEV
 ignite.rel.date=01011970

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/extdata/p2p/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/pom.xml b/modules/extdata/p2p/pom.xml
index 2868a8e..c682da5 100644
--- a/modules/extdata/p2p/pom.xml
+++ b/modules/extdata/p2p/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-extdata-p2p</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/extdata/uri/modules/uri-dependency/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/uri/modules/uri-dependency/pom.xml b/modules/extdata/uri/modules/uri-dependency/pom.xml
index 243c9e3..91718cf 100644
--- a/modules/extdata/uri/modules/uri-dependency/pom.xml
+++ b/modules/extdata/uri/modules/uri-dependency/pom.xml
@@ -27,7 +27,7 @@
     <artifactId>ignite-extdata-uri-dep</artifactId>
     <packaging>jar</packaging>
 
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <modelVersion>4.0.0</modelVersion>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/extdata/uri/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/uri/pom.xml b/modules/extdata/uri/pom.xml
index 46ff900..7442aad 100644
--- a/modules/extdata/uri/pom.xml
+++ b/modules/extdata/uri/pom.xml
@@ -32,7 +32,7 @@
     </parent>
 
     <artifactId>ignite-extdata-uri</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/flume/pom.xml
----------------------------------------------------------------------
diff --git a/modules/flume/pom.xml b/modules/flume/pom.xml
index 9007225..63ba1eb 100644
--- a/modules/flume/pom.xml
+++ b/modules/flume/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-flume</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/gce/pom.xml
----------------------------------------------------------------------
diff --git a/modules/gce/pom.xml b/modules/gce/pom.xml
index 3786e6b..ad25b33 100644
--- a/modules/gce/pom.xml
+++ b/modules/gce/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-gce</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/geospatial/pom.xml
----------------------------------------------------------------------
diff --git a/modules/geospatial/pom.xml b/modules/geospatial/pom.xml
index 6457ae3..6ccef90 100644
--- a/modules/geospatial/pom.xml
+++ b/modules/geospatial/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-geospatial</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/hadoop/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hadoop/pom.xml b/modules/hadoop/pom.xml
index 9b81515..a31df33 100644
--- a/modules/hadoop/pom.xml
+++ b/modules/hadoop/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-hadoop</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/hibernate/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hibernate/pom.xml b/modules/hibernate/pom.xml
index ac51d1d..b20bcb5 100644
--- a/modules/hibernate/pom.xml
+++ b/modules/hibernate/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-hibernate</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/indexing/pom.xml
----------------------------------------------------------------------
diff --git a/modules/indexing/pom.xml b/modules/indexing/pom.xml
index d1c299c..e681cdf 100644
--- a/modules/indexing/pom.xml
+++ b/modules/indexing/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-indexing</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/jcl/pom.xml
----------------------------------------------------------------------
diff --git a/modules/jcl/pom.xml b/modules/jcl/pom.xml
index 493ede3..e7285d2 100644
--- a/modules/jcl/pom.xml
+++ b/modules/jcl/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-jcl</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/jms11/pom.xml
----------------------------------------------------------------------
diff --git a/modules/jms11/pom.xml b/modules/jms11/pom.xml
index 9d3e7b1..fd0bbca 100644
--- a/modules/jms11/pom.xml
+++ b/modules/jms11/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-jms11</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/jta/pom.xml
----------------------------------------------------------------------
diff --git a/modules/jta/pom.xml b/modules/jta/pom.xml
index 29f8790..586f16c 100644
--- a/modules/jta/pom.xml
+++ b/modules/jta/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-jta</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/kafka/pom.xml
----------------------------------------------------------------------
diff --git a/modules/kafka/pom.xml b/modules/kafka/pom.xml
index 76330d4..f18e038 100644
--- a/modules/kafka/pom.xml
+++ b/modules/kafka/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-kafka</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/log4j/pom.xml
----------------------------------------------------------------------
diff --git a/modules/log4j/pom.xml b/modules/log4j/pom.xml
index a35ebc2..75fbbae 100644
--- a/modules/log4j/pom.xml
+++ b/modules/log4j/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-log4j</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/log4j2/pom.xml
----------------------------------------------------------------------
diff --git a/modules/log4j2/pom.xml b/modules/log4j2/pom.xml
index 32d3c99..e677e86 100644
--- a/modules/log4j2/pom.xml
+++ b/modules/log4j2/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-log4j2</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/mesos/pom.xml
----------------------------------------------------------------------
diff --git a/modules/mesos/pom.xml b/modules/mesos/pom.xml
index 7cff9c9..8d96496 100644
--- a/modules/mesos/pom.xml
+++ b/modules/mesos/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-mesos</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <properties>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/mqtt/pom.xml
----------------------------------------------------------------------
diff --git a/modules/mqtt/pom.xml b/modules/mqtt/pom.xml
index ee0f596..09319b8 100644
--- a/modules/mqtt/pom.xml
+++ b/modules/mqtt/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-mqtt</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/osgi-karaf/pom.xml
----------------------------------------------------------------------
diff --git a/modules/osgi-karaf/pom.xml b/modules/osgi-karaf/pom.xml
index c49aa3a..da24d87 100644
--- a/modules/osgi-karaf/pom.xml
+++ b/modules/osgi-karaf/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-osgi-karaf</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <build>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/osgi-paxlogging/pom.xml
----------------------------------------------------------------------
diff --git a/modules/osgi-paxlogging/pom.xml b/modules/osgi-paxlogging/pom.xml
index 703784b..cbd7f5a 100644
--- a/modules/osgi-paxlogging/pom.xml
+++ b/modules/osgi-paxlogging/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-osgi-paxlogging</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <packaging>jar</packaging>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/osgi/pom.xml
----------------------------------------------------------------------
diff --git a/modules/osgi/pom.xml b/modules/osgi/pom.xml
index c04b0ef..1353707 100644
--- a/modules/osgi/pom.xml
+++ b/modules/osgi/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-osgi</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/rest-http/pom.xml
----------------------------------------------------------------------
diff --git a/modules/rest-http/pom.xml b/modules/rest-http/pom.xml
index 444dcd9..2810a78 100644
--- a/modules/rest-http/pom.xml
+++ b/modules/rest-http/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-rest-http</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <properties>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/scalar-2.10/pom.xml
----------------------------------------------------------------------
diff --git a/modules/scalar-2.10/pom.xml b/modules/scalar-2.10/pom.xml
index 41dc09f..6b47f62 100644
--- a/modules/scalar-2.10/pom.xml
+++ b/modules/scalar-2.10/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-scalar_2.10</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/scalar/pom.xml
----------------------------------------------------------------------
diff --git a/modules/scalar/pom.xml b/modules/scalar/pom.xml
index 2398057..9d04bb2 100644
--- a/modules/scalar/pom.xml
+++ b/modules/scalar/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-scalar</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/schedule/pom.xml
----------------------------------------------------------------------
diff --git a/modules/schedule/pom.xml b/modules/schedule/pom.xml
index 363dafe..506a800 100644
--- a/modules/schedule/pom.xml
+++ b/modules/schedule/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-schedule</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <properties>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/schema-import/pom.xml
----------------------------------------------------------------------
diff --git a/modules/schema-import/pom.xml b/modules/schema-import/pom.xml
index b661df4..48369e3 100644
--- a/modules/schema-import/pom.xml
+++ b/modules/schema-import/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-schema-import</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/slf4j/pom.xml
----------------------------------------------------------------------
diff --git a/modules/slf4j/pom.xml b/modules/slf4j/pom.xml
index 86b9400..a7c1ffe 100644
--- a/modules/slf4j/pom.xml
+++ b/modules/slf4j/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-slf4j</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/spark-2.10/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spark-2.10/pom.xml b/modules/spark-2.10/pom.xml
index 44a5a1f..5fdeb0a 100644
--- a/modules/spark-2.10/pom.xml
+++ b/modules/spark-2.10/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-spark_2.10</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/spark/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spark/pom.xml b/modules/spark/pom.xml
index c05ee4c..8dd6257 100644
--- a/modules/spark/pom.xml
+++ b/modules/spark/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-spark</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/spring/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spring/pom.xml b/modules/spring/pom.xml
index 86348c4..18db32c 100644
--- a/modules/spring/pom.xml
+++ b/modules/spring/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-spring</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/ssh/pom.xml
----------------------------------------------------------------------
diff --git a/modules/ssh/pom.xml b/modules/ssh/pom.xml
index f5acd2c..fdf0ee7 100644
--- a/modules/ssh/pom.xml
+++ b/modules/ssh/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-ssh</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/tools/pom.xml
----------------------------------------------------------------------
diff --git a/modules/tools/pom.xml b/modules/tools/pom.xml
index 5634928..3363623 100644
--- a/modules/tools/pom.xml
+++ b/modules/tools/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-tools</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <properties>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/twitter/pom.xml
----------------------------------------------------------------------
diff --git a/modules/twitter/pom.xml b/modules/twitter/pom.xml
index 6642c39..654b897 100644
--- a/modules/twitter/pom.xml
+++ b/modules/twitter/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-twitter</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/urideploy/pom.xml
----------------------------------------------------------------------
diff --git a/modules/urideploy/pom.xml b/modules/urideploy/pom.xml
index e689eb1..75a8fd7 100644
--- a/modules/urideploy/pom.xml
+++ b/modules/urideploy/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-urideploy</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/visor-console-2.10/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-console-2.10/pom.xml b/modules/visor-console-2.10/pom.xml
index 99889fb..d9934b9 100644
--- a/modules/visor-console-2.10/pom.xml
+++ b/modules/visor-console-2.10/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-visor-console_2.10</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/visor-console/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-console/pom.xml b/modules/visor-console/pom.xml
index 288b66f..2644da7 100644
--- a/modules/visor-console/pom.xml
+++ b/modules/visor-console/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-visor-console</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/visor-plugins/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-plugins/pom.xml b/modules/visor-plugins/pom.xml
index 32858d6..fdc1b2b 100644
--- a/modules/visor-plugins/pom.xml
+++ b/modules/visor-plugins/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-visor-plugins</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/web/pom.xml
----------------------------------------------------------------------
diff --git a/modules/web/pom.xml b/modules/web/pom.xml
index 030cbcb..214f1ce 100644
--- a/modules/web/pom.xml
+++ b/modules/web/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-web</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/yardstick/pom.xml
----------------------------------------------------------------------
diff --git a/modules/yardstick/pom.xml b/modules/yardstick/pom.xml
index 393d036..22d6ff7 100644
--- a/modules/yardstick/pom.xml
+++ b/modules/yardstick/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-yardstick</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <properties>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/yarn/pom.xml
----------------------------------------------------------------------
diff --git a/modules/yarn/pom.xml b/modules/yarn/pom.xml
index 214377d..564fd11 100644
--- a/modules/yarn/pom.xml
+++ b/modules/yarn/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-yarn</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <properties>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/modules/zookeeper/pom.xml
----------------------------------------------------------------------
diff --git a/modules/zookeeper/pom.xml b/modules/zookeeper/pom.xml
index e2f2449..75cf61e 100644
--- a/modules/zookeeper/pom.xml
+++ b/modules/zookeeper/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-zookeeper</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <url>http://ignite.apache.org</url>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/ignite/blob/12835b4e/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index d98c541..0a74c47 100644
--- a/pom.xml
+++ b/pom.xml
@@ -32,7 +32,7 @@
 
     <groupId>org.apache.ignite</groupId>
     <artifactId>apache-ignite</artifactId>
-    <version>1.5.3-SNAPSHOT</version>
+    <version>1.5.1.final-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <properties>


[02/50] ignite git commit: Merge branch 'ignite-1.5' into ignite-1786

Posted by vo...@apache.org.
Merge branch 'ignite-1.5' into ignite-1786


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

Branch: refs/heads/ignite-1786
Commit: fe5b560703b569df2542510a63cac9bab7ba0d8e
Parents: 15a5834 f1f8cda
Author: isapego <is...@gridgain.com>
Authored: Wed Dec 30 17:03:04 2015 +0300
Committer: isapego <is...@gridgain.com>
Committed: Wed Dec 30 17:03:04 2015 +0300

----------------------------------------------------------------------
 assembly/release-fabric-base.xml | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------



[45/50] ignite git commit: IGNITE-1786: Fix for the SQLSetEnvAttr.

Posted by vo...@apache.org.
IGNITE-1786: Fix for the SQLSetEnvAttr.


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

Branch: refs/heads/ignite-1786
Commit: e1a50afca3f2e630a13e94f8e2d090e27dc58a39
Parents: 8b1db4e
Author: isapego <is...@gridgain.com>
Authored: Thu Jan 21 19:24:37 2016 +0300
Committer: isapego <is...@gridgain.com>
Committed: Thu Jan 21 19:24:37 2016 +0300

----------------------------------------------------------------------
 .../platforms/cpp/odbc/odbc-driver/src/environment.cpp  | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/e1a50afc/modules/platforms/cpp/odbc/odbc-driver/src/environment.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/odbc-driver/src/environment.cpp b/modules/platforms/cpp/odbc/odbc-driver/src/environment.cpp
index 01f606f..ba213ab 100644
--- a/modules/platforms/cpp/odbc/odbc-driver/src/environment.cpp
+++ b/modules/platforms/cpp/odbc/odbc-driver/src/environment.cpp
@@ -93,15 +93,13 @@ namespace ignite
             {
                 case IGNITE_SQL_ENV_ATTR_ODBC_VERSION:
                 {
-                    int32_t* version = reinterpret_cast<int32_t*>(value);
+                    int32_t version = reinterpret_cast<int32_t>(value);
 
-                    if (*version != odbcVersion)
+                    if (version != odbcVersion)
                     {
                         AddStatusRecord(SQL_STATE_01S02_OPTION_VALUE_CHANGED,
                             "ODBC version is not supported.");
 
-                        *version = odbcVersion;
-
                         return SQL_RESULT_SUCCESS_WITH_INFO;
                     }
 
@@ -110,15 +108,13 @@ namespace ignite
 
                 case IGNITE_SQL_ENV_ATTR_OUTPUT_NTS:
                 {
-                    int32_t* nts = reinterpret_cast<int32_t*>(value);
+                    int32_t nts = reinterpret_cast<int32_t>(value);
 
-                    if (*nts != odbcNts)
+                    if (nts != odbcNts)
                     {
                         AddStatusRecord(SQL_STATE_01S02_OPTION_VALUE_CHANGED,
                             "Only null-termination of strings is supported.");
 
-                        *nts = odbcNts;
-
                         return SQL_RESULT_SUCCESS_WITH_INFO;
                     }
 


[48/50] ignite git commit: IGNITE-1786: Initial review - binaries.

Posted by vo...@apache.org.
IGNITE-1786: Initial review - binaries.


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

Branch: refs/heads/ignite-1786
Commit: a26dfb3323c7f2dd77f90236d0725189cc8e1177
Parents: ad3de1c
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Mon Jan 25 14:38:51 2016 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Mon Jan 25 14:38:51 2016 +0300

----------------------------------------------------------------------
 .../platforms/cpp/binary/include/ignite/impl/interop/interop.h | 6 +++---
 .../ignite/impl/interop/interop_stream_position_guard.h        | 1 +
 modules/platforms/cpp/binary/src/binary/binary_raw_reader.cpp  | 3 ++-
 modules/platforms/cpp/binary/src/binary/binary_reader.cpp      | 3 ++-
 .../cpp/binary/src/impl/binary/binary_reader_impl.cpp          | 3 ++-
 .../cpp/binary/src/impl/binary/binary_writer_impl.cpp          | 3 ++-
 .../cpp/binary/src/impl/interop/interop_input_stream.cpp       | 3 ++-
 .../platforms/cpp/binary/src/impl/interop/interop_memory.cpp   | 2 +-
 .../cpp/binary/src/impl/interop/interop_output_stream.cpp      | 3 ++-
 9 files changed, 17 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/a26dfb33/modules/platforms/cpp/binary/include/ignite/impl/interop/interop.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/binary/include/ignite/impl/interop/interop.h b/modules/platforms/cpp/binary/include/ignite/impl/interop/interop.h
index 6279630..da4fdb9 100644
--- a/modules/platforms/cpp/binary/include/ignite/impl/interop/interop.h
+++ b/modules/platforms/cpp/binary/include/ignite/impl/interop/interop.h
@@ -18,8 +18,8 @@
 #ifndef _IGNITE_IMPL_INTEROP
 #define _IGNITE_IMPL_INTEROP
 
-#include "ignite/impl/interop//interop_memory.h"
-#include "ignite/impl/interop//interop_output_stream.h"
-#include "ignite/impl/interop//interop_input_stream.h"
+#include "ignite/impl/interop/interop_memory.h"
+#include "ignite/impl/interop/interop_output_stream.h"
+#include "ignite/impl/interop/interop_input_stream.h"
 
 #endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/a26dfb33/modules/platforms/cpp/binary/include/ignite/impl/interop/interop_stream_position_guard.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/binary/include/ignite/impl/interop/interop_stream_position_guard.h b/modules/platforms/cpp/binary/include/ignite/impl/interop/interop_stream_position_guard.h
index 92b835f..a1c6e8a 100644
--- a/modules/platforms/cpp/binary/include/ignite/impl/interop/interop_stream_position_guard.h
+++ b/modules/platforms/cpp/binary/include/ignite/impl/interop/interop_stream_position_guard.h
@@ -18,6 +18,7 @@
 #ifndef _IGNITE_IMPL_INTEROP_STREAM_POSITION_GUARD
 #define _IGNITE_IMPL_INTEROP_OUTPUT_POSITION_GUARD
 
+/// TODO: Consider replacing NULL with 0 and removing header.
 #include <cstddef>
 
 #include "ignite/impl/interop/interop_memory.h"

http://git-wip-us.apache.org/repos/asf/ignite/blob/a26dfb33/modules/platforms/cpp/binary/src/binary/binary_raw_reader.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/binary/src/binary/binary_raw_reader.cpp b/modules/platforms/cpp/binary/src/binary/binary_raw_reader.cpp
index 61105e0..093c13f 100644
--- a/modules/platforms/cpp/binary/src/binary/binary_raw_reader.cpp
+++ b/modules/platforms/cpp/binary/src/binary/binary_raw_reader.cpp
@@ -14,8 +14,9 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#include "ignite/impl/binary/binary_reader_impl.h"
+
 #include "ignite/binary/binary_raw_reader.h"
+#include "ignite/impl/binary/binary_reader_impl.h"
 
 using namespace ignite::impl::binary;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/a26dfb33/modules/platforms/cpp/binary/src/binary/binary_reader.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/binary/src/binary/binary_reader.cpp b/modules/platforms/cpp/binary/src/binary/binary_reader.cpp
index b3fe4ee..005ec13 100644
--- a/modules/platforms/cpp/binary/src/binary/binary_reader.cpp
+++ b/modules/platforms/cpp/binary/src/binary/binary_reader.cpp
@@ -14,8 +14,9 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#include "ignite/impl/binary/binary_reader_impl.h"
+
 #include "ignite/binary/binary_reader.h"
+#include "ignite/impl/binary/binary_reader_impl.h"
 
 using namespace ignite::impl::binary;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/a26dfb33/modules/platforms/cpp/binary/src/impl/binary/binary_reader_impl.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/binary/src/impl/binary/binary_reader_impl.cpp b/modules/platforms/cpp/binary/src/impl/binary/binary_reader_impl.cpp
index 107fd8a..b33be8e 100644
--- a/modules/platforms/cpp/binary/src/impl/binary/binary_reader_impl.cpp
+++ b/modules/platforms/cpp/binary/src/impl/binary/binary_reader_impl.cpp
@@ -15,6 +15,8 @@
  * limitations under the License.
  */
 
+#include <ignite/common/ignite_error.h>
+
 #include "ignite/impl/interop/interop.h"
 #include "ignite/impl/interop/interop_stream_position_guard.h"
 #include "ignite/impl/binary/binary_common.h"
@@ -22,7 +24,6 @@
 #include "ignite/impl/binary/binary_reader_impl.h"
 #include "ignite/impl/binary/binary_utils.h"
 #include "ignite/binary/binary_type.h"
-#include <ignite/common/ignite_error.h>
 
 using namespace ignite::impl::interop;
 using namespace ignite::impl::binary;

http://git-wip-us.apache.org/repos/asf/ignite/blob/a26dfb33/modules/platforms/cpp/binary/src/impl/binary/binary_writer_impl.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/binary/src/impl/binary/binary_writer_impl.cpp b/modules/platforms/cpp/binary/src/impl/binary/binary_writer_impl.cpp
index 8971e79..97aff17 100644
--- a/modules/platforms/cpp/binary/src/impl/binary/binary_writer_impl.cpp
+++ b/modules/platforms/cpp/binary/src/impl/binary/binary_writer_impl.cpp
@@ -15,9 +15,10 @@
  * limitations under the License.
  */
 
+#include <ignite/common/ignite_error.h>
+
 #include "ignite/impl/binary/binary_writer_impl.h"
 #include "ignite/impl/interop/interop_stream_position_guard.h"
-#include <ignite/common/ignite_error.h>
 
 using namespace ignite::impl::interop;
 using namespace ignite::impl::binary;

http://git-wip-us.apache.org/repos/asf/ignite/blob/a26dfb33/modules/platforms/cpp/binary/src/impl/interop/interop_input_stream.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/binary/src/impl/interop/interop_input_stream.cpp b/modules/platforms/cpp/binary/src/impl/interop/interop_input_stream.cpp
index 4f8443c..e62f15d 100644
--- a/modules/platforms/cpp/binary/src/impl/interop/interop_input_stream.cpp
+++ b/modules/platforms/cpp/binary/src/impl/interop/interop_input_stream.cpp
@@ -17,9 +17,10 @@
 
 #include <cstring>
 
-#include "ignite/impl/interop//interop_input_stream.h"
 #include <ignite/common/ignite_error.h>
 
+#include "ignite/impl/interop//interop_input_stream.h"
+
 /**
  * Common macro to read a single value.
  */

http://git-wip-us.apache.org/repos/asf/ignite/blob/a26dfb33/modules/platforms/cpp/binary/src/impl/interop/interop_memory.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/binary/src/impl/interop/interop_memory.cpp b/modules/platforms/cpp/binary/src/impl/interop/interop_memory.cpp
index db83373..c9cf662 100644
--- a/modules/platforms/cpp/binary/src/impl/interop/interop_memory.cpp
+++ b/modules/platforms/cpp/binary/src/impl/interop/interop_memory.cpp
@@ -15,10 +15,10 @@
  * limitations under the License.
  */
 
+#include <ignite/common/ignite_error.h>
 #include <ignite/common/java.h>
 
 #include "ignite/impl/interop//interop_memory.h"
-#include <ignite/common/ignite_error.h>
 
 using namespace ignite::common::java;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/a26dfb33/modules/platforms/cpp/binary/src/impl/interop/interop_output_stream.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/binary/src/impl/interop/interop_output_stream.cpp b/modules/platforms/cpp/binary/src/impl/interop/interop_output_stream.cpp
index 0b905af..efa2989 100644
--- a/modules/platforms/cpp/binary/src/impl/interop/interop_output_stream.cpp
+++ b/modules/platforms/cpp/binary/src/impl/interop/interop_output_stream.cpp
@@ -17,9 +17,10 @@
 
 #include <cstring>
 
-#include "ignite/impl/interop//interop_output_stream.h"
 #include <ignite/common/ignite_error.h>
 
+#include "ignite/impl/interop//interop_output_stream.h"
+
 /**
  * Common macro to write a single value.
  */