Kaydet (Commit) bd09c6a0 authored tarafından Lionel Elie Mamane's avatar Lionel Elie Mamane

tdf#82591 ORowSetBase::getRow handles insert row correctly

and critically for this bug, modified row, too.

Change-Id: I11c418d8926cabe81fcdb65d7293a4283e566f7a
üst 078a9feb
......@@ -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
......
......@@ -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();
}
}
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment