summaryrefslogtreecommitdiffstats
path: root/connectivity/source
diff options
context:
space:
mode:
authorTamas Bunth <tamas.bunth@collabora.co.uk>2018-09-11 17:14:49 +0200
committerTamás Bunth <btomi96@gmail.com>2018-09-13 16:19:05 +0200
commitb3e81068734a33878e7a638138100fd8d722c2dc (patch)
tree867d9503aced26ccdf2292a4c5f39cf7f8222c7c /connectivity/source
parentloplugin:constfields in writerfilter (diff)
downloadcore-b3e81068734a33878e7a638138100fd8d722c2dc.tar.gz
core-b3e81068734a33878e7a638138100fd8d722c2dc.zip
mysqlc: Fix XResultSet::absolute and previous
We need to update the actual row position after using absolute or previous. Change-Id: Ie85f9679b7a06649a88ac8ee08436bf7f4a58a22 Reviewed-on: https://gerrit.libreoffice.org/60328 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.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx b/connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx
index 6109849e2a20..3a6e063d7dbf 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx
@@ -628,6 +628,7 @@ sal_Bool SAL_CALL OResultSet::absolute(sal_Int32 row)
if (nToGo < 0)
nToGo = 0;
+ m_nRowPosition = nToGo;
mysql_data_seek(m_pResult, nToGo);
next();
@@ -648,6 +649,7 @@ sal_Bool SAL_CALL OResultSet::relative(sal_Int32 row)
if (nToGo < 0)
nToGo = 0;
+ m_nRowPosition = nToGo;
mysql_data_seek(m_pResult, nToGo);
next();
@@ -662,7 +664,8 @@ sal_Bool SAL_CALL OResultSet::previous()
if (m_nRowPosition <= 1)
return false;
- mysql_data_seek(m_pResult, m_nRowPosition - 2);
+ m_nRowPosition -= 2;
+ mysql_data_seek(m_pResult, m_nRowPosition);
next();
return true;
}