IGNITE-2879: Fix for merge.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/474b00e6 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/474b00e6 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/474b00e6 Branch: refs/heads/ignite-1232 Commit: 474b00e61ce95cac25baf308854363ebc915ba08 Parents: 6814410 Author: isapego <[email protected]> Authored: Thu Jun 30 17:26:34 2016 +0300 Committer: isapego <[email protected]> Committed: Thu Jun 30 17:26:34 2016 +0300 ---------------------------------------------------------------------- .../odbc/src/app/application_data_buffer.cpp | 45 ++------------------ 1 file changed, 4 insertions(+), 41 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/474b00e6/modules/platforms/cpp/odbc/src/app/application_data_buffer.cpp ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/odbc/src/app/application_data_buffer.cpp b/modules/platforms/cpp/odbc/src/app/application_data_buffer.cpp index eab6750..2190c00 100644 --- a/modules/platforms/cpp/odbc/src/app/application_data_buffer.cpp +++ b/modules/platforms/cpp/odbc/src/app/application_data_buffer.cpp @@ -360,8 +360,6 @@ namespace ignite converter << value; - converter << value; - int64_t numValue; converter >> numValue; @@ -380,8 +378,6 @@ namespace ignite converter << value; - converter << value; - double numValue; converter >> numValue; @@ -559,10 +555,6 @@ namespace ignite { PutNum<int64_t>(value.ToInt64()); - converter << value; - - PutString(converter.str()); - break; } @@ -583,25 +575,6 @@ namespace ignite PutString(converter.str()); - common::FixedSizeArray<int8_t> bytesBuffer; - - const common::BigInteger& unscaled = zeroScaled.GetUnscaledValue(); - - unscaled.MagnitudeToBytes(bytesBuffer); - - for (int32_t i = 0; i < SQL_MAX_NUMERIC_LEN; ++i) - { - int32_t bufIdx = bytesBuffer.GetSize() - 1 - i; - if (bufIdx >= 0) - numeric->val[i] = bytesBuffer[bufIdx]; - else - numeric->val[i] = 0; - } - - numeric->scale = 0; - numeric->sign = unscaled.GetSign() < 0 ? 0 : 1; - numeric->precision = unscaled.GetPrecision(); - break; } @@ -727,11 +700,11 @@ namespace ignite case IGNITE_ODBC_C_TYPE_BINARY: case IGNITE_ODBC_C_TYPE_DEFAULT: { - SQL_NUMERIC_STRUCT* numeric = - reinterpret_cast<SQL_NUMERIC_STRUCT*>(GetData()); + if (GetData()) + memcpy(GetData(), &value, std::min(static_cast<size_t>(buflen), sizeof(value))); - common::Decimal zeroScaled; - value.SetScale(0, zeroScaled); + if (GetResLen()) + *GetResLen() = sizeof(value); break; } @@ -745,12 +718,6 @@ namespace ignite case IGNITE_ODBC_C_TYPE_UNSIGNED_LONG: case IGNITE_ODBC_C_TYPE_SIGNED_BIGINT: case IGNITE_ODBC_C_TYPE_UNSIGNED_BIGINT: - { - PutNum<int64_t>(value.ToInt64()); - - break; - } - case IGNITE_ODBC_C_TYPE_FLOAT: case IGNITE_ODBC_C_TYPE_DOUBLE: case IGNITE_ODBC_C_TYPE_NUMERIC: @@ -992,8 +959,6 @@ namespace ignite converter << str; - converter << str; - converter >> res; break; @@ -1061,8 +1026,6 @@ namespace ignite converter << str; - converter << str; - // Workaround for char types which are recognised as // symbolyc types and not numeric types. if (sizeof(T) == 1)
