fixed deprecated MYSQL_OPT_RECONNECT warning

The MYSQL_OPT_RECONNECT option is deprecated from MySQL >=8.1 and
>=8.0.24, so don't use it.

 - updated exception message
This commit is contained in:
silverqx
2023-08-02 18:19:45 +02:00
parent 099bf21c93
commit 8b9c57b127
2 changed files with 4 additions and 4 deletions
+1 -3
View File
@@ -59,9 +59,7 @@ namespace Orm::Connectors
private:
/*! The default QSqlDatabase connection options for the MySqlConnector. */
inline static const QVariantHash m_options {
{QLatin1String("MYSQL_OPT_RECONNECT"), 0},
};
inline static const QVariantHash m_options;
};
} // namespace Orm::Connectors
@@ -49,7 +49,9 @@ MySqlConfigurationParser::throwIfContainsUnsupportedOption(const QVariantHash &o
static const std::unordered_map<QString, BannedValue> bannedMap {
// We have our own reconnector
{QStringLiteral("MYSQL_OPT_RECONNECT"),
{1, QStringLiteral(" TinyORM uses its own reconnector.")}},
{1, QStringLiteral(" TinyORM uses its own reconnector. Also, be aware that "
"the MYSQL_OPT_RECONNECT is deprecated from MySQL >=8.1 "
"and >=8.0.24 and will be removed in future versions.")}},
};
for (const auto &[key, banned] : bannedMap) {