https://bugs.documentfoundation.org/show_bug.cgi?id=168145

            Bug ID: 168145
           Summary: Bookmarkable XResultSet must make positioned insert
                    correctly
           Product: LibreOffice
           Version: 3.3.0 release
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Base
          Assignee: [email protected]
          Reporter: [email protected]

Description:
If you use the XRowLocate interface with ResultSets and try to use positioned
inserts then you will notice if you look at what Base does during the insert
that it tries to get the cursor position while it is still on the insert row.

This can be seen in the code:

https://github.com/LibreOffice/core/blob/master/dbaccess/source/core/api/BookmarkSet.cxx#L87

where Base tries to get a bookmark while it is still on the insert row since
the call to the XResultSetUpdate.moveToInsertRow() method on line 78.


Normally, a call to XResultSetUpdate.moveToCurrentRow() should be made before
the bookmark call, or better still, positioning it on the last row of the
ResultSet with XResultSet.last() would allow the newly inserted row to be
obtained as a bookmark.

For now this Base behavior requires handling a call to XResultSet.getRow()
while the ResultSet is positioned on the insertion row which is normally not
supported by any driver.

The rule seems to be that to exit the insertion row, you must call at least one
of the methods that allows absolute positioning of the ResultSet cursor:
- XResultSetUpdate.moveToCurrentRow()
- XResultSet.first()
- XResultSet.last()
- XResultSet.beforefirst()
- XResultSet.afterlast()
- XResultSet.absolute()





Steps to Reproduce:
To reproduce this error, you need an underlying database driver that offers
ResultSets with the XRowLocate interface. The problem is that I don't know of
any driver other than jdbcDriverOOo that offers this.

Can anyone confirm this?


Actual Results:
Base tries to find out the position of the ResultSet cursor when it has just
positioned itself on the insertion line.

Expected Results:
Base should move out of the insertion row before trying to find the cursor
position of the ResultSet.


Reproducible: Always


User Profile Reset: No

Additional Info:
No

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to