diff options
author | Tamas Bunth <tamas.bunth@collabora.co.uk> | 2019-07-29 13:27:38 +0200 |
---|---|---|
committer | Tamás Bunth <btomi96@gmail.com> | 2019-07-29 22:33:38 +0200 |
commit | 41d3be4a48ea2abe019cd4f9b51bef703a2dc454 (patch) | |
tree | 1be3709a7209b4f24a73f489ade020091918f835 /connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.hxx | |
parent | sfx2: Re-enable the sidebars for LOK (diff) | |
download | core-41d3be4a48ea2abe019cd4f9b51bef703a2dc454.tar.gz core-41d3be4a48ea2abe019cd4f9b51bef703a2dc454.zip |
mysqlc: Fix query of cursor position in result set
Fix queries like "IsAfterLast" in result sets of prepared statements in
the mysql driver.
Cursor position is stored in the driver, since the mysql C driver does
not support the query of the cursor position.
The cursor position works the following way:
- 0 means the cursor is on "BeforeFirst". In that state calling of
getXXX() methods is user error.
- 1 means the first row is already fetched.
- n means the last fow is fetched, where n is the total number of rows
in the result set.
- Everything bigger than n is "AfterLast"
Change-Id: I131f2042606897019cc0f868dbc4151faf4850ac
Reviewed-on: https://gerrit.libreoffice.org/76549
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96@gmail.com>
Diffstat (limited to 'connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.hxx')
-rw-r--r-- | connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.hxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.hxx b/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.hxx index 5c8c231c44d8..4ff64d5b4320 100644 --- a/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.hxx +++ b/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.hxx @@ -70,8 +70,9 @@ class OPreparedResultSet final : public OBase_Mutex, MYSQL_FIELD* m_aFields; rtl_TextEncoding m_encoding; - sal_Int32 m_nCurrentField = 0; - sal_Int32 m_nFieldCount; + sal_Int32 m_nCurrentRow = 0; + sal_Int32 m_nColumnCount; + sal_Int32 m_nRowCount; // Use c style arrays, because we have to work with pointers // on these. @@ -96,6 +97,8 @@ class OPreparedResultSet final : public OBase_Mutex, template <typename T> T retrieveValue(const sal_Int32 nColumnIndex); connectivity::ORowSetValue getRowSetValue(sal_Int32 nColumnIndex); + bool fetchResult(); + // you can't delete objects of this type virtual ~OPreparedResultSet() override = default; |