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 <[email protected]>
Authored: Thu Jan 21 19:24:37 2016 +0300
Committer: isapego <[email protected]>
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;
                     }
 

Reply via email to