[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - connectivity/source
Tamas Bunth (via logerrit)
logerrit at kemper.freedesktop.org
Wed Jul 31 12:27:41 UTC 2019
connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
New commits:
commit 8e106d00371a201d97c53240d34a346cbf9c0b09
Author: Tamas Bunth <tamas.bunth at collabora.co.uk>
AuthorDate: Tue Jul 30 15:05:35 2019 +0200
Commit: Tamás Bunth <btomi96 at gmail.com>
CommitDate: Wed Jul 31 14:27:05 2019 +0200
mysqlc: Support reading blob as string
Change-Id: I1ef0c3817bc255e7f0c38aca73c475b19d5d7d9b
Reviewed-on: https://gerrit.libreoffice.org/76600
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96 at gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/76734
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx b/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx
index 1faded9d64b9..dcaaf319265b 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx
@@ -314,7 +314,10 @@ template <> DateTime OPreparedResultSet::retrieveValue(sal_Int32 column)
template <> OUString OPreparedResultSet::retrieveValue(sal_Int32 column)
{
- if (getTypeFromMysqlType(m_aFields[column - 1].type) != std::type_index(typeid(OUString)))
+ // redirect call to the appropiate method if needed
+ // BLOB can be simply read out as string
+ if (getTypeFromMysqlType(m_aFields[column - 1].type) != std::type_index(typeid(OUString))
+ && m_aFields[column - 1].type != MYSQL_TYPE_BLOB)
return getRowSetValue(column);
const char* sStr = static_cast<const char*>(m_aData[column - 1].buffer);
@@ -352,6 +355,9 @@ ORowSetValue OPreparedResultSet::getRowSetValue(sal_Int32 nColumnIndex)
case MYSQL_TYPE_DECIMAL:
case MYSQL_TYPE_NEWDECIMAL:
return getString(nColumnIndex);
+ case MYSQL_TYPE_BLOB:
+ throw SQLException("Column with type BLOB cannot be converted", *this, OUString(), 1,
+ Any());
default:
SAL_WARN("connectivity.mysqlc", "OPreparedResultSet::getRowSetValue: unknown type: "
<< m_aFields[nColumnIndex - 1].type);
More information about the Libreoffice-commits
mailing list