diff options
author | Lionel Elie Mamane <lionel@mamane.lu> | 2015-05-30 14:25:54 +0200 |
---|---|---|
committer | Lionel Elie Mamane <lionel@mamane.lu> | 2015-05-30 17:32:48 +0200 |
commit | 8607f8b552d917f064b2ebfd60ffcef1e6f92bb0 (patch) | |
tree | e2e34f1817b0ede7605b983fc3bf0d0f6c1dc9b9 /dbaccess | |
parent | a819691ecc32586e800566d74ac22b474430d685 (diff) |
tdf#82591 ORowSetBase::getRow handles insert row correctly
and critically for this bug, modified row, too.
Change-Id: I11c418d8926cabe81fcdb65d7293a4283e566f7a
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/qa/complex/dbaccess/RowSet.java | 21 | ||||
-rw-r--r-- | dbaccess/source/core/api/RowSet.cxx | 11 | ||||
-rw-r--r-- | dbaccess/source/core/api/RowSet.hxx | 1 |
3 files changed, 22 insertions, 11 deletions
diff --git a/dbaccess/qa/complex/dbaccess/RowSet.java b/dbaccess/qa/complex/dbaccess/RowSet.java index ad0968a3d3eb..211aa2d3b571 100644 --- a/dbaccess/qa/complex/dbaccess/RowSet.java +++ b/dbaccess/qa/complex/dbaccess/RowSet.java @@ -207,6 +207,9 @@ public class RowSet extends TestCase // absolute positioning testAbsolutePositioning(m_resultSet, m_row); + // position during modify + testModifyPosition(m_resultSet, m_row); + // 3rd test test3(createClone(), m_resultSet); // 4th test @@ -289,6 +292,24 @@ public class RowSet extends TestCase } + void testModifyPosition(XResultSet _resultSet, XRow _row) + { + try + { + final int testPos = 3; + assertTrue("testModifyPosition wants at least " + (testPos+1) + " rows", MAX_FETCH_ROWS >= testPos+1); + assertTrue("testModifyPosition failed on moving to row " + testPos, _resultSet.absolute(testPos)); + UnoRuntime.queryInterface( XRowUpdate.class, _row ).updateString(2, TEST21); + testPosition(_resultSet, _row, testPos, "testModifyPosition"); + UnoRuntime.queryInterface( XResultSetUpdate.class, _resultSet ).cancelRowUpdates(); + } + catch (Exception e) + { + fail("testModifyPosition failed: " + e); + } + } + + void test3(XResultSet clone, XResultSet _resultSet) { try diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx index 69b357182380..619f5a71ea89 100644 --- a/dbaccess/source/core/api/RowSet.cxx +++ b/dbaccess/source/core/api/RowSet.cxx @@ -929,15 +929,6 @@ void SAL_CALL ORowSet::insertRow( ) throw(SQLException, RuntimeException, std:: fireRowcount(); } -sal_Int32 SAL_CALL ORowSet::getRow( ) throw(SQLException, RuntimeException, std::exception) -{ - ::osl::MutexGuard aGuard( *m_pMutex ); - checkCache(); - - // check if we are inserting a row - return (m_pCache && isInsertRow()) ? 0 : ORowSetBase::getRow(); -} - void SAL_CALL ORowSet::updateRow( ) throw(SQLException, RuntimeException, std::exception) { ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed); @@ -1517,7 +1508,7 @@ Reference< XIndexAccess > SAL_CALL ORowSet::getParameters( ) throw (RuntimeExce } catch( const Exception& ) { - // silence it + DBG_UNHANDLED_EXCEPTION(); } } diff --git a/dbaccess/source/core/api/RowSet.hxx b/dbaccess/source/core/api/RowSet.hxx index aae5b7f0a634..596969d98182 100644 --- a/dbaccess/source/core/api/RowSet.hxx +++ b/dbaccess/source/core/api/RowSet.hxx @@ -287,7 +287,6 @@ namespace dbaccess virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() SAL_OVERRIDE; // ::com::sun::star::sdbc::XResultSet - virtual sal_Int32 SAL_CALL getRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; virtual void SAL_CALL refreshRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; // XCompletedExecution |