diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2020-02-05 18:44:56 +0000 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2020-02-05 18:44:56 +0000 |
commit | 29aabba0ea759c6a2864ff5631735b67ee38e5e0 (patch) | |
tree | ab466b4dfa7abecb401b2f8039d08af4689306bb /dev-qt/qtsql/files | |
parent | d42200bec37eef2a7478d88988ff00addd0a9202 (diff) |
gentoo resync : 05.02.2020
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 | ||||
-rw-r--r-- | dev-qt/qtsql/files/qtsql-5.12.5-postgresql-12.patch | 97 |
2 files changed, 0 insertions, 140 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 deleted file mode 100644 index 6bd3d3d2b9bd..000000000000 --- a/dev-qt/qtsql/files/qtsql-5.12.4-mysql_free_results_when_qsqlquery_finished_is_called.patch +++ /dev/null @@ -1,43 +0,0 @@ -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); diff --git a/dev-qt/qtsql/files/qtsql-5.12.5-postgresql-12.patch b/dev-qt/qtsql/files/qtsql-5.12.5-postgresql-12.patch deleted file mode 100644 index 7e344389e5dd..000000000000 --- a/dev-qt/qtsql/files/qtsql-5.12.5-postgresql-12.patch +++ /dev/null @@ -1,97 +0,0 @@ -From 14b61d48e8bad6223a08843cf363ef48f09c479b Mon Sep 17 00:00:00 2001 -From: Christian Ehrlicher <ch.ehrlicher@gmx.de> -Date: Fri, 11 Oct 2019 20:53:49 +0200 -Subject: [PATCH] QPSQL: Add support for PostgreSQL 12 - -Add proper version check and replace long deprecated and now removed -access to pg_attrdef.adsrc. - -[ChangeLog][QtSql][QPSQL] added support for PostgreSQL 12 - -Fixes: QTBUG-79033 -Fixes: QTBUG-79064 -Change-Id: Iec1b13945c34ea017139ad1c5539ab5b7f1e03aa -Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> ---- - src/plugins/sqldrivers/psql/qsql_psql.cpp | 43 +++++++++++++++++-------------- - src/plugins/sqldrivers/psql/qsql_psql_p.h | 1 + - 2 files changed, 25 insertions(+), 19 deletions(-) - -diff --git a/src/plugins/sqldrivers/psql/qsql_psql.cpp b/src/plugins/sqldrivers/psql/qsql_psql.cpp -index 3803f05b9f9..760685f64b4 100644 ---- a/src/plugins/sqldrivers/psql/qsql_psql.cpp -+++ b/src/plugins/sqldrivers/psql/qsql_psql.cpp -@@ -1078,8 +1078,10 @@ static QPSQLDriver::Protocol qMakePSQLVersion(int vMaj, int vMin) - return QPSQLDriver::Version10; - case 11: - return QPSQLDriver::Version11; -+ case 12: -+ return QPSQLDriver::Version12; - default: -- if (vMaj > 11) -+ if (vMaj > 12) - return QPSQLDriver::UnknownLaterVersion; - break; - } -@@ -1439,26 +1441,29 @@ QSqlRecord QPSQLDriver::record(const QString &tablename) const - else - schema = std::move(schema).toLower(); - -- QString stmt = QLatin1String("select pg_attribute.attname, pg_attribute.atttypid::int, " -- "pg_attribute.attnotnull, pg_attribute.attlen, pg_attribute.atttypmod, " -- "pg_attrdef.adsrc " -- "from pg_class, pg_attribute " -- "left join pg_attrdef on (pg_attrdef.adrelid = " -- "pg_attribute.attrelid and pg_attrdef.adnum = pg_attribute.attnum) " -- "where %1 " -- "and pg_class.relname = '%2' " -- "and pg_attribute.attnum > 0 " -- "and pg_attribute.attrelid = pg_class.oid " -- "and pg_attribute.attisdropped = false " -- "order by pg_attribute.attnum"); -- if (schema.isEmpty()) -- stmt = stmt.arg(QLatin1String("pg_table_is_visible(pg_class.oid)")); -- else -- stmt = stmt.arg(QString::fromLatin1("pg_class.relnamespace = (select oid from " -- "pg_namespace where pg_namespace.nspname = '%1')").arg(schema)); -+ const QString adsrc = protocol() < Version8 -+ ? QStringLiteral("pg_attrdef.adsrc") -+ : QStringLiteral("pg_get_expr(pg_attrdef.adbin, pg_attrdef.adrelid)"); -+ const QString nspname = schema.isEmpty() -+ ? QStringLiteral("pg_table_is_visible(pg_class.oid)") -+ : QStringLiteral("pg_class.relnamespace = (SELECT oid FROM " -+ "pg_namespace WHERE pg_namespace.nspname = '%1')").arg(schema); -+ const QString stmt = -+ QStringLiteral("SELECT pg_attribute.attname, pg_attribute.atttypid::int, " -+ "pg_attribute.attnotnull, pg_attribute.attlen, pg_attribute.atttypmod, " -+ "%1 " -+ "FROM pg_class, pg_attribute " -+ "LEFT JOIN pg_attrdef ON (pg_attrdef.adrelid = " -+ "pg_attribute.attrelid AND pg_attrdef.adnum = pg_attribute.attnum) " -+ "WHERE %2 " -+ "AND pg_class.relname = '%3' " -+ "AND pg_attribute.attnum > 0 " -+ "AND pg_attribute.attrelid = pg_class.oid " -+ "AND pg_attribute.attisdropped = false " -+ "ORDER BY pg_attribute.attnum").arg(adsrc, nspname, tbl); - - QSqlQuery query(createResult()); -- query.exec(stmt.arg(tbl)); -+ query.exec(stmt); - while (query.next()) { - int len = query.value(3).toInt(); - int precision = query.value(4).toInt(); -diff --git a/src/plugins/sqldrivers/psql/qsql_psql_p.h b/src/plugins/sqldrivers/psql/qsql_psql_p.h -index 99e0b5f60f5..9ac1fb50d79 100644 ---- a/src/plugins/sqldrivers/psql/qsql_psql_p.h -+++ b/src/plugins/sqldrivers/psql/qsql_psql_p.h -@@ -93,6 +93,7 @@ public: - Version9_6 = 22, - Version10 = 23, - Version11 = 24, -+ Version12 = 25, - UnknownLaterVersion = 100000 - }; - --- -2.16.3 |