From 2939a1fa638f63162f0a9741e139e9439144556b Mon Sep 17 00:00:00 2001 From: Lionel Elie Mamane Date: Tue, 27 Aug 2013 18:03:21 +0200 Subject: [PATCH] odbc insert: adjust buffer size *after* it is written to the buffer (aBookmark) is written to by SQLBulkOperations or SQLSetPos, not by SQLBindCol, which merely sets up the instruction that the next call should write there. So its finak size is known only *after* the call that makes the write, obviously. Change-Id: I4faaaeffc060433645188f0eda3d9958b087cf6c --- connectivity/source/drivers/odbcbase/OResultSet.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connectivity/source/drivers/odbcbase/OResultSet.cxx b/connectivity/source/drivers/odbcbase/OResultSet.cxx index d3969a1eeb4f..a35105e6a5b4 100644 --- a/connectivity/source/drivers/odbcbase/OResultSet.cxx +++ b/connectivity/source/drivers/odbcbase/OResultSet.cxx @@ -872,7 +872,6 @@ void SAL_CALL OResultSet::insertRow( ) throw(SQLException, RuntimeException) &nRealLen ); - aBookmark.realloc(nRealLen); sal_Bool bPositionByBookmark = ( NULL != getOdbcFunction( ODBC3SQLBulkOperations ) ); if ( bPositionByBookmark ) { @@ -886,6 +885,7 @@ void SAL_CALL OResultSet::insertRow( ) throw(SQLException, RuntimeException) nRet = N3SQLSetPos( m_aStatementHandle, 1, SQL_ADD, SQL_LOCK_NO_CHANGE ); fillNeededData( nRet ); } + aBookmark.realloc(nRealLen); try { OTools::ThrowException(m_pStatement->getOwnConnection(),nRet,m_aStatementHandle,SQL_HANDLE_STMT,*this);