IGNITE-2495: Fixed DataQuery.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/cc0c0799 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/cc0c0799 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/cc0c0799 Branch: refs/heads/ignite-1786 Commit: cc0c0799d45698edce3e86e7fae2f78598746427 Parents: 27f438c Author: isapego <[email protected]> Authored: Fri Jan 29 14:59:01 2016 +0300 Committer: isapego <[email protected]> Committed: Fri Jan 29 14:59:01 2016 +0300 ---------------------------------------------------------------------- .../odbc/src/diagnostic/diagnosable_adapter.cpp | 3 ++- .../platforms/cpp/odbc/src/query/data_query.cpp | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/cc0c0799/modules/platforms/cpp/odbc/src/diagnostic/diagnosable_adapter.cpp ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/odbc/src/diagnostic/diagnosable_adapter.cpp b/modules/platforms/cpp/odbc/src/diagnostic/diagnosable_adapter.cpp index d6cf4fe..7f801ca 100644 --- a/modules/platforms/cpp/odbc/src/diagnostic/diagnosable_adapter.cpp +++ b/modules/platforms/cpp/odbc/src/diagnostic/diagnosable_adapter.cpp @@ -39,8 +39,9 @@ namespace ignite } } - void DiagnosableAdapter::AddStatusRecord(SqlState sqlState, const std::string & message) + void DiagnosableAdapter::AddStatusRecord(SqlState sqlState, const std::string& message) { + LOG_MSG("Adding new record: %s\n", message.c_str()); AddStatusRecord(sqlState, message, 0, 0); } } http://git-wip-us.apache.org/repos/asf/ignite/blob/cc0c0799/modules/platforms/cpp/odbc/src/query/data_query.cpp ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/odbc/src/query/data_query.cpp b/modules/platforms/cpp/odbc/src/query/data_query.cpp index 0702088..ecc59e2 100644 --- a/modules/platforms/cpp/odbc/src/query/data_query.cpp +++ b/modules/platforms/cpp/odbc/src/query/data_query.cpp @@ -76,13 +76,13 @@ namespace ignite if (result != SQL_RESULT_SUCCESS) return result; - - if (!cursor->HasData()) - return SQL_RESULT_NO_DATA; } else cursor->Increment(); + if (!cursor->HasData()) + return SQL_RESULT_NO_DATA; + Row* row = cursor->GetRow(); if (!row) @@ -96,16 +96,16 @@ namespace ignite { app::ColumnBindingMap::iterator it = columnBindings.find(i); - SqlResult result; - if (it != columnBindings.end()) - result = row->ReadColumnToBuffer(i, it->second); - - if (result == SQL_RESULT_ERROR) { - diag.AddStatusRecord(SQL_STATE_01S01_ERROR_IN_ROW, "Can not retrieve row column.", 0, i); + SqlResult result = row->ReadColumnToBuffer(i, it->second); + + if (result == SQL_RESULT_ERROR) + { + diag.AddStatusRecord(SQL_STATE_01S01_ERROR_IN_ROW, "Can not retrieve row column.", 0, i); - return SQL_RESULT_ERROR; + return SQL_RESULT_ERROR; + } } }
