summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2013-08-27 18:03:21 +0200
committerMiklos Vajna <vmiklos@suse.cz>2013-08-28 08:38:19 +0000
commitc337a441734a4d9ebf6f35df7d1aa206ad2adfbe (patch)
tree36ac41fb780f1e2854d85f133e7c242a5cbf9f2a
parentb17f6475d732f4123f4334cc02af18308c1d1256 (diff)
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 Reviewed-on: https://gerrit.libreoffice.org/5650 Reviewed-by: Miklos Vajna <vmiklos@suse.cz> Tested-by: Miklos Vajna <vmiklos@suse.cz>
-rw-r--r--connectivity/source/drivers/odbcbase/OResultSet.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/connectivity/source/drivers/odbcbase/OResultSet.cxx b/connectivity/source/drivers/odbcbase/OResultSet.cxx
index bac7e4d91914..81b2952e3357 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);