summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorTamas Bunth <tamas.bunth@collabora.co.uk>2018-09-11 17:14:49 +0200
committerAndras Timar <andras.timar@collabora.com>2018-09-11 18:40:04 +0200
commit7bbb8191f12f3c3413387be03f9cdf45b5b49735 (patch)
treed26f53dbe39dd6f1e93864f2e656dbdb443b62ef /connectivity
parente1d072bd7a829d9e81a012ba053ef43a8e135e86 (diff)
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/60329 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'connectivity')
-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 407e927527af..61b8d43fb653 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;
}