[Libreoffice-commits] core.git: connectivity/source
Tamas Bunth (via logerrit)
logerrit at kemper.freedesktop.org
Fri Sep 6 14:06:07 UTC 2019
connectivity/source/drivers/mysqlc/mysqlc_connection.cxx | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
New commits:
commit cc876706b1626078ee056c35f7dda1efcc315df9
Author: Tamas Bunth <tamas.bunth at collabora.co.uk>
AuthorDate: Thu Sep 5 14:31:35 2019 +0200
Commit: Tamás Bunth <btomi96 at gmail.com>
CommitDate: Fri Sep 6 16:05:01 2019 +0200
mysqlc: Support connection to utf8mb4 server
This charset is backward compatible with 'normal' utf-8.
Change-Id: I4407894bf9029b9c56eb0d2530796e85bd226591
Reviewed-on: https://gerrit.libreoffice.org/78650
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96 at gmail.com>
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_connection.cxx b/connectivity/source/drivers/mysqlc/mysqlc_connection.cxx
index a9d4438dfa97..48cc6aca3a00 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_connection.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_connection.cxx
@@ -88,6 +88,8 @@ void OConnection::construct(const OUString& url, const Sequence<PropertyValue>&
// use TCP as connection
mysql_protocol_type protocol = MYSQL_PROTOCOL_TCP;
mysql_options(&m_mysql, MYSQL_OPT_PROTOCOL, &protocol);
+ OString charset_name{ "utf8mb4" };
+ mysql_options(&m_mysql, MYSQL_SET_CHARSET_NAME, charset_name.getStr());
sal_Int32 nIndex;
OUString token;
@@ -198,7 +200,7 @@ void OConnection::construct(const OUString& url, const Sequence<PropertyValue>&
lcl_executeUpdate(&m_mysql,
OString{ "SET session sql_mode='ANSI_QUOTES,NO_AUTO_VALUE_ON_ZERO'" });
- lcl_executeUpdate(&m_mysql, OString{ "SET NAMES utf8" });
+ lcl_executeUpdate(&m_mysql, OString{ "SET NAMES utf8mb4" });
}
OUString OConnection::getImplementationName()
More information about the Libreoffice-commits
mailing list