connectivity/source/drivers/mysqlc/mysqlc_connection.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
New commits: commit cc876706b1626078ee056c35f7dda1efcc315df9 Author: Tamas Bunth <tamas.bu...@collabora.co.uk> AuthorDate: Thu Sep 5 14:31:35 2019 +0200 Commit: Tamás Bunth <btom...@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 <btom...@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() _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits