diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2019-08-02 19:14:55 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2019-08-02 19:14:55 +0100 |
commit | b24bd25253fe093f722ab576d29fdc41d04cb1ee (patch) | |
tree | 0fcf2afd9f852c4d4c291cf8afaa2c244d598105 /dev-qt/qtsql/files | |
parent | 121ed4eec41fbf03e1998d09eede1bf449da63b9 (diff) |
gentoo resync : 02.08.2019
Diffstat (limited to 'dev-qt/qtsql/files')
-rw-r--r-- | dev-qt/qtsql/files/qtsql-5.12.4-mysql_free_results_when_qsqlquery_finished_is_called.patch | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/dev-qt/qtsql/files/qtsql-5.12.4-mysql_free_results_when_qsqlquery_finished_is_called.patch b/dev-qt/qtsql/files/qtsql-5.12.4-mysql_free_results_when_qsqlquery_finished_is_called.patch new file mode 100644 index 000000000000..6bd3d3d2b9bd --- /dev/null +++ b/dev-qt/qtsql/files/qtsql-5.12.4-mysql_free_results_when_qsqlquery_finished_is_called.patch @@ -0,0 +1,43 @@ +From 97d8be10cd97cf997286ed0ca0a5d8b360fa942e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Daniel=20Vr=C3=A1til?= <dvratil@kde.org> +Date: Sat, 1 Dec 2018 17:56:41 +0100 +Subject: [PATCH] MySQL: Free the results when QSqlQuery::finished() is called + +Calling mysql_stmt_free_result() frees the results of the last +executed query while keeping the prepared statement valid. This +allows one to keep around prepared QSqlQueries without the overhead +of keeping all the results in memory. + +Change-Id: I4589e90857cc4e9a6f9612799bfca967a67e2ab2 +Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> +Reviewed-by: Andy Shaw <andy.shaw@qt.io> +--- + src/plugins/sqldrivers/mysql/qsql_mysql.cpp | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +--- a/src/plugins/sqldrivers/mysql/qsql_mysql.cpp ++++ b/src/plugins/sqldrivers/mysql/qsql_mysql.cpp +@@ -197,6 +197,7 @@ protected: + QSqlRecord record() const override; + void virtual_hook(int id, void *data) override; + bool nextResult() override; ++ void detachFromResultSet() override; + + #if MYSQL_VERSION_ID >= 40108 + bool prepare(const QString &stmt) override; +@@ -804,6 +805,15 @@ int QMYSQLResult::numRowsAffected() + return d->rowsAffected; + } + ++void QMYSQLResult::detachFromResultSet() ++{ ++ Q_D(QMYSQLResult); ++ ++ if (d->preparedQuery) { ++ mysql_stmt_free_result(d->stmt); ++ } ++} ++ + QVariant QMYSQLResult::lastInsertId() const + { + Q_D(const QMYSQLResult); |