mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-08-18 22:07:11 +02:00
Update POCO to 1.11.0
This commit is contained in:
18
vendor/POCO/Data/src/AbstractBinder.cpp
vendored
18
vendor/POCO/Data/src/AbstractBinder.cpp
vendored
@@ -404,6 +404,24 @@ void AbstractBinder::bind(std::size_t pos, const std::list<Time>& val, Direction
|
||||
}
|
||||
|
||||
|
||||
void AbstractBinder::bind(std::size_t pos, const std::vector<UUID>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException("std::vector binder must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractBinder::bind(std::size_t pos, const std::deque<UUID>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException("std::deque binder must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractBinder::bind(std::size_t pos, const std::list<UUID>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException("std::list binder must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractBinder::bind(std::size_t pos, const std::vector<NullData>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException("std::vector binder must be implemented.");
|
||||
|
18
vendor/POCO/Data/src/AbstractExtractor.cpp
vendored
18
vendor/POCO/Data/src/AbstractExtractor.cpp
vendored
@@ -398,6 +398,24 @@ bool AbstractExtractor::extract(std::size_t pos, std::list<Time>& val)
|
||||
}
|
||||
|
||||
|
||||
bool AbstractExtractor::extract(std::size_t pos, std::vector<UUID>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool AbstractExtractor::extract(std::size_t pos, std::deque<UUID>& val)
|
||||
{
|
||||
throw NotImplementedException("std::deque extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool AbstractExtractor::extract(std::size_t pos, std::list<UUID>& val)
|
||||
{
|
||||
throw NotImplementedException("std::list extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool AbstractExtractor::extract(std::size_t pos, std::vector<Any>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
|
18
vendor/POCO/Data/src/AbstractPreparator.cpp
vendored
18
vendor/POCO/Data/src/AbstractPreparator.cpp
vendored
@@ -399,6 +399,24 @@ void AbstractPreparator::prepare(std::size_t pos, const std::list<Time>& val)
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, const std::vector<UUID>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, const std::deque<UUID>& val)
|
||||
{
|
||||
throw NotImplementedException("std::deque preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, const std::list<UUID>& val)
|
||||
{
|
||||
throw NotImplementedException("std::list preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, const std::vector<Any>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector preparator must be implemented.");
|
||||
|
19
vendor/POCO/Data/src/RecordSet.cpp
vendored
19
vendor/POCO/Data/src/RecordSet.cpp
vendored
@@ -34,7 +34,7 @@ const std::size_t RecordSet::UNKNOWN_TOTAL_ROW_COUNT = std::numeric_limits<std::
|
||||
|
||||
|
||||
RecordSet::RecordSet(const Statement& rStatement,
|
||||
RowFormatter::Ptr pRowFormatter):
|
||||
RowFormatter::Ptr pRowFormatter):
|
||||
Statement(rStatement),
|
||||
_currentRow(0),
|
||||
_pBegin(new RowIterator(this, 0 == rowsExtracted())),
|
||||
@@ -45,9 +45,9 @@ RecordSet::RecordSet(const Statement& rStatement,
|
||||
}
|
||||
|
||||
|
||||
RecordSet::RecordSet(Session& rSession,
|
||||
const std::string& query,
|
||||
RowFormatter::Ptr pRowFormatter):
|
||||
RecordSet::RecordSet(Session& rSession,
|
||||
const std::string& query,
|
||||
RowFormatter::Ptr pRowFormatter):
|
||||
Statement((rSession << query, now)),
|
||||
_currentRow(0),
|
||||
_pBegin(new RowIterator(this, 0 == rowsExtracted())),
|
||||
@@ -119,7 +119,7 @@ void RecordSet::reset(const Statement& stmt)
|
||||
_pEnd = 0;
|
||||
_currentRow = 0;
|
||||
_totalRowCount = UNKNOWN_TOTAL_ROW_COUNT;
|
||||
|
||||
|
||||
RowMap::iterator it = _rowMap.begin();
|
||||
RowMap::iterator end = _rowMap.end();
|
||||
for (; it != end; ++it) delete it->second;
|
||||
@@ -159,6 +159,7 @@ Poco::Dynamic::Var RecordSet::value(std::size_t col, std::size_t row, bool useFi
|
||||
case MetaColumn::FDT_DATE: return value<Date>(col, row, useFilter);
|
||||
case MetaColumn::FDT_TIME: return value<Time>(col, row, useFilter);
|
||||
case MetaColumn::FDT_TIMESTAMP: return value<DateTime>(col, row);
|
||||
case MetaColumn::FDT_UUID: return value<UUID>(col, row);
|
||||
default:
|
||||
throw UnknownTypeException("Data type not supported.");
|
||||
}
|
||||
@@ -188,9 +189,11 @@ Poco::Dynamic::Var RecordSet::value(const std::string& name, std::size_t row, bo
|
||||
case MetaColumn::FDT_STRING: return value<std::string>(name, row, useFilter);
|
||||
case MetaColumn::FDT_WSTRING: return value<UTF16String>(name, row, useFilter);
|
||||
case MetaColumn::FDT_BLOB: return value<BLOB>(name, row, useFilter);
|
||||
case MetaColumn::FDT_CLOB: return value<CLOB>(name, row, useFilter);
|
||||
case MetaColumn::FDT_DATE: return value<Date>(name, row, useFilter);
|
||||
case MetaColumn::FDT_TIME: return value<Time>(name, row, useFilter);
|
||||
case MetaColumn::FDT_TIMESTAMP: return value<DateTime>(name, row, useFilter);
|
||||
case MetaColumn::FDT_UUID: return value<UUID>(name, row, useFilter);
|
||||
default:
|
||||
throw UnknownTypeException("Data type not supported.");
|
||||
}
|
||||
@@ -210,7 +213,7 @@ Row& RecordSet::row(std::size_t pos)
|
||||
{
|
||||
if (_rowMap.size())
|
||||
{
|
||||
//reuse first row column names and sorting fields to save some memory
|
||||
//reuse first row column names and sorting fields to save some memory
|
||||
pRow = new Row(_rowMap.begin()->second->names(),
|
||||
_rowMap.begin()->second->getSortMap(),
|
||||
getRowFormatter());
|
||||
@@ -218,7 +221,7 @@ Row& RecordSet::row(std::size_t pos)
|
||||
for (std::size_t col = 0; col < columns; ++col)
|
||||
pRow->set(col, value(col, pos));
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
pRow = new Row;
|
||||
pRow->setFormatter(getRowFormatter());
|
||||
@@ -228,7 +231,7 @@ Row& RecordSet::row(std::size_t pos)
|
||||
|
||||
_rowMap.insert(RowMap::value_type(pos, pRow));
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
pRow = it->second;
|
||||
poco_check_ptr (pRow);
|
||||
|
83
vendor/POCO/Data/src/SessionPool.cpp
vendored
83
vendor/POCO/Data/src/SessionPool.cpp
vendored
@@ -65,7 +65,7 @@ Session SessionPool::get()
|
||||
{
|
||||
Poco::Mutex::ScopedLock lock(_mutex);
|
||||
if (_shutdown) throw InvalidAccessException("Session pool has been shut down.");
|
||||
|
||||
|
||||
purgeDeadSessions();
|
||||
|
||||
if (_idleSessions.empty())
|
||||
@@ -85,7 +85,7 @@ Session SessionPool::get()
|
||||
|
||||
PooledSessionHolderPtr pHolder(_idleSessions.front());
|
||||
PooledSessionImplPtr pPSI(new PooledSessionImpl(pHolder));
|
||||
|
||||
|
||||
_activeSessions.push_front(pHolder);
|
||||
_idleSessions.pop_front();
|
||||
return Session(pPSI);
|
||||
@@ -115,14 +115,14 @@ int SessionPool::capacity() const
|
||||
return _maxSessions;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int SessionPool::used() const
|
||||
{
|
||||
Poco::Mutex::ScopedLock lock(_mutex);
|
||||
return (int) _activeSessions.size();
|
||||
}
|
||||
|
||||
|
||||
|
||||
int SessionPool::idle() const
|
||||
{
|
||||
Poco::Mutex::ScopedLock lock(_mutex);
|
||||
@@ -153,7 +153,7 @@ int SessionPool::allocated() const
|
||||
return _nSessions;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int SessionPool::available() const
|
||||
{
|
||||
if (_shutdown) return 0;
|
||||
@@ -233,28 +233,43 @@ void SessionPool::putBack(PooledSessionHolderPtr pHolder)
|
||||
SessionList::iterator it = std::find(_activeSessions.begin(), _activeSessions.end(), pHolder);
|
||||
if (it != _activeSessions.end())
|
||||
{
|
||||
if (pHolder->session()->isGood())
|
||||
try
|
||||
{
|
||||
pHolder->session()->reset();
|
||||
if (pHolder->session()->isGood())
|
||||
{
|
||||
pHolder->session()->reset();
|
||||
|
||||
// reverse settings applied at acquisition time, if any
|
||||
AddPropertyMap::iterator pIt = _addPropertyMap.find(pHolder->session());
|
||||
if (pIt != _addPropertyMap.end())
|
||||
pHolder->session()->setProperty(pIt->second.first, pIt->second.second);
|
||||
// reverse settings applied at acquisition time, if any
|
||||
AddPropertyMap::iterator pIt = _addPropertyMap.find(pHolder->session());
|
||||
if (pIt != _addPropertyMap.end())
|
||||
pHolder->session()->setProperty(pIt->second.first, pIt->second.second);
|
||||
|
||||
AddFeatureMap::iterator fIt = _addFeatureMap.find(pHolder->session());
|
||||
if (fIt != _addFeatureMap.end())
|
||||
pHolder->session()->setFeature(fIt->second.first, fIt->second.second);
|
||||
AddFeatureMap::iterator fIt = _addFeatureMap.find(pHolder->session());
|
||||
if (fIt != _addFeatureMap.end())
|
||||
pHolder->session()->setFeature(fIt->second.first, fIt->second.second);
|
||||
|
||||
// re-apply the default pool settings
|
||||
applySettings(pHolder->session());
|
||||
// re-apply the default pool settings
|
||||
applySettings(pHolder->session());
|
||||
|
||||
pHolder->access();
|
||||
_idleSessions.push_front(pHolder);
|
||||
pHolder->access();
|
||||
_idleSessions.push_front(pHolder);
|
||||
}
|
||||
else --_nSessions;
|
||||
|
||||
_activeSessions.erase(it);
|
||||
}
|
||||
catch (const Poco::Exception& e)
|
||||
{
|
||||
--_nSessions;
|
||||
_activeSessions.erase(it);
|
||||
poco_bugcheck_msg(format("Exception in SessionPool::putBack(): %s", e.displayText()).c_str());
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
--_nSessions;
|
||||
_activeSessions.erase(it);
|
||||
poco_bugcheck_msg("Unknown exception in SessionPool::putBack()");
|
||||
}
|
||||
else --_nSessions;
|
||||
|
||||
_activeSessions.erase(it);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -268,13 +283,18 @@ void SessionPool::onJanitorTimer(Poco::Timer&)
|
||||
Poco::Mutex::ScopedLock lock(_mutex);
|
||||
if (_shutdown) return;
|
||||
|
||||
SessionList::iterator it = _idleSessions.begin();
|
||||
SessionList::iterator it = _idleSessions.begin();
|
||||
while (_nSessions > _minSessions && it != _idleSessions.end())
|
||||
{
|
||||
if ((*it)->idle() > _idleTime || !(*it)->session()->isGood())
|
||||
{
|
||||
try { (*it)->session()->close(); }
|
||||
catch (...) { }
|
||||
{
|
||||
try
|
||||
{
|
||||
(*it)->session()->close();
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
}
|
||||
it = _idleSessions.erase(it);
|
||||
--_nSessions;
|
||||
}
|
||||
@@ -296,15 +316,20 @@ void SessionPool::shutdown()
|
||||
|
||||
void SessionPool::closeAll(SessionList& sessionList)
|
||||
{
|
||||
SessionList::iterator it = sessionList.begin();
|
||||
SessionList::iterator it = sessionList.begin();
|
||||
for (; it != sessionList.end();)
|
||||
{
|
||||
try { (*it)->session()->close(); }
|
||||
catch (...) { }
|
||||
try
|
||||
{
|
||||
(*it)->session()->close();
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
}
|
||||
it = sessionList.erase(it);
|
||||
if (_nSessions > 0) --_nSessions;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} } // namespace Poco::Data
|
||||
} } // namespace Poco::Data
|
48
vendor/POCO/Data/src/StatementImpl.cpp
vendored
48
vendor/POCO/Data/src/StatementImpl.cpp
vendored
@@ -131,15 +131,15 @@ std::size_t StatementImpl::executeWithLimit()
|
||||
do
|
||||
{
|
||||
bind();
|
||||
while (count < limit && hasNext())
|
||||
while (count < limit && hasNext())
|
||||
count += next();
|
||||
} while (count < limit && canBind());
|
||||
|
||||
if (!canBind() && (!hasNext() || limit == 0))
|
||||
if (!canBind() && (!hasNext() || limit == 0))
|
||||
_state = ST_DONE;
|
||||
else if (hasNext() && limit == count && _extrLimit.isHardLimit())
|
||||
throw LimitException("HardLimit reached (retrieved more data than requested).");
|
||||
else
|
||||
else
|
||||
_state = ST_PAUSED;
|
||||
|
||||
int affectedRows = affectedRowCount();
|
||||
@@ -177,8 +177,8 @@ std::size_t StatementImpl::executeWithoutLimit()
|
||||
|
||||
void StatementImpl::compile()
|
||||
{
|
||||
if (_state == ST_INITIALIZED ||
|
||||
_state == ST_RESET ||
|
||||
if (_state == ST_INITIALIZED ||
|
||||
_state == ST_RESET ||
|
||||
_state == ST_BOUND)
|
||||
{
|
||||
compileImpl();
|
||||
@@ -298,7 +298,7 @@ void StatementImpl::setStorage(const std::string& storage)
|
||||
if (0 == icompare(DEQUE, storage))
|
||||
_storage = STORAGE_DEQUE_IMPL;
|
||||
else if (0 == icompare(VECTOR, storage))
|
||||
_storage = STORAGE_VECTOR_IMPL;
|
||||
_storage = STORAGE_VECTOR_IMPL;
|
||||
else if (0 == icompare(LIST, storage))
|
||||
_storage = STORAGE_LIST_IMPL;
|
||||
else if (0 == icompare(UNKNOWN, storage))
|
||||
@@ -317,38 +317,42 @@ void StatementImpl::makeExtractors(std::size_t count)
|
||||
{
|
||||
case MetaColumn::FDT_BOOL:
|
||||
addInternalExtract<bool>(mc); break;
|
||||
case MetaColumn::FDT_INT8:
|
||||
case MetaColumn::FDT_INT8:
|
||||
addInternalExtract<Int8>(mc); break;
|
||||
case MetaColumn::FDT_UINT8:
|
||||
case MetaColumn::FDT_UINT8:
|
||||
addInternalExtract<UInt8>(mc); break;
|
||||
case MetaColumn::FDT_INT16:
|
||||
case MetaColumn::FDT_INT16:
|
||||
addInternalExtract<Int16>(mc); break;
|
||||
case MetaColumn::FDT_UINT16:
|
||||
case MetaColumn::FDT_UINT16:
|
||||
addInternalExtract<UInt16>(mc); break;
|
||||
case MetaColumn::FDT_INT32:
|
||||
case MetaColumn::FDT_INT32:
|
||||
addInternalExtract<Int32>(mc); break;
|
||||
case MetaColumn::FDT_UINT32:
|
||||
case MetaColumn::FDT_UINT32:
|
||||
addInternalExtract<UInt32>(mc); break;
|
||||
case MetaColumn::FDT_INT64:
|
||||
case MetaColumn::FDT_INT64:
|
||||
addInternalExtract<Int64>(mc); break;
|
||||
case MetaColumn::FDT_UINT64:
|
||||
case MetaColumn::FDT_UINT64:
|
||||
addInternalExtract<UInt64>(mc); break;
|
||||
case MetaColumn::FDT_FLOAT:
|
||||
case MetaColumn::FDT_FLOAT:
|
||||
addInternalExtract<float>(mc); break;
|
||||
case MetaColumn::FDT_DOUBLE:
|
||||
case MetaColumn::FDT_DOUBLE:
|
||||
addInternalExtract<double>(mc); break;
|
||||
case MetaColumn::FDT_STRING:
|
||||
case MetaColumn::FDT_STRING:
|
||||
addInternalExtract<std::string>(mc); break;
|
||||
case MetaColumn::FDT_WSTRING:
|
||||
addInternalExtract<Poco::UTF16String>(mc); break;
|
||||
case MetaColumn::FDT_BLOB:
|
||||
case MetaColumn::FDT_BLOB:
|
||||
addInternalExtract<BLOB>(mc); break;
|
||||
case MetaColumn::FDT_CLOB:
|
||||
addInternalExtract<CLOB>(mc); break;
|
||||
case MetaColumn::FDT_DATE:
|
||||
addInternalExtract<Date>(mc); break;
|
||||
case MetaColumn::FDT_TIME:
|
||||
addInternalExtract<Time>(mc); break;
|
||||
case MetaColumn::FDT_TIMESTAMP:
|
||||
addInternalExtract<DateTime>(mc); break;
|
||||
case MetaColumn::FDT_UUID:
|
||||
addInternalExtract<UUID>(mc); break;
|
||||
default:
|
||||
throw Poco::InvalidArgumentException("Data type not supported.");
|
||||
}
|
||||
@@ -391,7 +395,7 @@ void StatementImpl::addExtract(AbstractExtraction::Ptr pExtraction)
|
||||
{
|
||||
poco_check_ptr (pExtraction);
|
||||
std::size_t pos = pExtraction->position();
|
||||
if (pos >= _extractors.size())
|
||||
if (pos >= _extractors.size())
|
||||
_extractors.resize(pos + 1);
|
||||
|
||||
pExtraction->setEmptyStringIsNull(
|
||||
@@ -411,7 +415,7 @@ void StatementImpl::removeBind(const std::string& name)
|
||||
AbstractBindingVec::iterator it = _bindings.begin();
|
||||
for (; it != _bindings.end();)
|
||||
{
|
||||
if ((*it)->name() == name)
|
||||
if ((*it)->name() == name)
|
||||
{
|
||||
it = _bindings.erase(it);
|
||||
found = true;
|
||||
@@ -446,7 +450,7 @@ std::size_t StatementImpl::rowsExtracted(int dataSet) const
|
||||
if (_extractors[dataSet].size() > 0)
|
||||
return _extractors[dataSet][0]->numOfRowsHandled();
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -459,7 +463,7 @@ std::size_t StatementImpl::subTotalRowCount(int dataSet) const
|
||||
poco_assert (dataSet >= 0 && dataSet < _subTotalRowCount.size());
|
||||
return _subTotalRowCount[dataSet];
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user