summaryrefslogtreecommitdiffstats
path: root/connectivity/source/drivers/odbcbase/OStatement.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'connectivity/source/drivers/odbcbase/OStatement.cxx')
-rw-r--r--connectivity/source/drivers/odbcbase/OStatement.cxx14
1 files changed, 8 insertions, 6 deletions
diff --git a/connectivity/source/drivers/odbcbase/OStatement.cxx b/connectivity/source/drivers/odbcbase/OStatement.cxx
index dee89e50f280..998dc6f01d53 100644
--- a/connectivity/source/drivers/odbcbase/OStatement.cxx
+++ b/connectivity/source/drivers/odbcbase/OStatement.cxx
@@ -877,13 +877,15 @@ void OStatement_Base::setFetchDirection(sal_Int32 _par0)
void OStatement_Base::setFetchSize(sal_Int32 _par0)
{
OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
+ OSL_ENSURE(_par0>0,"Illegal fetch size!");
+ if ( _par0 > 0 )
+ {
+ SQLRETURN nRetCode = N3SQLSetStmtAttr(m_aStatementHandle,SQL_ATTR_ROW_ARRAY_SIZE,(SQLPOINTER)(sal_IntPtr)_par0,SQL_IS_UINTEGER);
- SQLRETURN nRetCode = N3SQLSetStmtAttr(m_aStatementHandle,SQL_ATTR_ROW_ARRAY_SIZE,(SQLPOINTER)(sal_IntPtr)_par0,SQL_IS_UINTEGER);
-
- delete m_pRowStatusArray;
- m_pRowStatusArray = new SQLUSMALLINT[_par0];
- nRetCode = N3SQLSetStmtAttr(m_aStatementHandle,SQL_ATTR_ROW_STATUS_PTR,m_pRowStatusArray,SQL_IS_POINTER);
- OSL_UNUSED( nRetCode );
+ delete m_pRowStatusArray;
+ m_pRowStatusArray = new SQLUSMALLINT[_par0];
+ nRetCode = N3SQLSetStmtAttr(m_aStatementHandle,SQL_ATTR_ROW_STATUS_PTR,m_pRowStatusArray,SQL_IS_POINTER);
+ }
}
//------------------------------------------------------------------------------
void OStatement_Base::setMaxFieldSize(sal_Int32 _par0)