summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2015-05-30 14:25:54 +0200
committerLionel Elie Mamane <lionel@mamane.lu>2015-05-30 17:35:25 +0200
commitbd09c6a0ba4ab179e549812d456a1674ab3ae6e8 (patch)
treed641f97c0ae461bfd6e19e6ccad450352ac0897a
parent078a9feb1b6c0839cc9c9822584e8dfbc6d930bf (diff)
tdf#82591 ORowSetBase::getRow handles insert row correctly
and critically for this bug, modified row, too. Change-Id: I11c418d8926cabe81fcdb65d7293a4283e566f7a
-rw-r--r--dbaccess/qa/complex/dbaccess/RowSet.java21
-rw-r--r--dbaccess/source/core/api/RowSet.cxx11
-rw-r--r--dbaccess/source/core/api/RowSet.hxx1
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