diff --git a/Data/ODBC/include/Poco/Data/ODBC/Binder.h b/Data/ODBC/include/Poco/Data/ODBC/Binder.h index c52e8c721..2157b6e14 100755 --- a/Data/ODBC/include/Poco/Data/ODBC/Binder.h +++ b/Data/ODBC/include/Poco/Data/ODBC/Binder.h @@ -610,7 +610,7 @@ private: for (; lIt != lEnd; ++lIt, ++cIt) { SQLLEN sz = static_cast(cIt->size()); - if (sz > size) size = sz; + if (sz > size) size = static_cast(sz); *lIt = sz; } diff --git a/Data/ODBC/src/Extractor.cpp b/Data/ODBC/src/Extractor.cpp index eb3c6f5d6..9e50c56df 100755 --- a/Data/ODBC/src/Extractor.cpp +++ b/Data/ODBC/src/Extractor.cpp @@ -233,7 +233,8 @@ bool Extractor::extractManualImpl(std::size_t pos, std::string& val std::size_t totalSize = 0; SQLLEN len; - Poco::Buffer apChar(CHUNK_SIZE); + const int bufSize = CHUNK_SIZE; + Poco::Buffer apChar(bufSize); char* pChar = apChar.begin(); SQLRETURN rc = 0; @@ -242,13 +243,13 @@ bool Extractor::extractManualImpl(std::size_t pos, std::string& val do { - std::memset(pChar, 0, CHUNK_SIZE); + std::memset(pChar, 0, bufSize); len = 0; rc = SQLGetData(_rStmt, (SQLUSMALLINT) pos + 1, cType, //C data type pChar, //returned value - CHUNK_SIZE, //buffer length + bufSize, //buffer length &len); //length indicator if (SQL_NO_DATA != rc && Utility::isError(rc)) @@ -289,7 +290,8 @@ bool Extractor::extractManualImpl(std::size_t pos, std::size_t totalSize = 0; SQLLEN len; - Poco::Buffer apChar(CHUNK_SIZE); + const int bufSize = CHUNK_SIZE; + Poco::Buffer apChar(bufSize); char* pChar = apChar.begin(); SQLRETURN rc = 0; @@ -298,13 +300,13 @@ bool Extractor::extractManualImpl(std::size_t pos, do { - std::memset(pChar, 0, CHUNK_SIZE); + std::memset(pChar, 0, bufSize); len = 0; rc = SQLGetData(_rStmt, (SQLUSMALLINT) pos + 1, cType, //C data type pChar, //returned value - CHUNK_SIZE, //buffer length + bufSize, //buffer length &len); //length indicator _lengths[pos] += len; diff --git a/Data/ODBC/testsuite/src/ODBCPostgreSQLTest.cpp b/Data/ODBC/testsuite/src/ODBCPostgreSQLTest.cpp index 7a38e2172..63fc9ce0e 100755 --- a/Data/ODBC/testsuite/src/ODBCPostgreSQLTest.cpp +++ b/Data/ODBC/testsuite/src/ODBCPostgreSQLTest.cpp @@ -38,10 +38,18 @@ using Poco::DateTime; #ifdef POCO_ODBC_USE_MAMMOTH_NG #define POSTGRESQL_ODBC_DRIVER "Mammoth ODBCng Beta" #elif defined (POCO_ODBC_UNICODE) - #define POSTGRESQL_ODBC_DRIVER "PostgreSQL ODBC Driver(UNICODE)" + #ifdef POCO_PTR_IS_64_BIT + #define POSTGRESQL_ODBC_DRIVER "PostgreSQL Unicode(x64)" + #else + #define POSTGRESQL_ODBC_DRIVER "PostgreSQL Unicode" + #endif #define POSTGRESQL_DSN "PocoDataPgSQLTestW" #else - #define POSTGRESQL_ODBC_DRIVER "PostgreSQL ODBC Driver(ANSI)" + #ifdef POCO_PTR_IS_64_BIT + #define POSTGRESQL_ODBC_DRIVER "PostgreSQL ANSI(x64)" + #else + #define POSTGRESQL_ODBC_DRIVER "PostgreSQL ANSI" + #endif #define POSTGRESQL_DSN "PocoDataPgSQLTest" #endif @@ -50,7 +58,7 @@ using Poco::DateTime; #define POSTGRESQL_DB "postgres" #define POSTGRESQL_UID "postgres" #define POSTGRESQL_PWD "postgres" -#define POSTGRESQL_VERSION "9.2" +#define POSTGRESQL_VERSION "9.3" #ifdef POCO_OS_FAMILY_WINDOWS const std::string ODBCPostgreSQLTest::_libDir = "C:\\\\Program Files\\\\PostgreSQL\\\\" POSTGRESQL_VERSION "\\\\lib\\\\"; diff --git a/Data/ODBC/testsuite/src/ODBCSQLServerTest.cpp b/Data/ODBC/testsuite/src/ODBCSQLServerTest.cpp index 7489d4960..8b044311d 100755 --- a/Data/ODBC/testsuite/src/ODBCSQLServerTest.cpp +++ b/Data/ODBC/testsuite/src/ODBCSQLServerTest.cpp @@ -81,7 +81,7 @@ using Poco::DateTime; #endif #define MS_SQL_SERVER_DSN "PocoDataSQLServerTest" -#define MS_SQL_SERVER_SERVER POCO_ODBC_TEST_DATABASE_SERVER +#define MS_SQL_SERVER_SERVER POCO_ODBC_TEST_DATABASE_SERVER "\\SQLEXPRESS" #define MS_SQL_SERVER_PORT "1433" #define MS_SQL_SERVER_DB "poco" #define MS_SQL_SERVER_UID "poco" diff --git a/Data/ODBC/testsuite/src/SQLExecutor.cpp b/Data/ODBC/testsuite/src/SQLExecutor.cpp index d8a06c6b8..086c80f13 100755 --- a/Data/ODBC/testsuite/src/SQLExecutor.cpp +++ b/Data/ODBC/testsuite/src/SQLExecutor.cpp @@ -350,7 +350,7 @@ void SQLExecutor::bareboneODBCTest(const std::string& dbConnString, rc = SQLFetch(hstmt); assert (SQL_SUCCEEDED(rc) || SQL_NO_DATA == rc); - SQLINTEGER dateTimeColSize = 0; + SQLULEN dateTimeColSize = 0; SQLSMALLINT dateTimeDecDigits = 0; if (SQL_SUCCEEDED(rc)) { @@ -611,7 +611,7 @@ void SQLExecutor::bareboneODBCTest(const std::string& dbConnString, if (SQLExecutor::DE_MANUAL == extractMode) { - SQLINTEGER len = lengths[0] = 0; + SQLLEN len = lengths[0] = 0; while (SQL_SUCCESS_WITH_INFO == (rc = SQLGetData(hstmt, (SQLUSMALLINT) 1, SQL_C_CHAR, @@ -1463,7 +1463,7 @@ void SQLExecutor::insertSingleBulk() for (x = 0; x < 100; ++x) { - int i = stmt.execute(); + std::size_t i = stmt.execute(); assert (1 == i); } int count = 0; diff --git a/Data/SQLite/src/SQLiteStatementImpl.cpp b/Data/SQLite/src/SQLiteStatementImpl.cpp index d67f2649f..274126974 100755 --- a/Data/SQLite/src/SQLiteStatementImpl.cpp +++ b/Data/SQLite/src/SQLiteStatementImpl.cpp @@ -160,7 +160,7 @@ void SQLiteStatementImpl::bindImpl() return; } - int availableCount = 0; + std::size_t availableCount = 0; Bindings::difference_type bindCount = 0; Bindings::iterator it = _bindBegin; for (; it != bindEnd; ++it) diff --git a/Data/include/Poco/Data/Limit.h b/Data/include/Poco/Data/Limit.h index f3b0451d8..d5c9372a6 100755 --- a/Data/include/Poco/Data/Limit.h +++ b/Data/include/Poco/Data/Limit.h @@ -31,12 +31,14 @@ class Data_API Limit /// Limit stores information how many rows a query should return. { public: + typedef Poco::UInt32 SizeT; + enum Type { - LIMIT_UNLIMITED = 0xffffffffu + LIMIT_UNLIMITED = ~((SizeT) 0) }; - Limit(Poco::UInt32 value, bool hardLimit = false, bool isLowerLimit = false); + Limit(SizeT value, bool hardLimit = false, bool isLowerLimit = false); /// Creates the Limit. /// /// Value contains the upper row hint, if hardLimit is set to true, the limit acts as a hard @@ -48,7 +50,7 @@ public: ~Limit(); /// Destroys the Limit. - Poco::UInt32 value() const; + SizeT value() const; /// Returns the value of the limit bool isHardLimit() const; @@ -64,9 +66,9 @@ public: /// Inequality operator. private: - Poco::UInt32 _value; - bool _hardLimit; - bool _isLowerLimit; + SizeT _value; + bool _hardLimit; + bool _isLowerLimit; }; diff --git a/Data/include/Poco/Data/Range.h b/Data/include/Poco/Data/Range.h index bb91c4203..da5871b9e 100755 --- a/Data/include/Poco/Data/Range.h +++ b/Data/include/Poco/Data/Range.h @@ -32,7 +32,7 @@ class Data_API Range /// Range stores information how many rows a query should return. { public: - Range(Poco::UInt32 lowValue, Poco::UInt32 upValue, bool hardLimit); + Range(Limit::SizeT lowValue, Limit::SizeT upValue, bool hardLimit); /// Creates the Range. lowValue must be smaller equal than upValue ~Range(); @@ -72,7 +72,7 @@ template Limit limit(T lim, bool hard = false) /// Creates an upperLimit { - return Limit(static_cast(lim), hard, false); + return Limit(static_cast(lim), hard, false); } @@ -86,14 +86,14 @@ Limit upperLimit(T lim, bool hard = false) template Limit lowerLimit(T lim) { - return Limit(static_cast(lim), true, true); + return Limit(static_cast(lim), true, true); } template Range range(T low, T upp, bool hard = false) { - return Range(static_cast(low), static_cast(upp), hard); + return Range(static_cast(low), static_cast(upp), hard); } diff --git a/Data/include/Poco/Data/StatementImpl.h b/Data/include/Poco/Data/StatementImpl.h index 04f2df568..06306e455 100755 --- a/Data/include/Poco/Data/StatementImpl.h +++ b/Data/include/Poco/Data/StatementImpl.h @@ -209,7 +209,7 @@ protected: void fixupExtraction(); /// Sets the AbstractExtractor at the extractors. - std::size_t getExtractionLimit(); + Limit::SizeT getExtractionLimit(); /// Returns the extraction limit value. const Limit& extractionLimit() const; @@ -552,7 +552,7 @@ inline std::size_t StatementImpl::currentDataSet() const } -inline std::size_t StatementImpl::getExtractionLimit() +inline Limit::SizeT StatementImpl::getExtractionLimit() { return _extrLimit.value(); } diff --git a/Data/src/Limit.cpp b/Data/src/Limit.cpp index 4f49642bf..28961c22a 100755 --- a/Data/src/Limit.cpp +++ b/Data/src/Limit.cpp @@ -21,7 +21,7 @@ namespace Poco { namespace Data { -Limit::Limit(Poco::UInt32 value, bool hardLimit, bool isLowerLimit): +Limit::Limit(SizeT value, bool hardLimit, bool isLowerLimit) : _value(value), _hardLimit(hardLimit), _isLowerLimit(isLowerLimit) diff --git a/Data/src/Range.cpp b/Data/src/Range.cpp index 8c38e0c7e..d777c45e5 100755 --- a/Data/src/Range.cpp +++ b/Data/src/Range.cpp @@ -25,7 +25,7 @@ namespace Data { using namespace Keywords; -Range::Range(Poco::UInt32 lowValue, Poco::UInt32 upValue, bool hardLimit): +Range::Range(Limit::SizeT lowValue, Limit::SizeT upValue, bool hardLimit) : _lower(lowerLimit(lowValue)), _upper(upperLimit(upValue, hardLimit)) { diff --git a/Data/src/StatementImpl.cpp b/Data/src/StatementImpl.cpp index 0fc701c69..e4c1459c5 100755 --- a/Data/src/StatementImpl.cpp +++ b/Data/src/StatementImpl.cpp @@ -46,7 +46,7 @@ const std::string StatementImpl::UNKNOWN = "unknown"; StatementImpl::StatementImpl(SessionImpl& rSession): _state(ST_INITIALIZED), - _extrLimit(upperLimit((std::size_t) Limit::LIMIT_UNLIMITED, false)), + _extrLimit(upperLimit(Limit::LIMIT_UNLIMITED, false)), _lowerLimit(0), _rSession(rSession), _storage(STORAGE_UNKNOWN_IMPL), @@ -221,7 +221,7 @@ void StatementImpl::setExtractionLimit(const Limit& extrLimit) void StatementImpl::setBulkExtraction(const Bulk& b) { - std::size_t limit = getExtractionLimit(); + Limit::SizeT limit = getExtractionLimit(); if (Limit::LIMIT_UNLIMITED != limit && b.size() != limit) throw InvalidArgumentException("Can not set limit for statement.");