diff options
Diffstat (limited to 'connectivity/source/drivers/file/FPreparedStatement.cxx')
-rw-r--r-- | connectivity/source/drivers/file/FPreparedStatement.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/connectivity/source/drivers/file/FPreparedStatement.cxx b/connectivity/source/drivers/file/FPreparedStatement.cxx index fb9b2c2e48ec..2d7db2fa5ff1 100644 --- a/connectivity/source/drivers/file/FPreparedStatement.cxx +++ b/connectivity/source/drivers/file/FPreparedStatement.cxx @@ -101,15 +101,16 @@ void OPreparedStatement::construct(const OUString& sql) throw(SQLException, Run Reference<XResultSet> OPreparedStatement::makeResultSet() { + closeResultSet(); + OResultSet *pResultSet = createResultSet(); Reference<XResultSet> xRS(pResultSet); initializeResultSet(pResultSet); initResultSet(pResultSet); + m_xResultSet = xRS; return xRS; } - - Any SAL_CALL OPreparedStatement::queryInterface( const Type & rType ) throw(RuntimeException, std::exception) { Any aRet = OStatement_BASE2::queryInterface(rType); @@ -145,6 +146,8 @@ void SAL_CALL OPreparedStatement::close( ) throw(SQLException, RuntimeException { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatement_BASE::rBHelper.bDisposed); + + closeResultSet(); } @@ -157,6 +160,7 @@ sal_Bool SAL_CALL OPreparedStatement::execute( ) throw(SQLException, RuntimeExc // since we don't support the XMultipleResults interface, nobody will ever get that ResultSet... Reference< XComponent > xComp(xRS, UNO_QUERY); + assert(xComp.is() || !xRS.is()); if (xComp.is()) xComp->dispose(); @@ -512,7 +516,6 @@ void OPreparedStatement::describeParameter() } } } - void OPreparedStatement::initializeResultSet(OResultSet* pRS) { OStatement_Base::initializeResultSet(pRS); |