diff options
author | Tamas Bunth <tamas.bunth@collabora.co.uk> | 2018-11-23 18:31:37 +0100 |
---|---|---|
committer | Tamás Bunth <btomi96@gmail.com> | 2018-11-24 23:15:51 +0100 |
commit | 878c36f829fd88cda95ca218a2cf03003f50e53d (patch) | |
tree | efe346e8d034efdbaa07f106db37c4bf6b811213 /connectivity/source | |
parent | da16857fe39ab94f5584ef62b1cd59686f98a5ef (diff) |
mysqlc: next() should move cursor from Last
XResultSet::next() should move cursor when called while cursor is on the
last position. It is not documented, but older versions of the mysqlc
extension are implemented that way. The cursor goes to the so called
afterlast position.
Even so, the next() call on the last position should return false.
Change-Id: I0fd145c920077151364a6a8c12e05290496b99c8
Reviewed-on: https://gerrit.libreoffice.org/63895
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
Diffstat (limited to 'connectivity/source')
-rw-r--r-- | connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx b/connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx index f0f83e42c3a7..5ee7aa943206 100644 --- a/connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx +++ b/connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx @@ -691,8 +691,14 @@ sal_Bool SAL_CALL OResultSet::next() MutexGuard aGuard(m_aMutex); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); ensureResultFetched(); - if (m_nRowPosition + 1 >= m_nRowCount) + if (m_nRowPosition + 1 > m_nRowCount) // afterlast return false; + if (m_nRowPosition + 1 == m_nRowCount) // last + { + // return false but take it to afterlast anyway + ++m_nRowPosition; + return false; + } ++m_nRowPosition; return true; } |