summaryrefslogtreecommitdiffstats
path: root/connectivity/qa
diff options
context:
space:
mode:
authorTamas Bunth <tamas.bunth@collabora.co.uk>2018-12-10 10:43:14 +0100
committerTamás Bunth <btomi96@gmail.com>2018-12-14 11:19:58 +0100
commit44416a16f40167cf9a60ff6fc7990a07df4e7d7b (patch)
treec9c7489d618c784d960fa592c156ab05366aa222 /connectivity/qa
parenttdf#122042: It's two clipboards, actually (diff)
downloadcore-44416a16f40167cf9a60ff6fc7990a07df4e7d7b.tar.gz
core-44416a16f40167cf9a60ff6fc7990a07df4e7d7b.zip
mysqlc: Fix obtaining field information in rs
Result set field information should be stored correctly. It is queried from database on demand and stored locally. Change-Id: Ia62c62e6db32b45640b9fcd5f48c6249aecc41a2 Reviewed-on: https://gerrit.libreoffice.org/64861 Tested-by: Jenkins Reviewed-by: Tamás Bunth <btomi96@gmail.com>
Diffstat (limited to 'connectivity/qa')
-rw-r--r--connectivity/qa/connectivity/mysql/mysql.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/connectivity/qa/connectivity/mysql/mysql.cxx b/connectivity/qa/connectivity/mysql/mysql.cxx
index ee502ed286b7..f93885fb34d9 100644
--- a/connectivity/qa/connectivity/mysql/mysql.cxx
+++ b/connectivity/qa/connectivity/mysql/mysql.cxx
@@ -182,6 +182,7 @@ void MysqlTestDriver::testIntegerInsertAndQuery()
Reference<XResultSet> xResultSet = xStatement->executeQuery("SELECT id from myTestTable");
CPPUNIT_ASSERT_MESSAGE("result set cannot be instantiated after query", xResultSet.is());
Reference<XRow> xRow(xResultSet, UNO_QUERY);
+ Reference<XColumnLocate> xColumnLocate(xResultSet, UNO_QUERY);
CPPUNIT_ASSERT_MESSAGE("cannot extract row from result set!", xRow.is());
for (long i = 0; i < ROW_COUNT; ++i)
@@ -189,6 +190,7 @@ void MysqlTestDriver::testIntegerInsertAndQuery()
bool hasRow = xResultSet->next();
CPPUNIT_ASSERT_MESSAGE("not enough result after query", hasRow);
CPPUNIT_ASSERT_EQUAL(i, xRow->getLong(1)); // first and only column
+ CPPUNIT_ASSERT_EQUAL(i, xRow->getLong(xColumnLocate->findColumn("id"))); // test findColumn
}
CPPUNIT_ASSERT_MESSAGE("Cursor is not on last position.",
xResultSet->isLast()); // cursor is on last position