summaryrefslogtreecommitdiff
path: root/connectivity/qa
diff options
context:
space:
mode:
authorTamas Bunth <tamas.bunth@collabora.co.uk>2018-11-08 18:48:54 +0100
committerTamás Bunth <btomi96@gmail.com>2018-11-09 21:52:23 +0100
commitdbe401ba4b51e0d3ac14e2a32bdf765832957152 (patch)
tree625107eb5f9fb25e6f16e39ceb8c5559890fee15 /connectivity/qa
parente95dae943fa2e7450185a792b1201834e6458725 (diff)
mysqlc: fix return value of XResultSet::next
Change-Id: I59e4803a5d9b01062eb0eaca0bf65d28298bd3e4 Reviewed-on: https://gerrit.libreoffice.org/63121 Tested-by: Jenkins Reviewed-by: Tamás Bunth <btomi96@gmail.com>
Diffstat (limited to 'connectivity/qa')
-rw-r--r--connectivity/qa/connectivity/mysql/mysql.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/connectivity/qa/connectivity/mysql/mysql.cxx b/connectivity/qa/connectivity/mysql/mysql.cxx
index 716a1219dee3..44488848b5d6 100644
--- a/connectivity/qa/connectivity/mysql/mysql.cxx
+++ b/connectivity/qa/connectivity/mysql/mysql.cxx
@@ -123,6 +123,7 @@ void MysqlTestDriver::testCreateAndDropTable()
uno::Reference<XStatement> xStatement = xConnection->createStatement();
CPPUNIT_ASSERT(xStatement.is());
+ xStatement->executeUpdate("DROP TABLE IF EXISTS myTestTable");
auto nUpdateCount
= xStatement->executeUpdate("CREATE TABLE myTestTable (id INTEGER PRIMARY KEY)");
@@ -143,6 +144,7 @@ void MysqlTestDriver::testIntegerInsertAndQuery()
Reference<XStatement> xStatement = xConnection->createStatement();
CPPUNIT_ASSERT(xStatement.is());
+ xStatement->executeUpdate("DROP TABLE IF EXISTS myTestTable");
auto nUpdateCount
= xStatement->executeUpdate("CREATE TABLE myTestTable (id INTEGER PRIMARY KEY)");
@@ -171,6 +173,9 @@ void MysqlTestDriver::testIntegerInsertAndQuery()
CPPUNIT_ASSERT_MESSAGE("not enough result after query", hasRow);
CPPUNIT_ASSERT_EQUAL(i, xRow->getLong(1)); // first and only column
}
+ bool hasRow = xResultSet->next();
+ // no more rows
+ CPPUNIT_ASSERT_MESSAGE("next returns true after last row", !hasRow);
nUpdateCount = xStatement->executeUpdate("DROP TABLE myTestTable");
CPPUNIT_ASSERT_EQUAL(0, nUpdateCount); // it's a DDL statement
@@ -186,6 +191,7 @@ void MysqlTestDriver::testDBPositionChange()
Reference<XStatement> xStatement = xConnection->createStatement();
CPPUNIT_ASSERT(xStatement.is());
+ xStatement->executeUpdate("DROP TABLE IF EXISTS myTestTable");
auto nUpdateCount
= xStatement->executeUpdate("CREATE TABLE myTestTable (id INTEGER PRIMARY KEY)");