summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Ehrlicher <[email protected]>2025-05-01 15:43:22 +0200
committerChristian Ehrlicher <[email protected]>2025-05-01 20:22:40 +0200
commitdbbe65fb262cce0379660e38ab71b27044015d27 (patch)
tree03eaaa5e73b2a8fa10c4f795745dc62f2e595848
parentfd09d6f5d570e53394c6b1ef8aa45f9ee632af58 (diff)
SQL/MySQL: adjust check for MariaDB client library
The correct define to check for MariaDB C Connector is MARIADB_PACKAGE_VERSION_ID, not MARIADB_BASE_VERSION (which is a string describing the server version the c connector relates to). Pick-to: 6.9 6.8 Task-number: QTBUG-136550 Change-Id: I844900d9b6622fd3a72db63298e5c34de8a2f3dc Reviewed-by: Thiago Macieira <[email protected]>
-rw-r--r--src/plugins/sqldrivers/mysql/qsql_mysql.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/sqldrivers/mysql/qsql_mysql.cpp b/src/plugins/sqldrivers/mysql/qsql_mysql.cpp
index 29d1b5e7b64..42c2c6a49f7 100644
--- a/src/plugins/sqldrivers/mysql/qsql_mysql.cpp
+++ b/src/plugins/sqldrivers/mysql/qsql_mysql.cpp
@@ -1094,14 +1094,14 @@ static void qLibraryInit()
}
#endif // Q_NO_MYSQL_EMBEDDED
-#if defined(MARIADB_BASE_VERSION) || defined(MARIADB_VERSION_ID)
+#if defined(MARIADB_PACKAGE_VERSION_ID)
qAddPostRoutine([]() { mysql_server_end(); });
#endif
}
static void qLibraryEnd()
{
-#if !defined(MARIADB_BASE_VERSION) && !defined(MARIADB_VERSION_ID)
+#if !defined(MARIADB_PACKAGE_VERSION_ID)
# if !defined(Q_NO_MYSQL_EMBEDDED)
mysql_library_end();
# endif
@@ -1360,7 +1360,7 @@ bool QMYSQLDriver::open(const QString &db,
// try utf8 with non BMP first, utf8 (BMP only) if that fails
static const char wanted_charsets[][8] = { "utf8mb4", "utf8" };
-#ifdef MARIADB_VERSION_ID
+#if defined(MARIADB_PACKAGE_VERSION_ID)
MARIADB_CHARSET_INFO *cs = nullptr;
for (const char *p : wanted_charsets) {
cs = mariadb_get_charset_by_name(p);
@@ -1512,7 +1512,7 @@ QSqlRecord QMYSQLDriver::record(const QString &tablename) const
+ d->dbName + "' AND table_name = '%1'"_L1;
const auto baTableName = tablename.toUtf8();
QVarLengthArray<char> tableNameQuoted(baTableName.size() * 2 + 1);
-#if defined(MARIADB_VERSION_ID)
+#if defined(MARIADB_PACKAGE_VERSION_ID)
const auto len = mysql_real_escape_string(d->mysql, tableNameQuoted.data(),
baTableName.data(), baTableName.size());
#else