[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - 2 commits - connectivity/source
Tamas Bunth (via logerrit)
logerrit at kemper.freedesktop.org
Fri Aug 2 14:51:10 UTC 2019
connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx | 13 ++++++----
connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.hxx | 4 +--
2 files changed, 11 insertions(+), 6 deletions(-)
New commits:
commit 52a396d4a676021d595bde0af3bd7f3254193ea8
Author: Tamas Bunth <tamas.bunth at collabora.co.uk>
AuthorDate: Thu May 30 18:34:03 2019 +0200
Commit: Tamás Bunth <btomi96 at gmail.com>
CommitDate: Fri Aug 2 16:50:37 2019 +0200
mysqlc: Add support for mysql type INT24
Which is mapped to sal_Int32.
Change-Id: Ibf12e92a20034440fa990ed0c6f1196f4ca3f40f
Reviewed-on: https://gerrit.libreoffice.org/73218
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Tested-by: Andras Timar <andras.timar at collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/76733
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Tamás Bunth <btomi96 at gmail.com>
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx b/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx
index 2eaeceb66b90..ead866968ead 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx
@@ -31,6 +31,7 @@
#include <com/sun/star/sdbcx/CompareBookmark.hpp>
#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/typeprovider.hxx>
+#include <sal/log.hxx>
using namespace rtl;
#include <comphelper/string.hxx>
@@ -66,6 +67,7 @@ const std::type_index getTypeFromMysqlType(enum_field_types type)
case MYSQL_TYPE_SHORT:
return std::type_index(typeid(sal_Int16));
case MYSQL_TYPE_LONG:
+ case MYSQL_TYPE_INT24:
return std::type_index(typeid(sal_Int32));
case MYSQL_TYPE_LONGLONG:
return std::type_index(typeid(sal_Int64));
@@ -88,7 +90,6 @@ const std::type_index getTypeFromMysqlType(enum_field_types type)
case MYSQL_TYPE_BLOB:
case MYSQL_TYPE_YEAR:
case MYSQL_TYPE_BIT:
- case MYSQL_TYPE_INT24:
case MYSQL_TYPE_SET:
case MYSQL_TYPE_ENUM:
case MYSQL_TYPE_GEOMETRY:
@@ -268,6 +269,7 @@ ORowSetValue OPreparedResultSet::getRowSetValue(sal_Int32 nColumnIndex)
case MYSQL_TYPE_SHORT:
return getShort(nColumnIndex);
case MYSQL_TYPE_LONG:
+ case MYSQL_TYPE_INT24:
return getInt(nColumnIndex);
case MYSQL_TYPE_LONGLONG:
return getLong(nColumnIndex);
@@ -287,9 +289,10 @@ ORowSetValue OPreparedResultSet::getRowSetValue(sal_Int32 nColumnIndex)
case MYSQL_TYPE_NEWDECIMAL:
return getString(nColumnIndex);
default:
- mysqlc_sdbc_driver::throwFeatureNotImplementedException(
- "OPreparedResultSet::getRowSetValue", *this);
- return ORowSetValue();
+ SAL_WARN("connectivity.mysqlc", "OPreparedResultSet::getRowSetValue: unknown type: "
+ << m_aFields[nColumnIndex - 1].type);
+ throw SQLException("Unknown column type when fetching result", *this, OUString(), 1,
+ Any());
}
}
commit 62bd8daf20b66cea5b84b05fb04b9ed5240b1ab9
Author: Tamas Bunth <tamas.bunth at collabora.co.uk>
AuthorDate: Thu Apr 25 12:17:06 2019 +0200
Commit: Tamás Bunth <btomi96 at gmail.com>
CommitDate: Fri Aug 2 16:50:19 2019 +0200
mysqlc: move template specialization to namespace
so gcc 4.8 would be happy about it.
See:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480
Change-Id: I7e696758c5598b9e64947bc9b1606c653becddce
Reviewed-on: https://gerrit.libreoffice.org/71294
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Tested-by: Andras Timar <andras.timar at collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/76732
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Tamás Bunth <btomi96 at gmail.com>
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx b/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx
index b3630072c143..2eaeceb66b90 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx
@@ -198,6 +198,7 @@ template <typename T> T OPreparedResultSet::retrieveValue(sal_Int32 nColumnIndex
return getRowSetValue(nColumnIndex);
}
+namespace connectivity { namespace mysqlc {
template <> uno::Sequence<sal_Int8> OPreparedResultSet::retrieveValue(sal_Int32 column)
{
// TODO make conversion possible
@@ -256,6 +257,7 @@ template <> OUString OPreparedResultSet::retrieveValue(sal_Int32 column)
OUString sReturn = OUString(sStr, *m_aData[column - 1].length, m_encoding);
return sReturn;
}
+}}
ORowSetValue OPreparedResultSet::getRowSetValue(sal_Int32 nColumnIndex)
{
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.hxx b/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.hxx
index b43935039efe..d10c8df5dacd 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.hxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.hxx
@@ -92,8 +92,8 @@ class OPreparedResultSet final : public OBase_Mutex,
void SAL_CALL getFastPropertyValue(Any& rValue, sal_Int32 nHandle) const override;
- template <typename T> T safelyRetrieveValue(const sal_Int32 nColumnIndex);
- template <typename T> T retrieveValue(const sal_Int32 nColumnIndex);
+ template <typename T> T safelyRetrieveValue(sal_Int32 nColumnIndex);
+ template <typename T> T retrieveValue(sal_Int32 nColumnIndex);
connectivity::ORowSetValue getRowSetValue(sal_Int32 nColumnIndex);
// you can't delete objects of this type
More information about the Libreoffice-commits
mailing list