mirror of
https://github.com/pocoproject/poco.git
synced 2025-11-24 14:20:10 +01:00
data housekeeping
- removed naked pointers from Data interfaces - fixed GH #82: name conflict in Data::Keywords::bind - fixed GH #157: MySQL: cannot bind to 'long' data type on Windows/Visual C++ - fixed GH #158: MySQL: MYSQL_BIND 'is_unsigned' member is not set
This commit is contained in:
@@ -57,7 +57,7 @@ AbstractBinding::~AbstractBinding()
|
||||
}
|
||||
|
||||
|
||||
void AbstractBinding::setBinder(AbstractBinder* pBinder)
|
||||
void AbstractBinding::setBinder(BinderPtr pBinder)
|
||||
{
|
||||
poco_check_ptr (pBinder);
|
||||
_pBinder = pBinder;
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace Poco {
|
||||
namespace Data {
|
||||
|
||||
|
||||
AbstractPreparation::AbstractPreparation(AbstractPreparator* pPreparator):
|
||||
AbstractPreparation::AbstractPreparation(PreparatorPtr pPreparator):
|
||||
_pPreparator(pPreparator)
|
||||
{
|
||||
poco_assert_dbg (_pPreparator);
|
||||
|
||||
@@ -81,7 +81,7 @@ RecordSet::RecordSet(Session& rSession,
|
||||
|
||||
|
||||
RecordSet::RecordSet(const RecordSet& other):
|
||||
Statement(other.impl().duplicate()),
|
||||
Statement(other.impl()),
|
||||
_currentRow(other._currentRow),
|
||||
_pBegin(new RowIterator(this, 0 == rowsExtracted())),
|
||||
_pEnd(new RowIterator(this, true)),
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace Poco {
|
||||
namespace Data {
|
||||
|
||||
|
||||
Statement::Statement(StatementImpl* pImpl):
|
||||
Statement::Statement(StatementImpl::Ptr pImpl):
|
||||
_pImpl(pImpl),
|
||||
_async(false)
|
||||
{
|
||||
@@ -207,7 +207,7 @@ Statement& Statement::operator , (Manipulator manip)
|
||||
}
|
||||
|
||||
|
||||
Statement& Statement::addBind(AbstractBinding* pBind, bool duplicate)
|
||||
Statement& Statement::addBind(AbstractBinding::Ptr pBind)
|
||||
{
|
||||
if (pBind->isBulk())
|
||||
{
|
||||
@@ -221,13 +221,12 @@ Statement& Statement::addBind(AbstractBinding* pBind, bool duplicate)
|
||||
}
|
||||
else _pImpl->forbidBulk();
|
||||
|
||||
if (duplicate) pBind->duplicate();
|
||||
_pImpl->addBind(pBind);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
Statement& Statement::addExtract(AbstractExtraction* pExtract, bool duplicate)
|
||||
Statement& Statement::addExtract(AbstractExtraction::Ptr pExtract)
|
||||
{
|
||||
if (pExtract->isBulk())
|
||||
{
|
||||
@@ -244,7 +243,6 @@ Statement& Statement::addExtract(AbstractExtraction* pExtract, bool duplicate)
|
||||
}
|
||||
else _pImpl->forbidBulk();
|
||||
|
||||
if (duplicate) pExtract->duplicate();
|
||||
_pImpl->addExtract(pExtract);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -264,10 +264,9 @@ void StatementImpl::fixupExtraction()
|
||||
|
||||
Poco::Data::AbstractExtractionVec::iterator it = extractions().begin();
|
||||
Poco::Data::AbstractExtractionVec::iterator itEnd = extractions().end();
|
||||
AbstractExtractor& ex = extractor();
|
||||
for (; it != itEnd; ++it)
|
||||
{
|
||||
(*it)->setExtractor(&ex);
|
||||
(*it)->setExtractor(extractor());
|
||||
(*it)->setLimit(_extrLimit.value()),
|
||||
_columnsExtracted[_curDataSet] += (int)(*it)->numOfColumnsHandled();
|
||||
}
|
||||
@@ -279,8 +278,7 @@ void StatementImpl::fixupBinding()
|
||||
// no need to call binder().reset(); here will be called before each bind anyway
|
||||
AbstractBindingVec::iterator it = bindings().begin();
|
||||
AbstractBindingVec::iterator itEnd = bindings().end();
|
||||
AbstractBinder& bin = binder();
|
||||
for (; it != itEnd; ++it) (*it)->setBinder(&bin);
|
||||
for (; it != itEnd; ++it) (*it)->setBinder(binder());
|
||||
}
|
||||
|
||||
|
||||
@@ -395,7 +393,7 @@ std::size_t StatementImpl::activatePreviousDataSet()
|
||||
}
|
||||
|
||||
|
||||
void StatementImpl::addExtract(AbstractExtraction* pExtraction)
|
||||
void StatementImpl::addExtract(AbstractExtraction::Ptr pExtraction)
|
||||
{
|
||||
poco_check_ptr (pExtraction);
|
||||
std::size_t pos = pExtraction->position();
|
||||
|
||||
Reference in New Issue
Block a user