From owner-dev-commits-ports-branches@freebsd.org Fri Aug 27 17:22:16 2021 Return-Path: Delivered-To: dev-commits-ports-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 00B516642D9; Fri, 27 Aug 2021 17:22:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gx63C62fDz3L3t; Fri, 27 Aug 2021 17:22:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B5D132754A; Fri, 27 Aug 2021 17:22:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17RHMF35035622; Fri, 27 Aug 2021 17:22:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17RHMFgd035621; Fri, 27 Aug 2021 17:22:15 GMT (envelope-from git) Date: Fri, 27 Aug 2021 17:22:15 GMT Message-Id: <202108271722.17RHMFgd035621@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-branches@FreeBSD.org From: "Tobias C. Berner" Subject: git: 5b49dd92f47e - 2021Q3 - databases/qt5-sqldrivers-mysql: fix against mysql 5.7.34 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tcberner X-Git-Repository: ports X-Git-Refname: refs/heads/2021Q3 X-Git-Reftype: branch X-Git-Commit: 5b49dd92f47ed462e9b60597bf2b179268927213 Auto-Submitted: auto-generated X-BeenThere: dev-commits-ports-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the quarterly branches of the FreeBSD ports repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2021 17:22:16 -0000 The branch 2021Q3 has been updated by tcberner: URL: https://cgit.FreeBSD.org/ports/commit/?id=5b49dd92f47ed462e9b60597bf2b179268927213 commit 5b49dd92f47ed462e9b60597bf2b179268927213 Author: Adriaan de Groot AuthorDate: 2021-07-11 15:52:29 +0000 Commit: Tobias C. Berner CommitDate: 2021-08-27 15:18:24 +0000 databases/qt5-sqldrivers-mysql: fix against mysql 5.7.34 In mysql 5.7.34 binding a parameter to a 0-sized buffer triggers an assert() -- previously this was DBG_ASSERT. This triggers crashes in databases/akonadi in particular, which binds blobs of size 0. This patch allows akonadi with the default mysql to start (at all) again. The patch file previously held a Qt4-era patch which had long ago had a better patch applied upstream (the comment in the patch refers to that). The old stuff has been removed, leaving only the parameter-fix. PR: 248929 (cherry picked from commit e093f1162c353f3d62dce85e9e74053fc9a4743c) --- databases/qt5-sqldrivers-mysql/Makefile | 1 + ...ch-src_plugins_sqldrivers_mysql_qsql__mysql.cpp | 77 +++++----------------- 2 files changed, 16 insertions(+), 62 deletions(-) diff --git a/databases/qt5-sqldrivers-mysql/Makefile b/databases/qt5-sqldrivers-mysql/Makefile index cb439f9671af..04a43c5fb77d 100644 --- a/databases/qt5-sqldrivers-mysql/Makefile +++ b/databases/qt5-sqldrivers-mysql/Makefile @@ -1,3 +1,4 @@ +PORTREVISION= 1 DB= MYSQL DB_DESC= MySQL diff --git a/databases/qt5-sqldrivers-mysql/files/patch-src_plugins_sqldrivers_mysql_qsql__mysql.cpp b/databases/qt5-sqldrivers-mysql/files/patch-src_plugins_sqldrivers_mysql_qsql__mysql.cpp index 00e133f9195f..d76cd1b67365 100644 --- a/databases/qt5-sqldrivers-mysql/files/patch-src_plugins_sqldrivers_mysql_qsql__mysql.cpp +++ b/databases/qt5-sqldrivers-mysql/files/patch-src_plugins_sqldrivers_mysql_qsql__mysql.cpp @@ -1,63 +1,16 @@ -https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-1.html - -Incompatible Change: The my_bool type is no longer used in MySQL -source code. Any third-party code that used this type to represent -C boolean variables should use the bool or int C type instead. - -Note -The change from my_bool to bool means that the mysql.h header file -now requires a C++ or C99 compiler to compile. - -(Bug #25597667) - -For Qt5, which requires C++11, the following line single-line -definition for mysql_bool is less-fragile and more C++y: - using mysql_bool = decltype(MYSQL_BIND::is_null_value); -This does not apply to the Qt4 port, which allows older compilers -and the less-fragile approach would therefore break on old-gcc-in-base -architectures. - ---- src/plugins/sqldrivers/mysql/qsql_mysql.cpp.orig 2020-03-11 15:29:12 UTC +--- src/plugins/sqldrivers/mysql/qsql_mysql.cpp.orig 2020-10-27 08:02:11 UTC +++ src/plugins/sqldrivers/mysql/qsql_mysql.cpp -@@ -71,6 +71,14 @@ Q_DECLARE_METATYPE(MYSQL_STMT*) - // by redefining it we can regain source compatibility. - using my_bool = decltype(mysql_stmt_bind_result(nullptr, nullptr)); - -+// MYSQL 8.0.1 no longer uses the my_bool type: -+// https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-1.html -+#if (MYSQL_VERSION_ID >= 80001) && !defined(MARIADB_BASE_VERSION) -+typedef bool mysql_bool; -+#else -+typedef my_bool mysql_bool; -+#endif -+ - QT_BEGIN_NAMESPACE - - class QMYSQLDriverPrivate : public QSqlDriverPrivate -@@ -930,7 +938,7 @@ bool QMYSQLResult::exec() - MYSQL_BIND* currBind; - QVector timeVector; - QVector stringVector; -- QVector nullVector; -+ QVector nullVector; - - const QVector values = boundValues(); - -@@ -951,7 +959,7 @@ bool QMYSQLResult::exec() - - currBind = &d->outBinds[i]; - -- nullVector[i] = static_cast(val.isNull()); -+ nullVector[i] = static_cast(val.isNull()); - currBind->is_null = &nullVector[i]; - currBind->length = 0; - currBind->is_unsigned = 0; -@@ -1048,7 +1056,7 @@ bool QMYSQLResult::exec() - d->rowsAffected = mysql_stmt_affected_rows(d->stmt); - - if (isSelect()) { -- my_bool update_max_length = true; -+ mysql_bool update_max_length = true; - - r = mysql_stmt_bind_result(d->stmt, d->inBinds); - if (r != 0) { +@@ -352,11 +360,11 @@ void QMYSQLResultPrivate::bindBlobs() + + for(i = 0; i < fields.count(); ++i) { + fieldInfo = fields.at(i).myField; +- if (qIsBlob(inBinds[i].buffer_type) && meta && fieldInfo) { ++ if (qIsBlob(inBinds[i].buffer_type) && meta && fieldInfo && fieldInfo->max_length) { + bind = &inBinds[i]; + bind->buffer_length = fieldInfo->max_length; + delete[] static_cast(bind->buffer); +- bind->buffer = new char[fieldInfo->max_length]; ++ bind->buffer = new char[bind->buffer_length]; + fields[i].outField = static_cast(bind->buffer); + } + }