mirror of
https://github.com/pocoproject/poco.git
synced 2025-02-20 22:31:23 +01:00
use std::size_t in Data interfaces (may break some code on 64-bit platforms)
This commit is contained in:
parent
5b320c2894
commit
142c248754
@ -451,7 +451,7 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\Poco\Data\Prepare.h"
|
||||
RelativePath=".\include\Poco\data\Preparation.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
|
@ -238,7 +238,7 @@ public:
|
||||
|
||||
virtual void bind(std::size_t pos, const std::list<std::string>& val, Direction dir = PD_IN);
|
||||
|
||||
size_t size() const;
|
||||
std::size_t size() const;
|
||||
/// Return count of binded parameters
|
||||
|
||||
MYSQL_BIND* getBindArray() const;
|
||||
|
@ -336,7 +336,7 @@ public:
|
||||
|
||||
private:
|
||||
|
||||
bool realExtractFixed(std::size_t pos, enum_field_types type, void* buffer, size_t length = 0);
|
||||
bool realExtractFixed(std::size_t pos, enum_field_types type, void* buffer, std::size_t length = 0);
|
||||
|
||||
// Prevent VC8 warning "operator= could not be generated"
|
||||
Extractor& operator=(const Extractor&);
|
||||
|
@ -68,20 +68,20 @@ public:
|
||||
|
||||
protected:
|
||||
|
||||
virtual Poco::UInt32 columnsReturned() const;
|
||||
virtual std::size_t columnsReturned() const;
|
||||
/// Returns number of columns returned by query.
|
||||
|
||||
virtual Poco::UInt32 affectedRowCount() const;
|
||||
virtual std::size_t affectedRowCount() const;
|
||||
/// Returns the number of affected rows.
|
||||
/// Used to find out the number of rows affected by insert, delete or update.
|
||||
|
||||
virtual const MetaColumn& metaColumn(Poco::UInt32 pos) const;
|
||||
virtual const MetaColumn& metaColumn(std::size_t pos) const;
|
||||
/// Returns column meta data.
|
||||
|
||||
virtual bool hasNext();
|
||||
/// Returns true if a call to next() will return data.
|
||||
|
||||
virtual Poco::UInt32 next();
|
||||
virtual std::size_t next();
|
||||
/// Retrieves the next row from the resultset.
|
||||
/// Will throw, if the resultset is empty.
|
||||
|
||||
|
@ -43,6 +43,8 @@
|
||||
#include "Poco/Data/MySQL/MySQL.h"
|
||||
#include "Poco/Data/AbstractSessionImpl.h"
|
||||
#include "Poco/Data/MySQL/SessionHandle.h"
|
||||
#include "Poco/Data/MySQL/StatementExecutor.h"
|
||||
#include "Poco/Data/MySQL/ResultMetadata.h"
|
||||
#include "Poco/Mutex.h"
|
||||
|
||||
|
||||
|
@ -71,7 +71,7 @@ public:
|
||||
void prepare(const std::string& query);
|
||||
/// Prepares the statement for execution.
|
||||
|
||||
void bindParams(MYSQL_BIND* params, size_t count);
|
||||
void bindParams(MYSQL_BIND* params, std::size_t count);
|
||||
/// Binds the params.
|
||||
|
||||
void bindResult(MYSQL_BIND* result);
|
||||
@ -83,7 +83,7 @@ public:
|
||||
bool fetch();
|
||||
/// Fetches the data.
|
||||
|
||||
bool fetchColumn(size_t n, MYSQL_BIND *bind);
|
||||
bool fetchColumn(std::size_t n, MYSQL_BIND *bind);
|
||||
/// Fetches the column.
|
||||
|
||||
operator MYSQL_STMT* ();
|
||||
|
@ -226,9 +226,9 @@ void Binder::bind(std::size_t pos, const NullData&, Direction dir)
|
||||
}
|
||||
|
||||
|
||||
size_t Binder::size() const
|
||||
std::size_t Binder::size() const
|
||||
{
|
||||
return _bindArray.size();
|
||||
return static_cast<std::size_t>(_bindArray.size());
|
||||
}
|
||||
|
||||
|
||||
@ -245,7 +245,7 @@ MYSQL_BIND* Binder::getBindArray() const
|
||||
|
||||
/*void Binder::updateDates()
|
||||
{
|
||||
for (size_t i = 0; i < _dates.size(); i++)
|
||||
for (std::size_t i = 0; i < _dates.size(); i++)
|
||||
{
|
||||
switch (_dates[i].mt.time_type)
|
||||
{
|
||||
@ -282,7 +282,7 @@ void Binder::realBind(std::size_t pos, enum_field_types type, const void* buffer
|
||||
{
|
||||
if (pos >= _bindArray.size())
|
||||
{
|
||||
size_t s = _bindArray.size();
|
||||
std::size_t s = static_cast<std::size_t>(_bindArray.size());
|
||||
_bindArray.resize(pos + 1);
|
||||
|
||||
std::memset(&_bindArray[s], 0, sizeof(MYSQL_BIND) * (_bindArray.size() - s));
|
||||
|
@ -250,7 +250,7 @@ void Extractor::reset()
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::realExtractFixed(std::size_t pos, enum_field_types type, void* buffer, size_t length)
|
||||
bool Extractor::realExtractFixed(std::size_t pos, enum_field_types type, void* buffer, std::size_t length)
|
||||
{
|
||||
MYSQL_BIND bind = {0};
|
||||
my_bool isNull = 0;
|
||||
|
@ -55,19 +55,19 @@ MySQLStatementImpl::~MySQLStatementImpl()
|
||||
}
|
||||
|
||||
|
||||
Poco::UInt32 MySQLStatementImpl::columnsReturned() const
|
||||
std::size_t MySQLStatementImpl::columnsReturned() const
|
||||
{
|
||||
return _metadata.columnsReturned();
|
||||
}
|
||||
|
||||
|
||||
Poco::UInt32 MySQLStatementImpl::affectedRowCount() const
|
||||
std::size_t MySQLStatementImpl::affectedRowCount() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
const MetaColumn& MySQLStatementImpl::metaColumn(Poco::UInt32 pos) const
|
||||
const MetaColumn& MySQLStatementImpl::metaColumn(std::size_t pos) const
|
||||
{
|
||||
return _metadata.metaColumn(pos);
|
||||
}
|
||||
@ -100,7 +100,7 @@ bool MySQLStatementImpl::hasNext()
|
||||
}
|
||||
|
||||
|
||||
Poco::UInt32 MySQLStatementImpl::next()
|
||||
std::size_t MySQLStatementImpl::next()
|
||||
{
|
||||
if (!hasNext())
|
||||
throw StatementException("No data received");
|
||||
@ -151,7 +151,7 @@ void MySQLStatementImpl::compileImpl()
|
||||
void MySQLStatementImpl::bindImpl()
|
||||
{
|
||||
Poco::Data::AbstractBindingVec& binds = bindings();
|
||||
size_t pos = 0;
|
||||
std::size_t pos = 0;
|
||||
Poco::Data::AbstractBindingVec::iterator it = binds.begin();
|
||||
Poco::Data::AbstractBindingVec::iterator itEnd = binds.end();
|
||||
for (; it != itEnd && (*it)->canBind(); ++it)
|
||||
|
@ -67,7 +67,7 @@ namespace
|
||||
MYSQL_RES* h;
|
||||
};
|
||||
|
||||
size_t fieldSize(const MYSQL_FIELD& field)
|
||||
std::size_t fieldSize(const MYSQL_FIELD& field)
|
||||
/// Convert field MySQL-type and field MySQL-length to actual field length
|
||||
{
|
||||
switch (field.type)
|
||||
@ -171,13 +171,13 @@ void ResultMetadata::init(MYSQL_STMT* stmt)
|
||||
return;
|
||||
}
|
||||
|
||||
size_t count = mysql_num_fields(h);
|
||||
std::size_t count = mysql_num_fields(h);
|
||||
MYSQL_FIELD* fields = mysql_fetch_fields(h);
|
||||
|
||||
size_t commonSize = 0;
|
||||
std::size_t commonSize = 0;
|
||||
_columns.reserve(count);
|
||||
|
||||
{for (size_t i = 0; i < count; i++)
|
||||
{for (std::size_t i = 0; i < count; i++)
|
||||
{
|
||||
_columns.push_back(MetaColumn(
|
||||
i, // position
|
||||
@ -196,9 +196,9 @@ void ResultMetadata::init(MYSQL_STMT* stmt)
|
||||
_lengths.resize(count);
|
||||
_isNull.resize(count);
|
||||
|
||||
size_t offset = 0;
|
||||
std::size_t offset = 0;
|
||||
|
||||
{for (size_t i = 0; i < count; i++)
|
||||
{for (std::size_t i = 0; i < count; i++)
|
||||
{
|
||||
std::memset(&_row[i], 0, sizeof(MYSQL_BIND));
|
||||
|
||||
@ -227,17 +227,17 @@ MYSQL_BIND* ResultMetadata::row()
|
||||
return &_row[0];
|
||||
}
|
||||
|
||||
size_t ResultMetadata::length(size_t pos) const
|
||||
std::size_t ResultMetadata::length(std::size_t pos) const
|
||||
{
|
||||
return _lengths[pos];
|
||||
}
|
||||
|
||||
const unsigned char* ResultMetadata::rawData(size_t pos) const
|
||||
const unsigned char* ResultMetadata::rawData(std::size_t pos) const
|
||||
{
|
||||
return reinterpret_cast<const unsigned char*>(_row[pos].buffer);
|
||||
}
|
||||
|
||||
bool ResultMetadata::isNull(size_t pos) const
|
||||
bool ResultMetadata::isNull(std::size_t pos) const
|
||||
{
|
||||
return (_isNull[pos] != 0);
|
||||
}
|
||||
|
@ -36,7 +36,6 @@
|
||||
|
||||
#include "Poco/Data/MySQL/SessionImpl.h"
|
||||
#include "Poco/Data/MySQL/MySQLStatementImpl.h"
|
||||
#include "Poco/Data/MySQL/StatementExecutor.h"
|
||||
#include "Poco/Data/Session.h"
|
||||
#include "Poco/NumberParser.h"
|
||||
#include "Poco/String.h"
|
||||
|
@ -81,7 +81,7 @@ void StatementExecutor::prepare(const std::string& query)
|
||||
}
|
||||
|
||||
|
||||
void StatementExecutor::bindParams(MYSQL_BIND* params, size_t count)
|
||||
void StatementExecutor::bindParams(MYSQL_BIND* params, std::size_t count)
|
||||
{
|
||||
if (_state < STMT_COMPILED)
|
||||
throw StatementException("Satement is not compiled yet");
|
||||
@ -132,7 +132,7 @@ bool StatementExecutor::fetch()
|
||||
}
|
||||
|
||||
|
||||
bool StatementExecutor::fetchColumn(size_t n, MYSQL_BIND *bind)
|
||||
bool StatementExecutor::fetchColumn(std::size_t n, MYSQL_BIND *bind)
|
||||
{
|
||||
if (_state < STMT_EXECUTED)
|
||||
throw StatementException("Satement is not executed yet");
|
||||
|
@ -493,7 +493,7 @@ void MySQLTest::testSessionTransaction()
|
||||
{
|
||||
if (!_pSession) fail ("Test not available.");
|
||||
|
||||
recreatePersonBLOBTable();
|
||||
recreatePersonTable();
|
||||
_pExecutor->sessionTransaction(_dbConnString);
|
||||
}
|
||||
|
||||
@ -502,7 +502,7 @@ void MySQLTest::testTransaction()
|
||||
{
|
||||
if (!_pSession) fail ("Test not available.");
|
||||
|
||||
recreatePersonBLOBTable();
|
||||
recreatePersonTable();
|
||||
_pExecutor->transaction(_dbConnString);
|
||||
}
|
||||
|
||||
|
@ -1277,9 +1277,9 @@ void SQLExecutor::blob(int bigSize)
|
||||
|
||||
Poco::Data::CLOB big;
|
||||
std::vector<char> v(bigSize, 'x');
|
||||
big.assignRaw(&v[0], v.size());
|
||||
big.assignRaw(&v[0], (std::size_t) v.size());
|
||||
|
||||
assert (big.size() == (size_t)bigSize);
|
||||
assert (big.size() == (std::size_t) bigSize);
|
||||
|
||||
try { *_pSession << "DELETE FROM Person", now; }
|
||||
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
|
||||
@ -1359,7 +1359,7 @@ void SQLExecutor::tupleVector()
|
||||
try { *_pSession << "SELECT COUNT(*) FROM Tuples", into(count), now; }
|
||||
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
|
||||
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
|
||||
assert (v.size() == (size_t)count);
|
||||
assert (v.size() == (std::size_t) count);
|
||||
|
||||
std::vector<Tuple<int,int,int,int,int,int,int,int,int,int,int,int,int,int,int,int,int,int,int,int> > ret;
|
||||
try { *_pSession << "SELECT * FROM Tuples", into(ret), now; }
|
||||
|
@ -73,20 +73,20 @@ public:
|
||||
/// Destroys the ODBCStatementImpl.
|
||||
|
||||
protected:
|
||||
Poco::UInt32 columnsReturned() const;
|
||||
std::size_t columnsReturned() const;
|
||||
/// Returns number of columns returned by query.
|
||||
|
||||
Poco::UInt32 affectedRowCount() const;
|
||||
std::size_t affectedRowCount() const;
|
||||
/// Returns the number of affected rows.
|
||||
/// Used to find out the number of rows affected by insert or update.
|
||||
|
||||
const MetaColumn& metaColumn(Poco::UInt32 pos) const;
|
||||
const MetaColumn& metaColumn(std::size_t pos) const;
|
||||
/// Returns column meta data.
|
||||
|
||||
bool hasNext();
|
||||
/// Returns true if a call to next() will return data.
|
||||
|
||||
Poco::UInt32 next();
|
||||
std::size_t next();
|
||||
/// Retrieves the next row or set of rows from the resultset.
|
||||
/// Returns the number of rows retrieved.
|
||||
/// Will throw, if the resultset is empty.
|
||||
@ -173,7 +173,7 @@ private:
|
||||
int _nextResponse;
|
||||
ColumnPtrVecVec _columnPtrs;
|
||||
bool _prepared;
|
||||
mutable Poco::UInt32 _affectedRowCount;
|
||||
mutable std::size_t _affectedRowCount;
|
||||
bool _canCompile;
|
||||
};
|
||||
|
||||
@ -196,11 +196,11 @@ inline AbstractBinder& ODBCStatementImpl::binder()
|
||||
}
|
||||
|
||||
|
||||
inline Poco::UInt32 ODBCStatementImpl::columnsReturned() const
|
||||
inline std::size_t ODBCStatementImpl::columnsReturned() const
|
||||
{
|
||||
poco_assert_dbg (currentDataSet() < _preparations.size());
|
||||
poco_assert_dbg (_preparations[currentDataSet()]);
|
||||
return (Poco::UInt32) _preparations[currentDataSet()]->columns();
|
||||
return static_cast<std::size_t>(_preparations[currentDataSet()]->columns());
|
||||
}
|
||||
|
||||
|
||||
|
@ -47,7 +47,7 @@
|
||||
#include "Poco/Data/ODBC/Handle.h"
|
||||
#include "Poco/Data/ODBC/ODBCException.h"
|
||||
#include "Poco/Data/AbstractSessionImpl.h"
|
||||
#include "Poco/SharedPtr.h"
|
||||
#include "Poco/SharedPtr.h"
|
||||
#include "Poco/Mutex.h"
|
||||
#ifdef POCO_OS_FAMILY_WINDOWS
|
||||
#include <windows.h>
|
||||
@ -177,7 +177,7 @@ private:
|
||||
bool _autoExtract;
|
||||
TypeInfo _dataTypes;
|
||||
char _canTransact;
|
||||
bool _inTransaction;
|
||||
bool _inTransaction;
|
||||
Poco::FastMutex _mutex;
|
||||
};
|
||||
|
||||
|
@ -43,7 +43,7 @@
|
||||
|
||||
|
||||
#ifdef POCO_OS_FAMILY_WINDOWS
|
||||
#pragma warning(disable:4312)// 'type cast' : conversion from 'Poco::UInt32' to 'SQLPOINTER' of greater size
|
||||
#pragma warning(disable:4312)// 'type cast' : conversion from 'std::size_t' to 'SQLPOINTER' of greater size
|
||||
#endif
|
||||
|
||||
|
||||
@ -162,7 +162,7 @@ void ODBCStatementImpl::doPrepare()
|
||||
{
|
||||
if (session().getFeature("autoExtract") && hasData())
|
||||
{
|
||||
Poco::UInt32 curDataSet = currentDataSet();
|
||||
std::size_t curDataSet = currentDataSet();
|
||||
poco_check_ptr (_preparations[curDataSet]);
|
||||
|
||||
Extractions& extracts = extractions();
|
||||
@ -171,7 +171,7 @@ void ODBCStatementImpl::doPrepare()
|
||||
|
||||
if (it != itEnd && (*it)->isBulk())
|
||||
{
|
||||
Poco::UInt32 limit = getExtractionLimit();
|
||||
std::size_t limit = getExtractionLimit();
|
||||
if (limit == Limit::LIMIT_UNLIMITED)
|
||||
throw InvalidArgumentException("Bulk operation not allowed without limit.");
|
||||
checkError(Poco::Data::ODBC::SQLSetStmtAttr(_stmt, SQL_ATTR_ROW_ARRAY_SIZE, (SQLPOINTER) limit, 0),
|
||||
@ -210,7 +210,7 @@ void ODBCStatementImpl::doBind()
|
||||
Bindings::iterator itEnd = binds.end();
|
||||
|
||||
if (it != itEnd && 0 == _affectedRowCount)
|
||||
_affectedRowCount = static_cast<Poco::UInt32>((*it)->numOfRowsHandled());
|
||||
_affectedRowCount = static_cast<std::size_t>((*it)->numOfRowsHandled());
|
||||
|
||||
for (std::size_t pos = 0; it != itEnd && (*it)->canBind(); ++it)
|
||||
{
|
||||
@ -336,7 +336,7 @@ void ODBCStatementImpl::makeStep()
|
||||
}
|
||||
|
||||
|
||||
Poco::UInt32 ODBCStatementImpl::next()
|
||||
std::size_t ODBCStatementImpl::next()
|
||||
{
|
||||
std::size_t count = 0;
|
||||
|
||||
@ -359,12 +359,10 @@ Poco::UInt32 ODBCStatementImpl::next()
|
||||
else
|
||||
{
|
||||
throw StatementException(_stmt,
|
||||
std::string("Iterator Error: trying to access the next value"));
|
||||
std::string("Next row not available."));
|
||||
}
|
||||
|
||||
return static_cast<Poco::UInt32>(count);
|
||||
|
||||
return 0;
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
@ -419,8 +417,8 @@ void ODBCStatementImpl::checkError(SQLRETURN rc, const std::string& msg)
|
||||
|
||||
void ODBCStatementImpl::fillColumns()
|
||||
{
|
||||
Poco::UInt32 colCount = columnsReturned();
|
||||
Poco::UInt32 curDataSet = currentDataSet();
|
||||
std::size_t colCount = columnsReturned();
|
||||
std::size_t curDataSet = currentDataSet();
|
||||
if (curDataSet >= _columnPtrs.size())
|
||||
_columnPtrs.resize(curDataSet + 1);
|
||||
|
||||
@ -438,9 +436,9 @@ bool ODBCStatementImpl::isStoredProcedure() const
|
||||
}
|
||||
|
||||
|
||||
const MetaColumn& ODBCStatementImpl::metaColumn(Poco::UInt32 pos) const
|
||||
const MetaColumn& ODBCStatementImpl::metaColumn(std::size_t pos) const
|
||||
{
|
||||
Poco::UInt32 curDataSet = currentDataSet();
|
||||
std::size_t curDataSet = currentDataSet();
|
||||
poco_assert_dbg (curDataSet < _columnPtrs.size());
|
||||
|
||||
std::size_t sz = _columnPtrs[curDataSet].size();
|
||||
@ -452,13 +450,13 @@ const MetaColumn& ODBCStatementImpl::metaColumn(Poco::UInt32 pos) const
|
||||
}
|
||||
|
||||
|
||||
Poco::UInt32 ODBCStatementImpl::affectedRowCount() const
|
||||
std::size_t ODBCStatementImpl::affectedRowCount() const
|
||||
{
|
||||
if (0 == _affectedRowCount)
|
||||
{
|
||||
SQLLEN rows;
|
||||
if (!Utility::isError(SQLRowCount(_stmt, &rows)))
|
||||
_affectedRowCount = static_cast<Poco::UInt32>(rows);
|
||||
_affectedRowCount = static_cast<std::size_t>(rows);
|
||||
}
|
||||
|
||||
return _affectedRowCount;
|
||||
|
@ -3204,7 +3204,7 @@ void SQLExecutor::asynchronous(int rowCount)
|
||||
Statement stmt2 = (tmp << "SELECT * FROM Strings", into(data), async, limit(step));
|
||||
assert (data.size() == 0);
|
||||
assert (!stmt2.done());
|
||||
Statement::ResultType rows = 0;
|
||||
std::size_t rows = 0;
|
||||
|
||||
for (int i = 0; !stmt2.done(); i += step)
|
||||
{
|
||||
@ -3762,4 +3762,4 @@ void SQLExecutor::transactor()
|
||||
assert (0 == count);
|
||||
|
||||
session().setFeature("autoCommit", autoCommit);
|
||||
}
|
||||
}
|
||||
|
@ -68,10 +68,10 @@ public:
|
||||
/// Destroys the SQLiteStatementImpl.
|
||||
|
||||
protected:
|
||||
Poco::UInt32 columnsReturned() const;
|
||||
std::size_t columnsReturned() const;
|
||||
/// Returns number of columns returned by query.
|
||||
|
||||
Poco::UInt32 affectedRowCount() const;
|
||||
std::size_t affectedRowCount() const;
|
||||
/// Returns the number of affected rows.
|
||||
/// Used to find out the number of rows affected by insert, delete or update.
|
||||
/// All changes are counted, even if they are later undone by a ROLLBACK or ABORT.
|
||||
@ -82,13 +82,13 @@ protected:
|
||||
/// were originally in the table. To get an accurate count of the number of rows deleted,
|
||||
/// use "DELETE FROM table WHERE 1".
|
||||
|
||||
const MetaColumn& metaColumn(Poco::UInt32 pos) const;
|
||||
const MetaColumn& metaColumn(std::size_t pos) const;
|
||||
/// Returns column meta data.
|
||||
|
||||
bool hasNext();
|
||||
/// Returns true if a call to next() will return data.
|
||||
|
||||
Poco::UInt32 next();
|
||||
std::size_t next();
|
||||
/// Retrieves the next row from the resultset and returns 1.
|
||||
/// Will throw, if the resultset is empty.
|
||||
|
||||
@ -135,7 +135,7 @@ private:
|
||||
BinderPtr _pBinder;
|
||||
ExtractorPtr _pExtractor;
|
||||
MetaColumnVecVec _columns;
|
||||
Poco::UInt32 _affectedRowCount;
|
||||
std::size_t _affectedRowCount;
|
||||
StrPtr _pLeftover;
|
||||
BindIt _bindBegin;
|
||||
bool _canBind;
|
||||
|
@ -82,7 +82,7 @@ void Binder::bind(std::size_t pos, const Poco::Int64 &val, Direction dir)
|
||||
void Binder::bind(std::size_t pos, const long &val, Direction dir)
|
||||
{
|
||||
long tmp = static_cast<long>(val);
|
||||
int rc = sqlite3_bind_int(_pStmt, (int) pos, val);
|
||||
int rc = sqlite3_bind_int(_pStmt, (int) pos, tmp);
|
||||
checkReturn(rc);
|
||||
}
|
||||
#endif
|
||||
|
@ -142,7 +142,7 @@ void SQLiteStatementImpl::compileImpl()
|
||||
|
||||
if (colCount)
|
||||
{
|
||||
Poco::UInt32 curDataSet = currentDataSet();
|
||||
std::size_t curDataSet = currentDataSet();
|
||||
if (curDataSet >= _columns.size()) _columns.resize(curDataSet + 1);
|
||||
for (int i = 0; i < colCount; ++i)
|
||||
{
|
||||
@ -252,7 +252,7 @@ bool SQLiteStatementImpl::hasNext()
|
||||
}
|
||||
|
||||
|
||||
Poco::UInt32 SQLiteStatementImpl::next()
|
||||
std::size_t SQLiteStatementImpl::next()
|
||||
{
|
||||
if (SQLITE_ROW == _nextResponse)
|
||||
{
|
||||
@ -284,21 +284,21 @@ Poco::UInt32 SQLiteStatementImpl::next()
|
||||
}
|
||||
|
||||
|
||||
Poco::UInt32 SQLiteStatementImpl::columnsReturned() const
|
||||
std::size_t SQLiteStatementImpl::columnsReturned() const
|
||||
{
|
||||
return (Poco::UInt32) _columns[currentDataSet()].size();
|
||||
return (std::size_t) _columns[currentDataSet()].size();
|
||||
}
|
||||
|
||||
|
||||
const MetaColumn& SQLiteStatementImpl::metaColumn(Poco::UInt32 pos) const
|
||||
const MetaColumn& SQLiteStatementImpl::metaColumn(std::size_t pos) const
|
||||
{
|
||||
Poco::UInt32 curDataSet = currentDataSet();
|
||||
std::size_t curDataSet = currentDataSet();
|
||||
poco_assert (pos >= 0 && pos <= _columns[curDataSet].size());
|
||||
return _columns[curDataSet][pos];
|
||||
}
|
||||
|
||||
|
||||
Poco::UInt32 SQLiteStatementImpl::affectedRowCount() const
|
||||
std::size_t SQLiteStatementImpl::affectedRowCount() const
|
||||
{
|
||||
return _affectedRowCount ? _affectedRowCount : sqlite3_changes(_pDB);
|
||||
}
|
||||
|
@ -1997,7 +1997,7 @@ void SQLiteTest::testAsync()
|
||||
Statement stmt2 = (tmp << "SELECT * FROM Strings", into(data), async, limit(step));
|
||||
assert (data.size() == 0);
|
||||
assert (!stmt2.done());
|
||||
Statement::ResultType rows = 0;
|
||||
std::size_t rows = 0;
|
||||
|
||||
for (int i = 0; !stmt2.done(); i += step)
|
||||
{
|
||||
|
@ -337,7 +337,7 @@ public:
|
||||
|
||||
std::size_t numOfRowsHandled() const
|
||||
{
|
||||
return _val.size();
|
||||
return static_cast<std::size_t>(_val.size());
|
||||
}
|
||||
|
||||
bool canBind() const
|
||||
@ -481,7 +481,7 @@ public:
|
||||
|
||||
std::size_t numOfRowsHandled() const
|
||||
{
|
||||
return _val.size();
|
||||
return static_cast<std::size_t>(_val.size());
|
||||
}
|
||||
|
||||
bool canBind() const
|
||||
@ -558,7 +558,7 @@ public:
|
||||
|
||||
std::size_t numOfRowsHandled() const
|
||||
{
|
||||
return _deq.size();
|
||||
return static_cast<std::size_t>(_deq.size());
|
||||
}
|
||||
|
||||
bool canBind() const
|
||||
@ -873,7 +873,7 @@ public:
|
||||
|
||||
std::size_t numOfRowsHandled() const
|
||||
{
|
||||
return _val.size();
|
||||
return static_cast<std::size_t>(_val.size());
|
||||
}
|
||||
|
||||
bool canBind() const
|
||||
@ -1000,7 +1000,7 @@ public:
|
||||
|
||||
std::size_t numOfRowsHandled() const
|
||||
{
|
||||
return _val.size();
|
||||
return static_cast<std::size_t>(_val.size());
|
||||
}
|
||||
|
||||
bool canBind() const
|
||||
@ -1127,7 +1127,7 @@ public:
|
||||
|
||||
std::size_t numOfRowsHandled() const
|
||||
{
|
||||
return _val.size();
|
||||
return static_cast<std::size_t>(_val.size());
|
||||
}
|
||||
|
||||
bool canBind() const
|
||||
@ -1254,7 +1254,7 @@ public:
|
||||
|
||||
std::size_t numOfRowsHandled() const
|
||||
{
|
||||
return _val.size();
|
||||
return static_cast<std::size_t>(_val.size());
|
||||
}
|
||||
|
||||
bool canBind() const
|
||||
|
@ -176,7 +176,7 @@ public:
|
||||
|
||||
std::size_t numOfRowsHandled() const
|
||||
{
|
||||
return _rResult.size();
|
||||
return static_cast<std::size_t>(_rResult.size());
|
||||
}
|
||||
|
||||
std::size_t numOfRowsAllowed() const
|
||||
@ -255,7 +255,7 @@ public:
|
||||
|
||||
std::size_t numOfRowsHandled() const
|
||||
{
|
||||
return _rResult.size();
|
||||
return static_cast<std::size_t>(_rResult.size());
|
||||
}
|
||||
|
||||
std::size_t numOfRowsAllowed() const
|
||||
@ -560,7 +560,7 @@ public:
|
||||
|
||||
std::size_t numOfRowsHandled() const
|
||||
{
|
||||
return _rResult.size();
|
||||
return static_cast<std::size_t>(_rResult.size());
|
||||
}
|
||||
|
||||
std::size_t numOfRowsAllowed() const
|
||||
@ -619,7 +619,7 @@ public:
|
||||
|
||||
std::size_t numOfRowsHandled() const
|
||||
{
|
||||
return _rResult.size();
|
||||
return static_cast<std::size_t>(_rResult.size());
|
||||
}
|
||||
|
||||
std::size_t numOfRowsAllowed() const
|
||||
@ -678,7 +678,7 @@ public:
|
||||
|
||||
std::size_t numOfRowsHandled() const
|
||||
{
|
||||
return _rResult.size();
|
||||
return static_cast<std::size_t>(_rResult.size());
|
||||
}
|
||||
|
||||
std::size_t numOfRowsAllowed() const
|
||||
@ -737,7 +737,7 @@ public:
|
||||
|
||||
std::size_t numOfRowsHandled() const
|
||||
{
|
||||
return _rResult.size();
|
||||
return static_cast<std::size_t>(_rResult.size());
|
||||
}
|
||||
|
||||
std::size_t numOfRowsAllowed() const
|
||||
|
@ -193,7 +193,7 @@ public:
|
||||
std::size_t size() const
|
||||
/// Returns the size of the LOB in bytes.
|
||||
{
|
||||
return _pContent->size();
|
||||
return static_cast<std::size_t>(_pContent->size());
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -124,7 +124,7 @@ public:
|
||||
/// The number of rows reported is independent of filtering.
|
||||
|
||||
std::size_t columnCount() const;
|
||||
/// Returns the number of rows in the recordset.
|
||||
/// Returns the number of columns in the recordset.
|
||||
|
||||
template <class C>
|
||||
const Column<C>& column(const std::string& name) const
|
||||
@ -456,7 +456,7 @@ inline std::size_t RecordSet::totalRowCount() const
|
||||
|
||||
inline std::size_t RecordSet::columnCount() const
|
||||
{
|
||||
return extractions().size();
|
||||
return static_cast<std::size_t>(extractions().size());
|
||||
}
|
||||
|
||||
|
||||
|
@ -260,7 +260,7 @@ Data_API std::ostream& operator << (std::ostream &os, const Row& row);
|
||||
///
|
||||
inline std::size_t Row::fieldCount() const
|
||||
{
|
||||
return _values.size();
|
||||
return static_cast<std::size_t>(_values.size());
|
||||
}
|
||||
|
||||
|
||||
|
@ -83,8 +83,6 @@ class Data_API SQLChannel: public Poco::Channel
|
||||
/// a risk of long blocking periods in case of remote server communication delays.
|
||||
{
|
||||
public:
|
||||
typedef Statement::ResultType ResultType;
|
||||
|
||||
SQLChannel();
|
||||
/// Creates SQLChannel.
|
||||
|
||||
@ -145,7 +143,7 @@ public:
|
||||
std::string getProperty(const std::string& name) const;
|
||||
/// Returns the value of the property with the given name.
|
||||
|
||||
ResultType wait();
|
||||
std::size_t wait();
|
||||
/// Waits for the completion of the previous operation and returns
|
||||
/// the result. If chanel is in synchronous mode, returns 0 immediately.
|
||||
|
||||
@ -217,7 +215,7 @@ private:
|
||||
// inlines
|
||||
//
|
||||
|
||||
inline SQLChannel::ResultType SQLChannel::wait()
|
||||
inline std::size_t SQLChannel::wait()
|
||||
{
|
||||
if (_async && _pLogStatement)
|
||||
return _pLogStatement->wait(_timeout);
|
||||
|
@ -94,11 +94,10 @@ class Data_API Statement
|
||||
public:
|
||||
typedef void (*Manipulator)(Statement&);
|
||||
|
||||
typedef Poco::UInt32 ResultType;
|
||||
typedef ActiveResult<ResultType> Result;
|
||||
typedef SharedPtr<Result> ResultPtr;
|
||||
typedef ActiveMethod<ResultType, void, StatementImpl> AsyncExecMethod;
|
||||
typedef SharedPtr<AsyncExecMethod> AsyncExecMethodPtr;
|
||||
typedef ActiveResult<std::size_t> Result;
|
||||
typedef SharedPtr<Result> ResultPtr;
|
||||
typedef ActiveMethod<std::size_t, void, StatementImpl> AsyncExecMethod;
|
||||
typedef SharedPtr<AsyncExecMethod> AsyncExecMethodPtr;
|
||||
|
||||
static const int WAIT_FOREVER = -1;
|
||||
|
||||
@ -273,7 +272,7 @@ public:
|
||||
Statement& operator , (Poco::Int16 value);
|
||||
/// Adds the value to the list of values to be supplied to the SQL string formatting function.
|
||||
|
||||
Statement& operator , (Poco::UInt32 value);
|
||||
Statement& operator , (std::size_t value);
|
||||
/// Adds the value to the list of values to be supplied to the SQL string formatting function.
|
||||
|
||||
Statement& operator , (Poco::Int32 value);
|
||||
@ -310,7 +309,7 @@ public:
|
||||
const std::string& toString() const;
|
||||
/// Creates a string from the accumulated SQL statement.
|
||||
|
||||
ResultType execute();
|
||||
std::size_t execute();
|
||||
/// Executes the statement synchronously or asynchronously.
|
||||
/// Stops when either a limit is hit or the whole statement was executed.
|
||||
/// Returns the number of rows extracted from the database (for statements
|
||||
@ -337,7 +336,7 @@ public:
|
||||
bool isAsync() const;
|
||||
/// Returns true if statement was marked for asynchronous execution.
|
||||
|
||||
Statement::ResultType wait(long milliseconds = WAIT_FOREVER);
|
||||
std::size_t wait(long milliseconds = WAIT_FOREVER);
|
||||
/// Waits for the execution completion for asynchronous statements or
|
||||
/// returns immediately for synchronous ones. The return value for
|
||||
/// asynchronous statement is the execution result (i.e. number of
|
||||
@ -369,25 +368,25 @@ public:
|
||||
const std::string& getStorage() const;
|
||||
/// Returns the internal storage type for the stamement.
|
||||
|
||||
Poco::UInt32 columnsExtracted(int dataSet = StatementImpl::USE_CURRENT_DATA_SET) const;
|
||||
std::size_t columnsExtracted(int dataSet = StatementImpl::USE_CURRENT_DATA_SET) const;
|
||||
/// Returns the number of columns returned for current data set.
|
||||
/// Default value indicates current data set (if any).
|
||||
|
||||
Poco::UInt32 rowsExtracted(int dataSet = StatementImpl::USE_CURRENT_DATA_SET) const;
|
||||
std::size_t rowsExtracted(int dataSet = StatementImpl::USE_CURRENT_DATA_SET) const;
|
||||
/// Returns the number of rows returned for current data set.
|
||||
/// Default value indicates current data set (if any).
|
||||
|
||||
Poco::UInt32 extractionCount() const;
|
||||
std::size_t extractionCount() const;
|
||||
/// Returns the number of extraction storage buffers associated
|
||||
/// with the current data set.
|
||||
|
||||
Poco::UInt32 dataSetCount() const;
|
||||
std::size_t dataSetCount() const;
|
||||
/// Returns the number of data sets associated with the statement.
|
||||
|
||||
Poco::UInt32 nextDataSet();
|
||||
std::size_t nextDataSet();
|
||||
/// Returns the index of the next data set.
|
||||
|
||||
Poco::UInt32 previousDataSet();
|
||||
std::size_t previousDataSet();
|
||||
/// Returns the index of the previous data set.
|
||||
|
||||
bool hasMoreDataSets() const;
|
||||
@ -564,7 +563,7 @@ inline Statement& Statement::operator , (Poco::Int16 value)
|
||||
}
|
||||
|
||||
|
||||
inline Statement& Statement::operator , (Poco::UInt32 value)
|
||||
inline Statement& Statement::operator , (std::size_t value)
|
||||
{
|
||||
return commaPODImpl(value);
|
||||
}
|
||||
@ -687,7 +686,7 @@ inline const AbstractExtractionVec& Statement::extractions() const
|
||||
|
||||
inline const MetaColumn& Statement::metaColumn(std::size_t pos) const
|
||||
{
|
||||
return _pImpl->metaColumn(static_cast<UInt32>(pos));
|
||||
return _pImpl->metaColumn(pos);
|
||||
}
|
||||
|
||||
|
||||
@ -703,37 +702,37 @@ inline void Statement::setStorage(const std::string& storage)
|
||||
}
|
||||
|
||||
|
||||
inline Poco::UInt32 Statement::extractionCount() const
|
||||
inline std::size_t Statement::extractionCount() const
|
||||
{
|
||||
return _pImpl->extractionCount();
|
||||
}
|
||||
|
||||
|
||||
inline Poco::UInt32 Statement::columnsExtracted(int dataSet) const
|
||||
inline std::size_t Statement::columnsExtracted(int dataSet) const
|
||||
{
|
||||
return _pImpl->columnsExtracted(dataSet);
|
||||
}
|
||||
|
||||
|
||||
inline Poco::UInt32 Statement::rowsExtracted(int dataSet) const
|
||||
inline std::size_t Statement::rowsExtracted(int dataSet) const
|
||||
{
|
||||
return _pImpl->rowsExtracted(dataSet);
|
||||
}
|
||||
|
||||
|
||||
inline Poco::UInt32 Statement::dataSetCount() const
|
||||
inline std::size_t Statement::dataSetCount() const
|
||||
{
|
||||
return _pImpl->dataSetCount();
|
||||
}
|
||||
|
||||
|
||||
inline Poco::UInt32 Statement::nextDataSet()
|
||||
inline std::size_t Statement::nextDataSet()
|
||||
{
|
||||
return _pImpl->activateNextDataSet();
|
||||
}
|
||||
|
||||
|
||||
inline Poco::UInt32 Statement::previousDataSet()
|
||||
inline std::size_t Statement::previousDataSet()
|
||||
{
|
||||
return _pImpl->activatePreviousDataSet();
|
||||
}
|
||||
|
@ -144,7 +144,7 @@ public:
|
||||
std::string toString() const;
|
||||
/// Create a string version of the SQL statement.
|
||||
|
||||
Poco::UInt32 execute();
|
||||
std::size_t execute();
|
||||
/// Executes a statement. Returns the number of rows
|
||||
/// extracted for statements returning data or number of rows
|
||||
/// affected for all other statements (insert, update, delete).
|
||||
@ -164,22 +164,22 @@ public:
|
||||
Storage getStorage() const;
|
||||
/// Returns the storage type for this statement.
|
||||
|
||||
Poco::UInt32 extractionCount() const;
|
||||
std::size_t extractionCount() const;
|
||||
/// Returns the number of extraction storage buffers associated
|
||||
/// with the statement.
|
||||
|
||||
Poco::UInt32 dataSetCount() const;
|
||||
std::size_t dataSetCount() const;
|
||||
/// Returns the number of data sets associated with the statement.
|
||||
|
||||
protected:
|
||||
virtual Poco::UInt32 columnsReturned() const = 0;
|
||||
virtual std::size_t columnsReturned() const = 0;
|
||||
/// Returns number of columns returned by query.
|
||||
|
||||
virtual Poco::UInt32 affectedRowCount() const = 0;
|
||||
virtual std::size_t affectedRowCount() const = 0;
|
||||
/// Returns the number of affected rows.
|
||||
/// Used to find out the number of rows affected by insert, delete or update.
|
||||
|
||||
virtual const MetaColumn& metaColumn(Poco::UInt32 pos) const = 0;
|
||||
virtual const MetaColumn& metaColumn(std::size_t pos) const = 0;
|
||||
/// Returns column meta data.
|
||||
|
||||
const MetaColumn& metaColumn(const std::string& name) const;
|
||||
@ -192,7 +192,7 @@ protected:
|
||||
/// several consecutive calls to hasNext without data getting lost,
|
||||
/// ie. hasNext(); hasNext(); next() must be equal to hasNext(); next();
|
||||
|
||||
virtual Poco::UInt32 next() = 0;
|
||||
virtual std::size_t next() = 0;
|
||||
/// Retrieves the next row or set of rows from the resultset and
|
||||
/// returns the number of rows retreved.
|
||||
///
|
||||
@ -220,10 +220,10 @@ protected:
|
||||
virtual AbstractBinder& binder() = 0;
|
||||
/// Returns the concrete binder used by the statement.
|
||||
|
||||
Poco::UInt32 columnsExtracted(int dataSet = USE_CURRENT_DATA_SET) const;
|
||||
std::size_t columnsExtracted(int dataSet = USE_CURRENT_DATA_SET) const;
|
||||
/// Returns the number of columns that the extractors handle.
|
||||
|
||||
Poco::UInt32 rowsExtracted(int dataSet = USE_CURRENT_DATA_SET) const;
|
||||
std::size_t rowsExtracted(int dataSet = USE_CURRENT_DATA_SET) const;
|
||||
/// Returns the number of rows extracted for current data set.
|
||||
/// Default value (USE_CURRENT_DATA_SET) indicates current data set (if any).
|
||||
|
||||
@ -236,7 +236,7 @@ protected:
|
||||
AbstractExtractionVec& extractions();
|
||||
/// Returns the extractions vector.
|
||||
|
||||
void makeExtractors(Poco::UInt32 count);
|
||||
void makeExtractors(std::size_t count);
|
||||
/// Determines the type of the internal extraction container and
|
||||
/// calls the extraction creation function (addInternalExtract)
|
||||
/// with appropriate data type and container type arguments.
|
||||
@ -284,21 +284,21 @@ protected:
|
||||
void fixupExtraction();
|
||||
/// Sets the AbstractExtractor at the extractors.
|
||||
|
||||
Poco::UInt32 currentDataSet() const;
|
||||
std::size_t currentDataSet() const;
|
||||
/// Returns the current data set.
|
||||
|
||||
Poco::UInt32 activateNextDataSet();
|
||||
std::size_t activateNextDataSet();
|
||||
/// Returns the next data set index, or throws NoDataException if the last
|
||||
/// data set was reached.
|
||||
|
||||
Poco::UInt32 activatePreviousDataSet();
|
||||
std::size_t activatePreviousDataSet();
|
||||
/// Returns the previous data set index, or throws NoDataException if the last
|
||||
/// data set was reached.
|
||||
|
||||
bool hasMoreDataSets() const;
|
||||
/// Returns true if there are data sets not activated yet.
|
||||
|
||||
Poco::UInt32 getExtractionLimit();
|
||||
std::size_t getExtractionLimit();
|
||||
/// Returns the extraction limit value.
|
||||
|
||||
const Limit& extractionLimit() const;
|
||||
@ -311,12 +311,12 @@ private:
|
||||
void bind();
|
||||
/// Binds the statement, if not yet bound.
|
||||
|
||||
Poco::UInt32 executeWithLimit();
|
||||
std::size_t executeWithLimit();
|
||||
/// Executes with an upper limit set. Returns the number of rows
|
||||
/// extracted for statements returning data or number of rows
|
||||
/// affected for all other statements (insert, update, delete).
|
||||
|
||||
Poco::UInt32 executeWithoutLimit();
|
||||
std::size_t executeWithoutLimit();
|
||||
/// Executes without an upper limit set. Returns the number of rows
|
||||
/// extracted for statements returning data or number of rows
|
||||
/// affected for all other statements (insert, update, delete).
|
||||
@ -393,7 +393,7 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
bool isNull(Poco::UInt32 col, Poco::UInt32 row) const;
|
||||
bool isNull(std::size_t col, std::size_t row) const;
|
||||
/// Returns true if the value in [col, row] is null.
|
||||
|
||||
void forbidBulk();
|
||||
@ -435,14 +435,14 @@ private:
|
||||
|
||||
State _state;
|
||||
Limit _extrLimit;
|
||||
Poco::UInt32 _lowerLimit;
|
||||
std::size_t _lowerLimit;
|
||||
std::vector<int> _columnsExtracted;
|
||||
SessionImpl& _rSession;
|
||||
Storage _storage;
|
||||
std::ostringstream _ostr;
|
||||
AbstractBindingVec _bindings;
|
||||
AbstractExtractionVecVec _extractors;
|
||||
Poco::UInt32 _curDataSet;
|
||||
std::size_t _curDataSet;
|
||||
BulkType _bulkBinding;
|
||||
BulkType _bulkExtraction;
|
||||
|
||||
@ -516,15 +516,15 @@ inline StatementImpl::Storage StatementImpl::getStorage() const
|
||||
}
|
||||
|
||||
|
||||
inline Poco::UInt32 StatementImpl::extractionCount() const
|
||||
inline std::size_t StatementImpl::extractionCount() const
|
||||
{
|
||||
return extractions().size();
|
||||
return static_cast<std::size_t>(extractions().size());
|
||||
}
|
||||
|
||||
|
||||
inline Poco::UInt32 StatementImpl::dataSetCount() const
|
||||
inline std::size_t StatementImpl::dataSetCount() const
|
||||
{
|
||||
return _extractors.size();
|
||||
return static_cast<std::size_t>(_extractors.size());
|
||||
}
|
||||
|
||||
|
||||
@ -534,7 +534,7 @@ inline bool StatementImpl::isStoredProcedure() const
|
||||
}
|
||||
|
||||
|
||||
inline bool StatementImpl::isNull(Poco::UInt32 col, Poco::UInt32 row) const
|
||||
inline bool StatementImpl::isNull(std::size_t col, std::size_t row) const
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -546,13 +546,13 @@ inline bool StatementImpl::isNull(Poco::UInt32 col, Poco::UInt32 row) const
|
||||
}
|
||||
|
||||
|
||||
inline Poco::UInt32 StatementImpl::currentDataSet() const
|
||||
inline std::size_t StatementImpl::currentDataSet() const
|
||||
{
|
||||
return _curDataSet;
|
||||
}
|
||||
|
||||
|
||||
inline Poco::UInt32 StatementImpl::getExtractionLimit()
|
||||
inline std::size_t StatementImpl::getExtractionLimit()
|
||||
{
|
||||
return _extrLimit.value();
|
||||
}
|
||||
|
@ -142,7 +142,7 @@ public:
|
||||
|
||||
static std::size_t size()
|
||||
{
|
||||
return 1;
|
||||
return 1u;
|
||||
}
|
||||
|
||||
static void extract(std::size_t pos, T& obj, const T& defVal, AbstractExtractor* pExt)
|
||||
@ -176,7 +176,7 @@ public:
|
||||
|
||||
static std::size_t size()
|
||||
{
|
||||
return 1;
|
||||
return 1u;
|
||||
}
|
||||
|
||||
static void extract(std::size_t pos, std::deque<T>& obj, const T& defVal, AbstractExtractor* pExt)
|
||||
@ -211,7 +211,7 @@ public:
|
||||
|
||||
static std::size_t size()
|
||||
{
|
||||
return 1;
|
||||
return 1u;
|
||||
}
|
||||
|
||||
static void extract(std::size_t pos, std::vector<T>& obj, const T& defVal, AbstractExtractor* pExt)
|
||||
@ -246,7 +246,7 @@ public:
|
||||
|
||||
static std::size_t size()
|
||||
{
|
||||
return 1;
|
||||
return 1u;
|
||||
}
|
||||
|
||||
static void extract(std::size_t pos, std::list<T>& obj, const T& defVal, AbstractExtractor* pExt)
|
||||
@ -301,7 +301,7 @@ public:
|
||||
|
||||
static std::size_t size()
|
||||
{
|
||||
return 1;
|
||||
return 1u;
|
||||
}
|
||||
|
||||
static void extract(std::size_t pos, Nullable<T>& obj, const Nullable<T>& , AbstractExtractor* pExt)
|
||||
@ -409,7 +409,7 @@ public:
|
||||
|
||||
static std::size_t size()
|
||||
{
|
||||
return Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19>::length;
|
||||
return static_cast<std::size_t>(Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19>::length);
|
||||
}
|
||||
|
||||
static void extract(std::size_t pos, TupleRef tuple, TupleConstRef defVal, AbstractExtractor* pExt)
|
||||
@ -518,7 +518,7 @@ public:
|
||||
|
||||
static std::size_t size()
|
||||
{
|
||||
return Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18>::length;
|
||||
return static_cast<std::size_t>(Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18>::length);
|
||||
}
|
||||
|
||||
static void extract(std::size_t pos, TupleRef tuple, TupleConstRef defVal, AbstractExtractor* pExt)
|
||||
@ -623,7 +623,7 @@ public:
|
||||
|
||||
static std::size_t size()
|
||||
{
|
||||
return Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17>::length;
|
||||
return static_cast<std::size_t>(Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17>::length);
|
||||
}
|
||||
|
||||
static void extract(std::size_t pos, TupleRef tuple, TupleConstRef defVal, AbstractExtractor* pExt)
|
||||
@ -724,7 +724,7 @@ public:
|
||||
|
||||
static std::size_t size()
|
||||
{
|
||||
return Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16>::length;
|
||||
return static_cast<std::size_t>(Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16>::length);
|
||||
}
|
||||
|
||||
static void extract(std::size_t pos, TupleRef tuple, TupleConstRef defVal, AbstractExtractor* pExt)
|
||||
@ -821,7 +821,7 @@ public:
|
||||
|
||||
static std::size_t size()
|
||||
{
|
||||
return Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15>::length;
|
||||
return static_cast<std::size_t>(Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15>::length);
|
||||
}
|
||||
|
||||
static void extract(std::size_t pos, TupleRef tuple, TupleConstRef defVal, AbstractExtractor* pExt)
|
||||
@ -914,7 +914,7 @@ public:
|
||||
|
||||
static std::size_t size()
|
||||
{
|
||||
return Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14>::length;
|
||||
return static_cast<std::size_t>(Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14>::length);
|
||||
}
|
||||
|
||||
static void extract(std::size_t pos, TupleRef tuple, TupleConstRef defVal, AbstractExtractor* pExt)
|
||||
@ -1003,7 +1003,7 @@ public:
|
||||
|
||||
static std::size_t size()
|
||||
{
|
||||
return Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13>::length;
|
||||
return static_cast<std::size_t>(Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13>::length);
|
||||
}
|
||||
|
||||
static void extract(std::size_t pos, TupleRef tuple, TupleConstRef defVal, AbstractExtractor* pExt)
|
||||
@ -1088,7 +1088,7 @@ public:
|
||||
|
||||
static std::size_t size()
|
||||
{
|
||||
return Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12>::length;
|
||||
return static_cast<std::size_t>(Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12>::length);
|
||||
}
|
||||
|
||||
static void extract(std::size_t pos, TupleRef tuple, TupleConstRef defVal, AbstractExtractor* pExt)
|
||||
@ -1169,7 +1169,7 @@ public:
|
||||
|
||||
static std::size_t size()
|
||||
{
|
||||
return Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11>::length;
|
||||
return static_cast<std::size_t>(Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11>::length);
|
||||
}
|
||||
|
||||
static void extract(std::size_t pos, TupleRef tuple, TupleConstRef defVal, AbstractExtractor* pExt)
|
||||
@ -1246,7 +1246,7 @@ public:
|
||||
|
||||
static std::size_t size()
|
||||
{
|
||||
return Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10>::length;
|
||||
return static_cast<std::size_t>(Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10>::length);
|
||||
}
|
||||
|
||||
static void extract(std::size_t pos, TupleRef tuple, TupleConstRef defVal, AbstractExtractor* pExt)
|
||||
@ -1310,7 +1310,7 @@ public:
|
||||
|
||||
static std::size_t size()
|
||||
{
|
||||
return Poco::Tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>::length;
|
||||
return static_cast<std::size_t>(Poco::Tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>::length);
|
||||
}
|
||||
|
||||
static void extract(std::size_t pos, TupleRef tuple, TupleConstRef defVal, AbstractExtractor* pExt)
|
||||
@ -1371,7 +1371,7 @@ public:
|
||||
|
||||
static std::size_t size()
|
||||
{
|
||||
return Poco::Tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, NullTypeList>::length;
|
||||
return static_cast<std::size_t>(Poco::Tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, NullTypeList>::length);
|
||||
}
|
||||
|
||||
static void extract(std::size_t pos, TupleRef tuple, TupleConstRef defVal, AbstractExtractor* pExt)
|
||||
@ -1428,7 +1428,7 @@ public:
|
||||
|
||||
static std::size_t size()
|
||||
{
|
||||
return Poco::Tuple<T0, T1, T2, T3, T4, T5, T6, T7, NullTypeList>::length;
|
||||
return static_cast<std::size_t>(Poco::Tuple<T0, T1, T2, T3, T4, T5, T6, T7, NullTypeList>::length);
|
||||
}
|
||||
|
||||
static void extract(std::size_t pos, TupleRef tuple, TupleConstRef defVal, AbstractExtractor* pExt)
|
||||
@ -1483,7 +1483,7 @@ public:
|
||||
|
||||
static std::size_t size()
|
||||
{
|
||||
return Poco::Tuple<T0, T1, T2, T3, T4, T5, T6, NullTypeList>::length;
|
||||
return static_cast<std::size_t>(Poco::Tuple<T0, T1, T2, T3, T4, T5, T6, NullTypeList>::length);
|
||||
}
|
||||
|
||||
static void extract(std::size_t pos, TupleRef tuple, TupleConstRef defVal, AbstractExtractor* pExt)
|
||||
@ -1535,7 +1535,7 @@ public:
|
||||
|
||||
static std::size_t size()
|
||||
{
|
||||
return Poco::Tuple<T0, T1, T2, T3, T4, T5, NullTypeList>::length;
|
||||
return static_cast<std::size_t>(Poco::Tuple<T0, T1, T2, T3, T4, T5, NullTypeList>::length);
|
||||
}
|
||||
|
||||
static void extract(std::size_t pos, TupleRef tuple, TupleConstRef defVal, AbstractExtractor* pExt)
|
||||
@ -1584,7 +1584,7 @@ public:
|
||||
|
||||
static std::size_t size()
|
||||
{
|
||||
return Poco::Tuple<T0, T1, T2, T3, T4, NullTypeList>::length;
|
||||
return static_cast<std::size_t>(Poco::Tuple<T0, T1, T2, T3, T4, NullTypeList>::length);
|
||||
}
|
||||
|
||||
static void extract(std::size_t pos, TupleRef tuple, TupleConstRef defVal, AbstractExtractor* pExt)
|
||||
@ -1630,7 +1630,7 @@ public:
|
||||
|
||||
static std::size_t size()
|
||||
{
|
||||
return Poco::Tuple<T0, T1, T2, T3, NullTypeList>::length;
|
||||
return static_cast<std::size_t>(Poco::Tuple<T0, T1, T2, T3, NullTypeList>::length);
|
||||
}
|
||||
|
||||
static void extract(std::size_t pos, TupleRef tuple, TupleConstRef defVal, AbstractExtractor* pExt)
|
||||
@ -1673,7 +1673,7 @@ public:
|
||||
|
||||
static std::size_t size()
|
||||
{
|
||||
return Poco::Tuple<T0, T1, T2, NullTypeList>::length;
|
||||
return static_cast<std::size_t>(Poco::Tuple<T0, T1, T2, NullTypeList>::length);
|
||||
}
|
||||
|
||||
static void extract(std::size_t pos, TupleRef tuple, TupleConstRef defVal, AbstractExtractor* pExt)
|
||||
@ -1713,7 +1713,7 @@ public:
|
||||
|
||||
static std::size_t size()
|
||||
{
|
||||
return Poco::Tuple<T0, T1, NullTypeList>::length;
|
||||
return static_cast<std::size_t>(Poco::Tuple<T0, T1, NullTypeList>::length);
|
||||
}
|
||||
|
||||
static void extract(std::size_t pos, TupleRef tuple, TupleConstRef defVal, AbstractExtractor* pExt)
|
||||
@ -1750,7 +1750,7 @@ public:
|
||||
|
||||
static std::size_t size()
|
||||
{
|
||||
return Poco::Tuple<T0, NullTypeList>::length;
|
||||
return static_cast<std::size_t>(Poco::Tuple<T0, NullTypeList>::length);
|
||||
}
|
||||
|
||||
static void extract(std::size_t pos, TupleRef tuple, TupleConstRef defVal,
|
||||
@ -1780,7 +1780,7 @@ public:
|
||||
|
||||
static std::size_t size()
|
||||
{
|
||||
return TypeHandler<K>::size() + TypeHandler<V>::size();
|
||||
return static_cast<std::size_t>(TypeHandler<K>::size() + TypeHandler<V>::size());
|
||||
}
|
||||
|
||||
static void extract(std::size_t pos, std::pair<K, V>& obj, const std::pair<K, V>& defVal, AbstractExtractor* pExt)
|
||||
@ -1816,7 +1816,7 @@ public:
|
||||
|
||||
static std::size_t size()
|
||||
{
|
||||
return TypeHandler<T>::size();
|
||||
return static_cast<std::size_t>(TypeHandler<T>::size());
|
||||
}
|
||||
|
||||
static void extract(std::size_t pos, Poco::AutoPtr<T>& obj, const Poco::AutoPtr<T>& defVal, AbstractExtractor* pExt)
|
||||
@ -1858,7 +1858,7 @@ public:
|
||||
|
||||
static std::size_t size()
|
||||
{
|
||||
return TypeHandler<T>::size();
|
||||
return static_cast<std::size_t>(TypeHandler<T>::size());
|
||||
}
|
||||
|
||||
static void extract(std::size_t pos, Poco::SharedPtr<T>& obj, const Poco::SharedPtr<T>& defVal, AbstractExtractor* pExt)
|
||||
|
@ -120,7 +120,7 @@ void SQLChannel::logAsync(const Message& msg)
|
||||
{
|
||||
if (!_pSession || !_pSession->isConnected()) open();
|
||||
|
||||
Statement::ResultType ret = wait();
|
||||
std::size_t ret = wait();
|
||||
if (0 == ret && !_pLogStatement->done() && !_pLogStatement->initialized())
|
||||
{
|
||||
if (_throw)
|
||||
|
@ -109,7 +109,7 @@ Statement& Statement::reset(Session& session)
|
||||
}
|
||||
|
||||
|
||||
Statement::ResultType Statement::execute()
|
||||
std::size_t Statement::execute()
|
||||
{
|
||||
Mutex::ScopedLock lock(_mutex);
|
||||
bool isDone = done();
|
||||
@ -164,7 +164,7 @@ void Statement::setAsync(bool async)
|
||||
}
|
||||
|
||||
|
||||
Statement::ResultType Statement::wait(long milliseconds)
|
||||
std::size_t Statement::wait(long milliseconds)
|
||||
{
|
||||
if (!_pResult) return 0;
|
||||
|
||||
|
@ -65,7 +65,7 @@ const std::string StatementImpl::UNKNOWN = "unknown";
|
||||
|
||||
StatementImpl::StatementImpl(SessionImpl& rSession):
|
||||
_state(ST_INITIALIZED),
|
||||
_extrLimit(upperLimit((Poco::UInt32) Limit::LIMIT_UNLIMITED, false)),
|
||||
_extrLimit(upperLimit((std::size_t) Limit::LIMIT_UNLIMITED, false)),
|
||||
_lowerLimit(0),
|
||||
_rSession(rSession),
|
||||
_storage(STORAGE_UNKNOWN_IMPL),
|
||||
@ -84,10 +84,10 @@ StatementImpl::~StatementImpl()
|
||||
}
|
||||
|
||||
|
||||
Poco::UInt32 StatementImpl::execute()
|
||||
std::size_t StatementImpl::execute()
|
||||
{
|
||||
resetExtraction();
|
||||
Poco::UInt32 lim = 0;
|
||||
std::size_t lim = 0;
|
||||
if (_lowerLimit > _extrLimit.value())
|
||||
throw LimitException("Illegal Statement state. Upper limit must not be smaller than the lower limit.");
|
||||
|
||||
@ -110,11 +110,11 @@ Poco::UInt32 StatementImpl::execute()
|
||||
}
|
||||
|
||||
|
||||
Poco::UInt32 StatementImpl::executeWithLimit()
|
||||
std::size_t StatementImpl::executeWithLimit()
|
||||
{
|
||||
poco_assert (_state != ST_DONE);
|
||||
Poco::UInt32 count = 0;
|
||||
Poco::UInt32 limit = _extrLimit.value();
|
||||
std::size_t count = 0;
|
||||
std::size_t limit = _extrLimit.value();
|
||||
|
||||
do
|
||||
{
|
||||
@ -134,10 +134,10 @@ Poco::UInt32 StatementImpl::executeWithLimit()
|
||||
}
|
||||
|
||||
|
||||
Poco::UInt32 StatementImpl::executeWithoutLimit()
|
||||
std::size_t StatementImpl::executeWithoutLimit()
|
||||
{
|
||||
poco_assert (_state != ST_DONE);
|
||||
Poco::UInt32 count = 0;
|
||||
std::size_t count = 0;
|
||||
|
||||
do
|
||||
{
|
||||
@ -160,7 +160,7 @@ void StatementImpl::compile()
|
||||
|
||||
if (!extractions().size() && !isStoredProcedure())
|
||||
{
|
||||
Poco::UInt32 cols = columnsReturned();
|
||||
std::size_t cols = columnsReturned();
|
||||
if (cols) makeExtractors(cols);
|
||||
}
|
||||
|
||||
@ -207,7 +207,7 @@ void StatementImpl::setExtractionLimit(const Limit& extrLimit)
|
||||
|
||||
void StatementImpl::setBulkExtraction(const Bulk& b)
|
||||
{
|
||||
Poco::UInt32 limit = getExtractionLimit();
|
||||
std::size_t limit = getExtractionLimit();
|
||||
if (Limit::LIMIT_UNLIMITED != limit && b.size() != limit)
|
||||
throw InvalidArgumentException("Can not set limit for statement.");
|
||||
|
||||
@ -280,7 +280,7 @@ void StatementImpl::setStorage(const std::string& storage)
|
||||
}
|
||||
|
||||
|
||||
void StatementImpl::makeExtractors(Poco::UInt32 count)
|
||||
void StatementImpl::makeExtractors(std::size_t count)
|
||||
{
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
@ -328,8 +328,8 @@ void StatementImpl::makeExtractors(Poco::UInt32 count)
|
||||
|
||||
const MetaColumn& StatementImpl::metaColumn(const std::string& name) const
|
||||
{
|
||||
Poco::UInt32 cols = columnsReturned();
|
||||
for (Poco::UInt32 i = 0; i < cols; ++i)
|
||||
std::size_t cols = columnsReturned();
|
||||
for (std::size_t i = 0; i < cols; ++i)
|
||||
{
|
||||
const MetaColumn& column = metaColumn(i);
|
||||
if (0 == icompare(column.name(), name)) return column;
|
||||
@ -339,7 +339,7 @@ const MetaColumn& StatementImpl::metaColumn(const std::string& name) const
|
||||
}
|
||||
|
||||
|
||||
Poco::UInt32 StatementImpl::activateNextDataSet()
|
||||
std::size_t StatementImpl::activateNextDataSet()
|
||||
{
|
||||
if (_curDataSet + 1 < dataSetCount())
|
||||
return ++_curDataSet;
|
||||
@ -348,7 +348,7 @@ Poco::UInt32 StatementImpl::activateNextDataSet()
|
||||
}
|
||||
|
||||
|
||||
Poco::UInt32 StatementImpl::activatePreviousDataSet()
|
||||
std::size_t StatementImpl::activatePreviousDataSet()
|
||||
{
|
||||
if (_curDataSet > 0)
|
||||
return --_curDataSet;
|
||||
@ -360,7 +360,7 @@ Poco::UInt32 StatementImpl::activatePreviousDataSet()
|
||||
void StatementImpl::addExtract(AbstractExtraction* pExtraction)
|
||||
{
|
||||
poco_check_ptr (pExtraction);
|
||||
Poco::UInt32 pos = pExtraction->position();
|
||||
std::size_t pos = pExtraction->position();
|
||||
if (pos >= _extractors.size())
|
||||
_extractors.resize(pos + 1);
|
||||
|
||||
@ -394,7 +394,7 @@ void StatementImpl::removeBind(const std::string& name)
|
||||
}
|
||||
|
||||
|
||||
Poco::UInt32 StatementImpl::columnsExtracted(int dataSet) const
|
||||
std::size_t StatementImpl::columnsExtracted(int dataSet) const
|
||||
{
|
||||
if (USE_CURRENT_DATA_SET == dataSet) dataSet = _curDataSet;
|
||||
if (_columnsExtracted.size() > 0)
|
||||
@ -407,7 +407,7 @@ Poco::UInt32 StatementImpl::columnsExtracted(int dataSet) const
|
||||
}
|
||||
|
||||
|
||||
Poco::UInt32 StatementImpl::rowsExtracted(int dataSet) const
|
||||
std::size_t StatementImpl::rowsExtracted(int dataSet) const
|
||||
{
|
||||
if (USE_CURRENT_DATA_SET == dataSet) dataSet = _curDataSet;
|
||||
if (extractions().size() > 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user