diff --git a/Data/MySQL/Makefile b/Data/MySQL/Makefile index c6fc2ac1c..64a7d3f82 100644 --- a/Data/MySQL/Makefile +++ b/Data/MySQL/Makefile @@ -6,7 +6,7 @@ include $(POCO_BASE)/build/rules/global -SYSLIBS += -L/usr/local/lib$(LIB64SUFFIX)/mysql -L/usr/lib$(LIB64SUFFIX)/mysql -L/usr/mysql/lib$(LIB64SUFFIX) -L/usr/mysql/lib$(LIB64SUFFIX)/mysql -L/usr/local/mysql/lib$(LIB64SUFFIX) -lmysqlclient +SYSLIBS += -L/usr/local/lib -L/usr/local/lib$(LIB64SUFFIX)/mysql -L/usr/lib$(LIB64SUFFIX)/mysql -L/usr/mysql/lib$(LIB64SUFFIX) -L/usr/mysql/lib$(LIB64SUFFIX)/mysql -L/usr/local/mysql/lib$(LIB64SUFFIX) -lmysqlclient INCLUDE += -I/usr/local/include/mysql/ -I/usr/include/mysql/ -I/usr/mysql/include/mysql -I/usr/local/mysql/include SYSFLAGS += -DTHREADSAFE -DNO_TCL diff --git a/Data/MySQL/include/Poco/Data/MySQL/Binder.h b/Data/MySQL/include/Poco/Data/MySQL/Binder.h index 0eb258cb7..9ed275d30 100644 --- a/Data/MySQL/include/Poco/Data/MySQL/Binder.h +++ b/Data/MySQL/include/Poco/Data/MySQL/Binder.h @@ -36,7 +36,7 @@ public: Binder(); /// Creates the Binder. - + virtual ~Binder(); /// Destroys the Binder. @@ -64,16 +64,12 @@ public: virtual void bind(std::size_t pos, const Poco::UInt64& val, Direction dir); /// Binds an UInt64. -#ifndef POCO_LONG_IS_64_BIT - virtual void bind(std::size_t pos, const long& val, Direction dir = PD_IN); /// Binds a long. virtual void bind(std::size_t pos, const unsigned long& val, Direction dir = PD_IN); /// Binds an unsigned long. -#endif // POCO_LONG_IS_64_BIT - virtual void bind(std::size_t pos, const bool& val, Direction dir); /// Binds a boolean. @@ -108,7 +104,7 @@ public: /// Binds a null. - virtual void bind(std::size_t pos, const std::vector& val, Direction dir = PD_IN); + virtual void bind(std::size_t pos, const std::vector& val, Direction dir = PD_IN); virtual void bind(std::size_t pos, const std::deque& val, Direction dir = PD_IN); @@ -136,25 +132,25 @@ public: virtual void bind(std::size_t pos, const std::deque& val, Direction dir = PD_IN); - virtual void bind(std::size_t pos, const std::list& val, Direction dir = PD_IN); + virtual void bind(std::size_t pos, const std::list& val, Direction dir = PD_IN); - virtual void bind(std::size_t pos, const std::vector& val, Direction dir = PD_IN); + virtual void bind(std::size_t pos, const std::vector& val, Direction dir = PD_IN); virtual void bind(std::size_t pos, const std::deque& val, Direction dir = PD_IN); - virtual void bind(std::size_t pos, const std::list& val, Direction dir = PD_IN); + virtual void bind(std::size_t pos, const std::list& val, Direction dir = PD_IN); - virtual void bind(std::size_t pos, const std::vector& val, Direction dir = PD_IN); + virtual void bind(std::size_t pos, const std::vector& val, Direction dir = PD_IN); virtual void bind(std::size_t pos, const std::deque& val, Direction dir = PD_IN); - virtual void bind(std::size_t pos, const std::list& val, Direction dir = PD_IN); + virtual void bind(std::size_t pos, const std::list& val, Direction dir = PD_IN); - virtual void bind(std::size_t pos, const std::vector& val, Direction dir = PD_IN); + virtual void bind(std::size_t pos, const std::vector& val, Direction dir = PD_IN); virtual void bind(std::size_t pos, const std::deque& val, Direction dir = PD_IN); - virtual void bind(std::size_t pos, const std::list& val, Direction dir = PD_IN); + virtual void bind(std::size_t pos, const std::list& val, Direction dir = PD_IN); virtual void bind(std::size_t pos, const std::vector& val, Direction dir = PD_IN); @@ -236,12 +232,12 @@ private: /// Don't copy the binder virtual void bind(std::size_t, const char* const&, Direction) - /// Binds a const char ptr. + /// Binds a const char ptr. /// This is a private no-op in this implementation /// due to security risk. { } - + void realBind(std::size_t pos, enum_field_types type, const void* buffer, int length, bool isUnsigned = false); /// Common bind implementation diff --git a/Data/MySQL/include/Poco/Data/MySQL/Extractor.h b/Data/MySQL/include/Poco/Data/MySQL/Extractor.h index 67dfb100e..374c15939 100644 --- a/Data/MySQL/include/Poco/Data/MySQL/Extractor.h +++ b/Data/MySQL/include/Poco/Data/MySQL/Extractor.h @@ -50,42 +50,40 @@ public: virtual bool extract(std::size_t pos, Poco::Int8& val); /// Extracts an Int8. - + virtual bool extract(std::size_t pos, Poco::UInt8& val); /// Extracts an UInt8. - + virtual bool extract(std::size_t pos, Poco::Int16& val); /// Extracts an Int16. - + virtual bool extract(std::size_t pos, Poco::UInt16& val); /// Extracts an UInt16. - + virtual bool extract(std::size_t pos, Poco::Int32& val); /// Extracts an Int32. - + virtual bool extract(std::size_t pos, Poco::UInt32& val); /// Extracts an UInt32. - + virtual bool extract(std::size_t pos, Poco::Int64& val); /// Extracts an Int64. - + virtual bool extract(std::size_t pos, Poco::UInt64& val); /// Extracts an UInt64. - -#ifndef POCO_LONG_IS_64_BIT + virtual bool extract(std::size_t pos, long& val); /// Extracts a long. Returns false if null was received. virtual bool extract(std::size_t pos, unsigned long& val); /// Extracts an unsigned long. Returns false if null was received. -#endif virtual bool extract(std::size_t pos, bool& val); /// Extracts a boolean. - + virtual bool extract(std::size_t pos, float& val); /// Extracts a float. - + virtual bool extract(std::size_t pos, double& val); /// Extracts a double. @@ -125,7 +123,7 @@ public: //////////// // Not implemented extract functions //////////// - + virtual bool extract(std::size_t pos, std::vector& val); /// Extracts an Int8 vector. @@ -198,7 +196,6 @@ public: virtual bool extract(std::size_t pos, std::list& val); /// Extracts an UInt64 list. -#ifndef POCO_LONG_IS_64_BIT virtual bool extract(std::size_t pos, std::vector& val); /// Extracts a long vector. @@ -207,7 +204,6 @@ public: virtual bool extract(std::size_t pos, std::list& val); /// Extracts a long list. -#endif virtual bool extract(std::size_t pos, std::vector& val); /// Extracts a boolean vector. @@ -316,7 +312,7 @@ public: virtual bool extract(std::size_t pos, std::list& val); /// Extracts a Dynamic::Var list. - + private: bool realExtractFixed(std::size_t pos, enum_field_types type, void* buffer, bool isUnsigned = false); diff --git a/Data/MySQL/src/Binder.cpp b/Data/MySQL/src/Binder.cpp index d53d33e47..1bfb31c6c 100644 --- a/Data/MySQL/src/Binder.cpp +++ b/Data/MySQL/src/Binder.cpp @@ -91,8 +91,6 @@ void Binder::bind(std::size_t pos, const Poco::UInt64& val, Direction dir) } -#ifndef POCO_LONG_IS_64_BIT - void Binder::bind(std::size_t pos, const long& val, Direction dir) { poco_assert(dir == PD_IN); @@ -106,8 +104,6 @@ void Binder::bind(std::size_t pos, const unsigned long& val, Direction dir) realBind(pos, MYSQL_TYPE_LONG, &val, 0, true); } -#endif // POCO_LONG_IS_64_BIT - void Binder::bind(std::size_t pos, const bool& val, Direction dir) { @@ -115,7 +111,7 @@ void Binder::bind(std::size_t pos, const bool& val, Direction dir) realBind(pos, MYSQL_TYPE_TINY, &val, 0); } - + void Binder::bind(std::size_t pos, const float& val, Direction dir) { poco_assert(dir == PD_IN); @@ -268,7 +264,7 @@ MYSQL_BIND* Binder::getBindArray() const /////////////////// // -// Private +// Private // //////////////////// @@ -293,7 +289,7 @@ void Binder::realBind(std::size_t pos, enum_field_types type, const void* buffer } -void Binder::bind(std::size_t pos, const std::vector& val, Direction dir) +void Binder::bind(std::size_t pos, const std::vector& val, Direction dir) { throw NotImplementedException(); } @@ -305,13 +301,13 @@ void Binder::bind(std::size_t pos, const std::deque& val, Direction } -void Binder::bind(std::size_t pos, const std::list& val, Direction dir) +void Binder::bind(std::size_t pos, const std::list& val, Direction dir) { throw NotImplementedException(); } -void Binder::bind(std::size_t pos, const std::vector& val, Direction dir) +void Binder::bind(std::size_t pos, const std::vector& val, Direction dir) { throw NotImplementedException(); } @@ -323,13 +319,13 @@ void Binder::bind(std::size_t pos, const std::deque& val, Direction } -void Binder::bind(std::size_t pos, const std::list& val, Direction dir) +void Binder::bind(std::size_t pos, const std::list& val, Direction dir) { throw NotImplementedException(); } -void Binder::bind(std::size_t pos, const std::vector& val, Direction dir) +void Binder::bind(std::size_t pos, const std::vector& val, Direction dir) { throw NotImplementedException(); } @@ -341,13 +337,13 @@ void Binder::bind(std::size_t pos, const std::deque& val, Direction } -void Binder::bind(std::size_t pos, const std::list& val, Direction dir) +void Binder::bind(std::size_t pos, const std::list& val, Direction dir) { throw NotImplementedException(); } -void Binder::bind(std::size_t pos, const std::vector& val, Direction dir) +void Binder::bind(std::size_t pos, const std::vector& val, Direction dir) { throw NotImplementedException(); } @@ -359,13 +355,13 @@ void Binder::bind(std::size_t pos, const std::deque& val, Directio } -void Binder::bind(std::size_t pos, const std::list& val, Direction dir) +void Binder::bind(std::size_t pos, const std::list& val, Direction dir) { throw NotImplementedException(); } -void Binder::bind(std::size_t pos, const std::vector& val, Direction dir) +void Binder::bind(std::size_t pos, const std::vector& val, Direction dir) { throw NotImplementedException(); } @@ -377,13 +373,13 @@ void Binder::bind(std::size_t pos, const std::deque& val, Direction } -void Binder::bind(std::size_t pos, const std::list& val, Direction dir) +void Binder::bind(std::size_t pos, const std::list& val, Direction dir) { throw NotImplementedException(); } -void Binder::bind(std::size_t pos, const std::vector& val, Direction dir) +void Binder::bind(std::size_t pos, const std::vector& val, Direction dir) { throw NotImplementedException(); } @@ -395,13 +391,13 @@ void Binder::bind(std::size_t pos, const std::deque& val, Directio } -void Binder::bind(std::size_t pos, const std::list& val, Direction dir) +void Binder::bind(std::size_t pos, const std::list& val, Direction dir) { throw NotImplementedException(); } -void Binder::bind(std::size_t pos, const std::vector& val, Direction dir) +void Binder::bind(std::size_t pos, const std::vector& val, Direction dir) { throw NotImplementedException(); } @@ -413,13 +409,13 @@ void Binder::bind(std::size_t pos, const std::deque& val, Direction } -void Binder::bind(std::size_t pos, const std::list& val, Direction dir) +void Binder::bind(std::size_t pos, const std::list& val, Direction dir) { throw NotImplementedException(); } -void Binder::bind(std::size_t pos, const std::vector& val, Direction dir) +void Binder::bind(std::size_t pos, const std::vector& val, Direction dir) { throw NotImplementedException(); } @@ -431,13 +427,13 @@ void Binder::bind(std::size_t pos, const std::deque& val, Directio } -void Binder::bind(std::size_t pos, const std::list& val, Direction dir) +void Binder::bind(std::size_t pos, const std::list& val, Direction dir) { throw NotImplementedException(); } -void Binder::bind(std::size_t pos, const std::vector& val, Direction dir) +void Binder::bind(std::size_t pos, const std::vector& val, Direction dir) { throw NotImplementedException(); } @@ -449,13 +445,13 @@ void Binder::bind(std::size_t pos, const std::deque& val, Direction dir) } -void Binder::bind(std::size_t pos, const std::list& val, Direction dir) +void Binder::bind(std::size_t pos, const std::list& val, Direction dir) { throw NotImplementedException(); } -void Binder::bind(std::size_t pos, const std::vector& val, Direction dir) +void Binder::bind(std::size_t pos, const std::vector& val, Direction dir) { throw NotImplementedException(); } @@ -467,13 +463,13 @@ void Binder::bind(std::size_t pos, const std::deque& val, Direction dir) } -void Binder::bind(std::size_t pos, const std::list& val, Direction dir) +void Binder::bind(std::size_t pos, const std::list& val, Direction dir) { throw NotImplementedException(); } -void Binder::bind(std::size_t pos, const std::vector& val, Direction dir) +void Binder::bind(std::size_t pos, const std::vector& val, Direction dir) { throw NotImplementedException(); } @@ -485,13 +481,13 @@ void Binder::bind(std::size_t pos, const std::deque& val, Direction dir) } -void Binder::bind(std::size_t pos, const std::list& val, Direction dir) +void Binder::bind(std::size_t pos, const std::list& val, Direction dir) { throw NotImplementedException(); } -void Binder::bind(std::size_t pos, const std::vector& val, Direction dir) +void Binder::bind(std::size_t pos, const std::vector& val, Direction dir) { throw NotImplementedException(); } @@ -503,13 +499,13 @@ void Binder::bind(std::size_t pos, const std::deque& val, Direction dir) } -void Binder::bind(std::size_t pos, const std::list& val, Direction dir) +void Binder::bind(std::size_t pos, const std::list& val, Direction dir) { throw NotImplementedException(); } -void Binder::bind(std::size_t pos, const std::vector& val, Direction dir) +void Binder::bind(std::size_t pos, const std::vector& val, Direction dir) { throw NotImplementedException(); } @@ -521,13 +517,13 @@ void Binder::bind(std::size_t pos, const std::deque& val, Dire } -void Binder::bind(std::size_t pos, const std::list& val, Direction dir) +void Binder::bind(std::size_t pos, const std::list& val, Direction dir) { throw NotImplementedException(); } -void Binder::bind(std::size_t pos, const std::vector& val, Direction dir) +void Binder::bind(std::size_t pos, const std::vector& val, Direction dir) { throw NotImplementedException(); } @@ -539,13 +535,13 @@ void Binder::bind(std::size_t pos, const std::deque& val, Dire } -void Binder::bind(std::size_t pos, const std::list& val, Direction dir) +void Binder::bind(std::size_t pos, const std::list& val, Direction dir) { throw NotImplementedException(); } -void Binder::bind(std::size_t pos, const std::vector& val, Direction dir) +void Binder::bind(std::size_t pos, const std::vector& val, Direction dir) { throw NotImplementedException(); } @@ -557,13 +553,13 @@ void Binder::bind(std::size_t pos, const std::deque& val, Direct } -void Binder::bind(std::size_t pos, const std::list& val, Direction dir) +void Binder::bind(std::size_t pos, const std::list& val, Direction dir) { throw NotImplementedException(); } -void Binder::bind(std::size_t pos, const std::vector& val, Direction dir) +void Binder::bind(std::size_t pos, const std::vector& val, Direction dir) { throw NotImplementedException(); } @@ -575,13 +571,13 @@ void Binder::bind(std::size_t pos, const std::deque& val, Dire } -void Binder::bind(std::size_t pos, const std::list& val, Direction dir) +void Binder::bind(std::size_t pos, const std::list& val, Direction dir) { throw NotImplementedException(); } -void Binder::bind(std::size_t pos, const std::vector& val, Direction dir) +void Binder::bind(std::size_t pos, const std::vector& val, Direction dir) { throw NotImplementedException(); } @@ -593,13 +589,13 @@ void Binder::bind(std::size_t pos, const std::deque& val, Dire } -void Binder::bind(std::size_t pos, const std::list& val, Direction dir) +void Binder::bind(std::size_t pos, const std::list& val, Direction dir) { throw NotImplementedException(); } -void Binder::bind(std::size_t pos, const std::vector& val, Direction dir) +void Binder::bind(std::size_t pos, const std::vector& val, Direction dir) { throw NotImplementedException(); } @@ -611,13 +607,13 @@ void Binder::bind(std::size_t pos, const std::deque& val, } -void Binder::bind(std::size_t pos, const std::list& val, Direction dir) +void Binder::bind(std::size_t pos, const std::list& val, Direction dir) { throw NotImplementedException(); } -void Binder::bind(std::size_t pos, const std::vector& val, Direction dir) +void Binder::bind(std::size_t pos, const std::vector& val, Direction dir) { throw NotImplementedException(); } @@ -629,7 +625,7 @@ void Binder::bind(std::size_t pos, const std::deque& val, Direction } -void Binder::bind(std::size_t pos, const std::list& val, Direction dir) +void Binder::bind(std::size_t pos, const std::list& val, Direction dir) { throw NotImplementedException(); } diff --git a/Data/MySQL/src/Extractor.cpp b/Data/MySQL/src/Extractor.cpp index 48d8cc67e..f801ffa25 100644 --- a/Data/MySQL/src/Extractor.cpp +++ b/Data/MySQL/src/Extractor.cpp @@ -80,7 +80,6 @@ bool Extractor::extract(std::size_t pos, Poco::UInt64& val) } -#ifndef POCO_LONG_IS_64_BIT bool Extractor::extract(std::size_t pos, long& val) { return realExtractFixed(pos, MYSQL_TYPE_LONG, &val); @@ -91,7 +90,6 @@ bool Extractor::extract(std::size_t pos, unsigned long& val) { return realExtractFixed(pos, MYSQL_TYPE_LONG, &val, true); } -#endif bool Extractor::extract(std::size_t pos, bool& val) @@ -105,32 +103,32 @@ bool Extractor::extract(std::size_t pos, float& val) return realExtractFixed(pos, MYSQL_TYPE_FLOAT, &val); } - + bool Extractor::extract(std::size_t pos, double& val) { return realExtractFixed(pos, MYSQL_TYPE_DOUBLE, &val); } - + bool Extractor::extract(std::size_t pos, char& val) { return realExtractFixed(pos, MYSQL_TYPE_TINY, &val); } - + bool Extractor::extract(std::size_t pos, std::string& val) { if (_metadata.columnsReturned() <= pos) throw MySQLException("Extractor: attempt to extract more parameters, than query result contain"); - + if (_metadata.isNull(static_cast(pos))) return false; - + //mysql reports TEXT types as FDT_BLOB when being extracted MetaColumn::ColumnDataType columnType = _metadata.metaColumn(static_cast(pos)).type(); if (columnType != Poco::Data::MetaColumn::FDT_STRING && columnType != Poco::Data::MetaColumn::FDT_BLOB) throw MySQLException("Extractor: not a string"); - + val.assign(reinterpret_cast(_metadata.rawData(pos)), _metadata.length(pos)); return true; } @@ -140,13 +138,13 @@ bool Extractor::extract(std::size_t pos, Poco::Data::BLOB& val) { if (_metadata.columnsReturned() <= pos) throw MySQLException("Extractor: attempt to extract more parameters, than query result contain"); - + if (_metadata.isNull(static_cast(pos))) return false; - + if (_metadata.metaColumn(static_cast(pos)).type() != Poco::Data::MetaColumn::FDT_BLOB) throw MySQLException("Extractor: not a blob"); - + val.assignRaw(_metadata.rawData(pos), _metadata.length(pos)); return true; } @@ -156,13 +154,13 @@ bool Extractor::extract(std::size_t pos, Poco::Data::CLOB& val) { if (_metadata.columnsReturned() <= pos) throw MySQLException("Extractor: attempt to extract more parameters, than query result contain"); - + if (_metadata.isNull(static_cast(pos))) return false; - + if (_metadata.metaColumn(static_cast(pos)).type() != Poco::Data::MetaColumn::FDT_BLOB) throw MySQLException("Extractor: not a blob"); - + val.assignRaw(reinterpret_cast(_metadata.rawData(pos)), _metadata.length(pos)); return true; } @@ -244,7 +242,7 @@ bool Extractor::realExtractFixed(std::size_t pos, enum_field_types type, void* b bind.buffer_type = type; bind.buffer = buffer; bind.is_unsigned = isUnsigned; - + if (!_stmt.fetchColumn(pos, &bind)) return false; @@ -273,8 +271,8 @@ bool Extractor::extract(std::size_t , std::list& ) { throw NotImplementedException("std::list extractor must be implemented."); } - - + + bool Extractor::extract(std::size_t , std::vector& ) { throw NotImplementedException("std::vector extractor must be implemented."); @@ -401,7 +399,6 @@ bool Extractor::extract(std::size_t , std::list& ) } -#ifndef POCO_LONG_IS_64_BIT bool Extractor::extract(std::size_t , std::vector& ) { throw NotImplementedException("std::vector extractor must be implemented."); @@ -418,7 +415,6 @@ bool Extractor::extract(std::size_t , std::list& ) { throw NotImplementedException("std::list extractor must be implemented."); } -#endif bool Extractor::extract(std::size_t , std::vector& ) diff --git a/Data/MySQL/testsuite/Makefile b/Data/MySQL/testsuite/Makefile index becfdbbaf..94345bc83 100644 --- a/Data/MySQL/testsuite/Makefile +++ b/Data/MySQL/testsuite/Makefile @@ -9,7 +9,7 @@ include $(POCO_BASE)/build/rules/global INCLUDE += -I./../include -I/usr/local/include/mysql -I/usr/include/mysql/ -I/usr/mysql/include/mysql -I/usr/local/mysql/include # Note: linking order is important, do not change it. -SYSLIBS += -L/usr/local/lib$(LIB64SUFFIX)/mysql -L/usr/lib$(LIB64SUFFIX)/mysql -L/usr/mysql/lib$(LIB64SUFFIX) -L/usr/mysql/lib$(LIB64SUFFIX)/mysql -L/usr/local/mysql/lib$(LIB64SUFFIX) -lmysqlclient -lz -lpthread -ldl +SYSLIBS += -L/usr/local/lib -L/usr/local/lib$(LIB64SUFFIX)/mysql -L/usr/lib$(LIB64SUFFIX)/mysql -L/usr/mysql/lib$(LIB64SUFFIX) -L/usr/mysql/lib$(LIB64SUFFIX)/mysql -L/usr/local/mysql/lib$(LIB64SUFFIX) -lmysqlclient -lz -lpthread -ldl objects = MySQLTestSuite Driver MySQLTest SQLExecutor diff --git a/Data/MySQL/testsuite/src/MySQLTest.cpp b/Data/MySQL/testsuite/src/MySQLTest.cpp index d9baab6e3..087d13bdb 100644 --- a/Data/MySQL/testsuite/src/MySQLTest.cpp +++ b/Data/MySQL/testsuite/src/MySQLTest.cpp @@ -42,11 +42,11 @@ Poco::SharedPtr MySQLTest::_pExecutor = 0; // // Parameters for barebone-test -#define MYSQL_USER "root" -#define MYSQL_PWD "poco" +#define MYSQL_USER "pocotest" +#define MYSQL_PWD "pocotest" #define MYSQL_HOST "127.0.0.1" #define MYSQL_PORT 3306 -#define MYSQL_DB "pocotestdb" +#define MYSQL_DB "pocotest" // // Connection string diff --git a/Data/SQLite/include/Poco/Data/SQLite/Binder.h b/Data/SQLite/include/Poco/Data/SQLite/Binder.h index 90618d606..75c514258 100644 --- a/Data/SQLite/include/Poco/Data/SQLite/Binder.h +++ b/Data/SQLite/include/Poco/Data/SQLite/Binder.h @@ -65,13 +65,11 @@ public: void bind(std::size_t pos, const Poco::UInt64 &val, Direction dir); /// Binds an UInt64. -#ifndef POCO_LONG_IS_64_BIT void bind(std::size_t pos, const long &val, Direction dir); /// Binds a long void bind(std::size_t pos, const unsigned long &val, Direction dir); /// Binds an unsigned long -#endif void bind(std::size_t pos, const bool &val, Direction dir); /// Binds a boolean. diff --git a/Data/SQLite/include/Poco/Data/SQLite/Extractor.h b/Data/SQLite/include/Poco/Data/SQLite/Extractor.h index 424cca48b..8ae1ccc27 100644 --- a/Data/SQLite/include/Poco/Data/SQLite/Extractor.h +++ b/Data/SQLite/include/Poco/Data/SQLite/Extractor.h @@ -78,13 +78,11 @@ public: bool extract(std::size_t pos, Poco::UInt64& val); /// Extracts an UInt64. -#ifndef POCO_LONG_IS_64_BIT bool extract(std::size_t pos, long& val); /// Extracts a long. bool extract(std::size_t pos, unsigned long& val); /// Extracts an unsigned long. -#endif bool extract(std::size_t pos, bool& val); /// Extracts a boolean. @@ -124,15 +122,15 @@ public: bool isNull(std::size_t pos, std::size_t row = POCO_DATA_INVALID_ROW); /// Returns true if the current row value at pos column is null. - /// Because of the loss of information about null-ness of the - /// underlying database values due to the nature of SQLite engine, - /// (once null value is converted to default value, SQLite API + /// Because of the loss of information about null-ness of the + /// underlying database values due to the nature of SQLite engine, + /// (once null value is converted to default value, SQLite API /// treats it as non-null), a null indicator container member - /// variable is used to cache the indicators of the underlying nulls - /// thus rendering this function idempotent. + /// variable is used to cache the indicators of the underlying nulls + /// thus rendering this function idempotent. /// The container is a vector of [bool, bool] pairs. /// The vector index corresponds to the column position, the first - /// bool value in the pair is true if the null indicator has + /// bool value in the pair is true if the null indicator has /// been set and the second bool value in the pair is true if /// the column is actually null. /// The row argument, needed for connectors with bulk capabilities, @@ -155,112 +153,112 @@ private: case MetaColumn::FDT_BOOL: { bool i = false; - ret = extract(pos, i); + ret = extract(pos, i); val = i; break; } case MetaColumn::FDT_INT8: { Poco::Int8 i = 0; - ret = extract(pos, i); + ret = extract(pos, i); val = i; break; } case MetaColumn::FDT_UINT8: { Poco::UInt8 i = 0; - ret = extract(pos, i); + ret = extract(pos, i); val = i; break; } case MetaColumn::FDT_INT16: { Poco::Int16 i = 0; - ret = extract(pos, i); + ret = extract(pos, i); val = i; break; } case MetaColumn::FDT_UINT16: { Poco::UInt16 i = 0; - ret = extract(pos, i); + ret = extract(pos, i); val = i; break; } case MetaColumn::FDT_INT32: { Poco::Int32 i = 0; - ret = extract(pos, i); + ret = extract(pos, i); val = i; break; } case MetaColumn::FDT_UINT32: { Poco::UInt32 i = 0; - ret = extract(pos, i); + ret = extract(pos, i); val = i; break; } case MetaColumn::FDT_INT64: { Poco::Int64 i = 0; - ret = extract(pos, i); + ret = extract(pos, i); val = i; break; } case MetaColumn::FDT_UINT64: { Poco::UInt64 i = 0; - ret = extract(pos, i); + ret = extract(pos, i); val = i; break; } case MetaColumn::FDT_STRING: { std::string s; - ret = extract(pos, s); + ret = extract(pos, s); val = s; break; } case MetaColumn::FDT_DOUBLE: { double d(0.0); - ret = extract(pos, d); + ret = extract(pos, d); val = d; break; } case MetaColumn::FDT_FLOAT: { float f(0.0); - ret = extract(pos, f); + ret = extract(pos, f); val = f; break; } case MetaColumn::FDT_BLOB: { BLOB b; - ret = extract(pos, b); + ret = extract(pos, b); val = b; break; } case MetaColumn::FDT_DATE: { Date d; - ret = extract(pos, d); + ret = extract(pos, d); val = d; break; } case MetaColumn::FDT_TIME: { Time t; - ret = extract(pos, t); + ret = extract(pos, t); val = t; break; } case MetaColumn::FDT_TIMESTAMP: { DateTime dt; - ret = extract(pos, dt); + ret = extract(pos, dt); val = dt; break; } diff --git a/Data/SQLite/src/Binder.cpp b/Data/SQLite/src/Binder.cpp index 02c882908..71e612661 100644 --- a/Data/SQLite/src/Binder.cpp +++ b/Data/SQLite/src/Binder.cpp @@ -56,7 +56,6 @@ void Binder::bind(std::size_t pos, const Poco::Int64 &val, Direction dir) } -#ifndef POCO_LONG_IS_64_BIT void Binder::bind(std::size_t pos, const long &val, Direction dir) { long tmp = static_cast(val); @@ -70,7 +69,6 @@ void Binder::bind(std::size_t pos, const unsigned long &val, Direction dir) int rc = sqlite3_bind_int(_pStmt, (int) pos, tmp); checkReturn(rc); } -#endif void Binder::bind(std::size_t pos, const double &val, Direction dir) diff --git a/Data/SQLite/src/Extractor.cpp b/Data/SQLite/src/Extractor.cpp index dc027ffca..3915ac1a3 100644 --- a/Data/SQLite/src/Extractor.cpp +++ b/Data/SQLite/src/Extractor.cpp @@ -63,7 +63,6 @@ bool Extractor::extract(std::size_t pos, Poco::Int64& val) } -#ifndef POCO_LONG_IS_64_BIT bool Extractor::extract(std::size_t pos, long& val) { if (isNull(pos)) return false; @@ -78,7 +77,6 @@ bool Extractor::extract(std::size_t pos, unsigned long& val) val = sqlite3_column_int(_pStmt, (int) pos); return true; } -#endif bool Extractor::extract(std::size_t pos, double& val) @@ -230,7 +228,7 @@ bool Extractor::isNull(std::size_t pos, std::size_t) _nulls[pos].first = true; _nulls[pos].second = (SQLITE_NULL == sqlite3_column_type(_pStmt, static_cast(pos))); } - + return _nulls[pos].second; } diff --git a/Data/include/Poco/Data/AbstractBinder.h b/Data/include/Poco/Data/AbstractBinder.h index 2f821213c..20c690b8e 100644 --- a/Data/include/Poco/Data/AbstractBinder.h +++ b/Data/include/Poco/Data/AbstractBinder.h @@ -140,7 +140,7 @@ public: virtual void bind(std::size_t pos, const std::list& val, Direction dir = PD_IN); /// Binds an UInt32 list. - + virtual void bind(std::size_t pos, const Poco::Int64& val, Direction dir = PD_IN) = 0; /// Binds an Int64. @@ -165,7 +165,6 @@ public: virtual void bind(std::size_t pos, const std::list& val, Direction dir = PD_IN); /// Binds an UInt64 list. -#ifndef POCO_LONG_IS_64_BIT virtual void bind(std::size_t pos, const long& val, Direction dir = PD_IN) = 0; /// Binds a long. @@ -180,7 +179,6 @@ public: virtual void bind(std::size_t pos, const std::list& val, Direction dir = PD_IN); /// Binds a long list. -#endif virtual void bind(std::size_t pos, const bool& val, Direction dir = PD_IN) = 0; /// Binds a boolean. @@ -331,7 +329,7 @@ public: void bind(std::size_t pos, const Any& val, Direction dir = PD_IN); /// Binds an Any. - + void bind(std::size_t pos, const Poco::Dynamic::Var& val, Direction dir = PD_IN); /// Binds a Var. diff --git a/Data/include/Poco/Data/AbstractExtractor.h b/Data/include/Poco/Data/AbstractExtractor.h index 1613fc5a2..9b4bf0a55 100644 --- a/Data/include/Poco/Data/AbstractExtractor.h +++ b/Data/include/Poco/Data/AbstractExtractor.h @@ -155,7 +155,6 @@ public: virtual bool extract(std::size_t pos, std::list& val); /// Extracts an UInt64 list. -#ifndef POCO_LONG_IS_64_BIT virtual bool extract(std::size_t pos, long& val) = 0; /// Extracts a long. Returns false if null was received. @@ -170,7 +169,6 @@ public: virtual bool extract(std::size_t pos, std::list& val); /// Extracts a long list. -#endif virtual bool extract(std::size_t pos, bool& val) = 0; /// Extracts a boolean. Returns false if null was received. diff --git a/Data/include/Poco/Data/AbstractPreparator.h b/Data/include/Poco/Data/AbstractPreparator.h index 1432bf8c3..433b78d21 100644 --- a/Data/include/Poco/Data/AbstractPreparator.h +++ b/Data/include/Poco/Data/AbstractPreparator.h @@ -51,9 +51,9 @@ class Data_API AbstractPreparator /// (and memory output locations) before extracting data, e.g. ODBC. /// Extract works as two-phase extract: first we call prepare once, then extract n-times. /// There are cases (bulk operations using std::vector storage) when extract is called only once. - /// The value passed to a prepare() call is not used by the prepare, serving only as an indication - /// of the data type being prepared, thus all values are passed as const references. - /// Implementing this interface is not mandatory for a connector. Connectors that only extract data + /// The value passed to a prepare() call is not used by the prepare, serving only as an indication + /// of the data type being prepared, thus all values are passed as const references. + /// Implementing this interface is not mandatory for a connector. Connectors that only extract data /// after SQL execution (e.g. SQLite) do not need this functionality at all. { public: @@ -161,7 +161,6 @@ public: virtual void prepare(std::size_t pos, const std::list& val); /// Prepares an UInt64 list. -#ifndef POCO_LONG_IS_64_BIT virtual void prepare(std::size_t pos, const long&) = 0; /// Prepares a long. @@ -176,7 +175,6 @@ public: virtual void prepare(std::size_t pos, const std::list& val); /// Prepares a long list. -#endif virtual void prepare(std::size_t pos, const bool&) = 0; /// Prepares a boolean. @@ -306,7 +304,7 @@ public: virtual void prepare(std::size_t pos, const std::deque