ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject [11/30] ignite git commit: IGNITE-5939: ODBC: SQLColAttributes now works with legacy attribute codes.
Date Thu, 10 Aug 2017 13:53:08 GMT
IGNITE-5939: ODBC: SQLColAttributes now works with legacy attribute codes.


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

Branch: refs/heads/ignite-5872
Commit: 70ffa2cdf2a8210d42d32c2a35c9a21ee87aaa1f
Parents: 359777f
Author: Igor Sapego <isapego@gridgain.com>
Authored: Fri Aug 4 18:34:27 2017 +0300
Committer: Igor Sapego <isapego@gridgain.com>
Committed: Fri Aug 4 18:35:26 2017 +0300

----------------------------------------------------------------------
 .../cpp/odbc-test/src/meta_queries_test.cpp     | 51 ++++++++++++++++++++
 .../platforms/cpp/odbc/src/meta/column_meta.cpp |  3 ++
 2 files changed, 54 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/70ffa2cd/modules/platforms/cpp/odbc-test/src/meta_queries_test.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc-test/src/meta_queries_test.cpp b/modules/platforms/cpp/odbc-test/src/meta_queries_test.cpp
index 5b7ae59..454a989 100644
--- a/modules/platforms/cpp/odbc-test/src/meta_queries_test.cpp
+++ b/modules/platforms/cpp/odbc-test/src/meta_queries_test.cpp
@@ -186,4 +186,55 @@ BOOST_AUTO_TEST_CASE(TestGetTypeInfoAllTypes)
         BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
 }
 
+BOOST_AUTO_TEST_CASE(TestColAttributesColumnLength)
+{
+    Connect("DRIVER={Apache Ignite};ADDRESS=127.0.0.1:11110;SCHEMA=cache");
+
+    SQLCHAR req[] = "select strField from TestType";
+    SQLExecDirect(stmt, req, SQL_NTS);
+
+    SQLLEN intVal;
+    SQLCHAR strBuf[1024];
+    SQLSMALLINT strLen;
+
+    SQLRETURN ret = SQLColAttribute(stmt, 1, SQL_COLUMN_LENGTH, strBuf, sizeof(strBuf), &strLen,
&intVal);
+
+    if (!SQL_SUCCEEDED(ret))
+        BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+}
+
+BOOST_AUTO_TEST_CASE(TestColAttributesColumnPresicion)
+{
+    Connect("DRIVER={Apache Ignite};ADDRESS=127.0.0.1:11110;SCHEMA=cache");
+
+    SQLCHAR req[] = "select strField from TestType";
+    SQLExecDirect(stmt, req, SQL_NTS);
+
+    SQLLEN intVal;
+    SQLCHAR strBuf[1024];
+    SQLSMALLINT strLen;
+
+    SQLRETURN ret = SQLColAttribute(stmt, 1, SQL_COLUMN_PRECISION, strBuf, sizeof(strBuf),
&strLen, &intVal);
+
+    if (!SQL_SUCCEEDED(ret))
+        BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+}
+
+BOOST_AUTO_TEST_CASE(TestColAttributesColumnScale)
+{
+    Connect("DRIVER={Apache Ignite};ADDRESS=127.0.0.1:11110;SCHEMA=cache");
+
+    SQLCHAR req[] = "select strField from TestType";
+    SQLExecDirect(stmt, req, SQL_NTS);
+
+    SQLLEN intVal;
+    SQLCHAR strBuf[1024];
+    SQLSMALLINT strLen;
+
+    SQLRETURN ret = SQLColAttribute(stmt, 1, SQL_COLUMN_SCALE, strBuf, sizeof(strBuf), &strLen,
&intVal);
+
+    if (!SQL_SUCCEEDED(ret))
+        BOOST_FAIL(GetOdbcErrorMessage(SQL_HANDLE_STMT, stmt));
+}
+
 BOOST_AUTO_TEST_SUITE_END()

http://git-wip-us.apache.org/repos/asf/ignite/blob/70ffa2cd/modules/platforms/cpp/odbc/src/meta/column_meta.cpp
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/odbc/src/meta/column_meta.cpp b/modules/platforms/cpp/odbc/src/meta/column_meta.cpp
index 12dbfc1..97fdf80 100644
--- a/modules/platforms/cpp/odbc/src/meta/column_meta.cpp
+++ b/modules/platforms/cpp/odbc/src/meta/column_meta.cpp
@@ -179,6 +179,7 @@ namespace ignite
 
                     case SQL_DESC_LENGTH:
                     case SQL_DESC_OCTET_LENGTH:
+                    case SQL_COLUMN_LENGTH:
                     {
                         value = type_traits::BinaryTypeTransferLength(dataType);
 
@@ -200,6 +201,7 @@ namespace ignite
                     }
 
                     case SQL_DESC_PRECISION:
+                    case SQL_COLUMN_PRECISION:
                     {
                         value = type_traits::BinaryTypeColumnSize(dataType);
 
@@ -207,6 +209,7 @@ namespace ignite
                     }
 
                     case SQL_DESC_SCALE:
+                    case SQL_COLUMN_SCALE:
                     {
                         value = type_traits::BinaryTypeDecimalDigits(dataType);
 


Mime
View raw message