diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2023-02-12 17:09:20 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-02-13 21:53:17 +0000 |
commit | 03542e413fd0cafe64c47a2a1244c2c4555faf40 (patch) | |
tree | 6a947446d5e2e18e7f1ffd4e879a1523b408d72d | |
parent | Update bundled libjpeg-turbo to version 2.1.5 (diff) | |
download | qtbase-03542e413fd0cafe64c47a2a1244c2c4555faf40.tar.xz qtbase-03542e413fd0cafe64c47a2a1244c2c4555faf40.zip |
ODBC/MySQL: fix compilation with MySQL < 5.7.9
MYSQL_TYPE_JSON was introduced in MySQL 5.7.9 but our documentation
states that we still support 5.6 so we have to define this value by
ourself for the older versions.
Fixes: QTBUG-109832
Change-Id: I935edb14495d162ed58109610946b2805d37bbc4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 5bc61ec5d028d57640b9c4cd515ed7dfebac945c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/plugins/sqldrivers/mysql/qsql_mysql.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/sqldrivers/mysql/qsql_mysql.cpp b/src/plugins/sqldrivers/mysql/qsql_mysql.cpp index 3b954dfcbd..02e76db950 100644 --- a/src/plugins/sqldrivers/mysql/qsql_mysql.cpp +++ b/src/plugins/sqldrivers/mysql/qsql_mysql.cpp @@ -29,6 +29,11 @@ Q_DECLARE_METATYPE(MYSQL_RES*) Q_DECLARE_METATYPE(MYSQL*) Q_DECLARE_METATYPE(MYSQL_STMT*) +// MYSQL_TYPE_JSON was introduced with MySQL 5.7.9 +#if defined(MYSQL_VERSION_ID) && MYSQL_VERSION_ID < 50709 +#define MYSQL_TYPE_JSON 245 +#endif + // MySQL above version 8 removed my_bool typedef while MariaDB kept it, // by redefining it we can regain source compatibility. using my_bool = decltype(mysql_stmt_bind_result(nullptr, nullptr)); |