mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-23 08:31:43 +02:00
minor Data fixes
This commit is contained in:
@@ -129,7 +129,7 @@ void ODBCStatementImpl::makeInternalExtractors()
|
|||||||
if (isStoredProcedure()) return;
|
if (isStoredProcedure()) return;
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
|
|
||||||
makeExtractors(columnsReturned());
|
makeExtractors(columnsReturned());
|
||||||
fixupExtraction();
|
fixupExtraction();
|
||||||
}
|
}
|
||||||
@@ -146,7 +146,7 @@ void ODBCStatementImpl::addPreparator()
|
|||||||
|
|
||||||
Preparator::DataExtraction ext = session().getFeature("autoExtract") ?
|
Preparator::DataExtraction ext = session().getFeature("autoExtract") ?
|
||||||
Preparator::DE_BOUND : Preparator::DE_MANUAL;
|
Preparator::DE_BOUND : Preparator::DE_MANUAL;
|
||||||
|
|
||||||
std::size_t maxFieldSize = AnyCast<std::size_t>(session().getProperty("maxFieldSize"));
|
std::size_t maxFieldSize = AnyCast<std::size_t>(session().getProperty("maxFieldSize"));
|
||||||
|
|
||||||
_preparations.push_back(new Preparator(_stmt, statement, maxFieldSize, ext));
|
_preparations.push_back(new Preparator(_stmt, statement, maxFieldSize, ext));
|
||||||
@@ -245,7 +245,7 @@ void ODBCStatementImpl::putData()
|
|||||||
if (pParam)
|
if (pParam)
|
||||||
{
|
{
|
||||||
dataSize = (SQLINTEGER) _pBinder->parameterSize(pParam);
|
dataSize = (SQLINTEGER) _pBinder->parameterSize(pParam);
|
||||||
|
|
||||||
if (Utility::isError(SQLPutData(_stmt, pParam, dataSize)))
|
if (Utility::isError(SQLPutData(_stmt, pParam, dataSize)))
|
||||||
throw StatementException(_stmt, "SQLPutData()");
|
throw StatementException(_stmt, "SQLPutData()");
|
||||||
}
|
}
|
||||||
@@ -273,17 +273,17 @@ void ODBCStatementImpl::clear()
|
|||||||
bool ignoreError = false;
|
bool ignoreError = false;
|
||||||
|
|
||||||
const StatementDiagnostics& diagnostics = err.diagnostics();
|
const StatementDiagnostics& diagnostics = err.diagnostics();
|
||||||
//ignore "Invalid cursor state" error
|
//ignore "Invalid cursor state" error
|
||||||
//(returned by 3.x drivers when cursor is not opened)
|
//(returned by 3.x drivers when cursor is not opened)
|
||||||
for (int i = 0; i < diagnostics.count(); ++i)
|
for (int i = 0; i < diagnostics.count(); ++i)
|
||||||
{
|
{
|
||||||
if (ignoreError =
|
if (ignoreError =
|
||||||
(INVALID_CURSOR_STATE == std::string(diagnostics.sqlState(i))))
|
(INVALID_CURSOR_STATE == std::string(diagnostics.sqlState(i))))
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ignoreError)
|
if (!ignoreError)
|
||||||
throw StatementException(_stmt, "SQLCloseCursor()");
|
throw StatementException(_stmt, "SQLCloseCursor()");
|
||||||
}
|
}
|
||||||
@@ -294,12 +294,12 @@ bool ODBCStatementImpl::hasNext()
|
|||||||
{
|
{
|
||||||
if (hasData())
|
if (hasData())
|
||||||
{
|
{
|
||||||
if (!extractions().size())
|
if (!extractions().size())
|
||||||
makeInternalExtractors();
|
makeInternalExtractors();
|
||||||
|
|
||||||
if (!_prepared) doPrepare();
|
if (!_prepared) doPrepare();
|
||||||
|
|
||||||
if (_stepCalled)
|
if (_stepCalled)
|
||||||
return _stepCalled = nextRowReady();
|
return _stepCalled = nextRowReady();
|
||||||
|
|
||||||
makeStep();
|
makeStep();
|
||||||
@@ -307,9 +307,9 @@ bool ODBCStatementImpl::hasNext()
|
|||||||
if (!nextRowReady())
|
if (!nextRowReady())
|
||||||
{
|
{
|
||||||
if (hasMoreDataSets()) activateNextDataSet();
|
if (hasMoreDataSets()) activateNextDataSet();
|
||||||
else return false;
|
else return false;
|
||||||
|
|
||||||
if (SQL_NO_DATA == SQLMoreResults(_stmt))
|
if (SQL_NO_DATA == SQLMoreResults(_stmt))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
addPreparator();
|
addPreparator();
|
||||||
|
@@ -8,6 +8,8 @@
|
|||||||
|
|
||||||
include $(POCO_BASE)/build/rules/global
|
include $(POCO_BASE)/build/rules/global
|
||||||
|
|
||||||
|
COMMONFLAGS += -I$(POCO_BASE)/Data/SQLite/src
|
||||||
|
|
||||||
SYSFLAGS += -DSQLITE_THREADSAFE=1 -DSQLITE_DISABLE_LFS \
|
SYSFLAGS += -DSQLITE_THREADSAFE=1 -DSQLITE_DISABLE_LFS \
|
||||||
-DSQLITE_OMIT_UTF16 -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_COMPLETE \
|
-DSQLITE_OMIT_UTF16 -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_COMPLETE \
|
||||||
-DSQLITE_OMIT_TCL_VARIABLE -DSQLITE_OMIT_DEPRECATED
|
-DSQLITE_OMIT_TCL_VARIABLE -DSQLITE_OMIT_DEPRECATED
|
||||||
|
@@ -280,8 +280,6 @@ void StatementImpl::fixupBinding()
|
|||||||
AbstractBindingVec::iterator it = bindings().begin();
|
AbstractBindingVec::iterator it = bindings().begin();
|
||||||
AbstractBindingVec::iterator itEnd = bindings().end();
|
AbstractBindingVec::iterator itEnd = bindings().end();
|
||||||
AbstractBinder& bin = binder();
|
AbstractBinder& bin = binder();
|
||||||
std::size_t numRows = 0;
|
|
||||||
if (it != itEnd) numRows = (*it)->numOfRowsHandled();
|
|
||||||
for (; it != itEnd; ++it) (*it)->setBinder(&bin);
|
for (; it != itEnd; ++it) (*it)->setBinder(&bin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user