From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id B8430138335 for ; Sat, 19 Oct 2019 21:43:15 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A531EE087B; Sat, 19 Oct 2019 21:43:14 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 80185E087B for ; Sat, 19 Oct 2019 21:43:14 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 7313834C073 for ; Sat, 19 Oct 2019 21:43:13 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D9DF2882 for ; Sat, 19 Oct 2019 21:43:10 +0000 (UTC) From: "Andreas Sturmlechner" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Andreas Sturmlechner" Message-ID: <1571521315.5e2f02e82905794314667eb0fcd657af2abd0a47.asturm@gentoo> Subject: [gentoo-commits] proj/qt:master commit in: dev-qt/qtsql/files/, dev-qt/qtsql/ X-VCS-Repository: proj/qt X-VCS-Files: dev-qt/qtsql/files/qtsql-5.13.1-postgresql-12.patch dev-qt/qtsql/qtsql-5.13.1.ebuild dev-qt/qtsql/qtsql-5.13.9999.ebuild X-VCS-Directories: dev-qt/qtsql/files/ dev-qt/qtsql/ X-VCS-Committer: asturm X-VCS-Committer-Name: Andreas Sturmlechner X-VCS-Revision: 5e2f02e82905794314667eb0fcd657af2abd0a47 X-VCS-Branch: master Date: Sat, 19 Oct 2019 21:43:10 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: b8eee5a1-24f3-47ae-a36b-7b6cb0294ffd X-Archives-Hash: da67d9c35a0b47e0ff2f3a43836f571f commit: 5e2f02e82905794314667eb0fcd657af2abd0a47 Author: Andreas Sturmlechner gentoo org> AuthorDate: Sat Oct 19 21:41:55 2019 +0000 Commit: Andreas Sturmlechner gentoo org> CommitDate: Sat Oct 19 21:41:55 2019 +0000 URL: https://gitweb.gentoo.org/proj/qt.git/commit/?id=5e2f02e8 dev-qt/qtsql: Fix build against PostgreSQL 12.0 Clean backport from qtsql 5.14 branch. Bug: https://bugs.gentoo.org/696870 Package-Manager: Portage-2.3.77, Repoman-2.3.17 Signed-off-by: Andreas Sturmlechner gentoo.org> .../qtsql/files/qtsql-5.13.1-postgresql-12.patch | 97 ++++++++++++++++++++++ dev-qt/qtsql/qtsql-5.13.1.ebuild | 5 ++ dev-qt/qtsql/qtsql-5.13.9999.ebuild | 5 ++ 3 files changed, 107 insertions(+) diff --git a/dev-qt/qtsql/files/qtsql-5.13.1-postgresql-12.patch b/dev-qt/qtsql/files/qtsql-5.13.1-postgresql-12.patch new file mode 100644 index 00000000..f41755ad --- /dev/null +++ b/dev-qt/qtsql/files/qtsql-5.13.1-postgresql-12.patch @@ -0,0 +1,97 @@ +From 14b61d48e8bad6223a08843cf363ef48f09c479b Mon Sep 17 00:00:00 2001 +From: Christian Ehrlicher +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 +--- + 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 + schema = stripDelimiters(schema, QSqlDriver::TableName); + tbl = stripDelimiters(tbl, QSqlDriver::TableName); + +- QString stmt = QStringLiteral("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(QStringLiteral("pg_table_is_visible(pg_class.oid)")); +- else +- stmt = stmt.arg(QStringLiteral("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 diff --git a/dev-qt/qtsql/qtsql-5.13.1.ebuild b/dev-qt/qtsql/qtsql-5.13.1.ebuild index 5378ef39..d02d4a17 100644 --- a/dev-qt/qtsql/qtsql-5.13.1.ebuild +++ b/dev-qt/qtsql/qtsql-5.13.1.ebuild @@ -38,6 +38,11 @@ QT5_GENTOO_PRIVATE_CONFIG=( :sql ) +PATCHES+=( + # Backport from 5.14 branch, bug #696870 + "${FILESDIR}/${P}-postgresql-12.patch" +) + src_configure() { local myconf=( $(qt_use freetds sql-tds plugin) diff --git a/dev-qt/qtsql/qtsql-5.13.9999.ebuild b/dev-qt/qtsql/qtsql-5.13.9999.ebuild index 5378ef39..256a4b30 100644 --- a/dev-qt/qtsql/qtsql-5.13.9999.ebuild +++ b/dev-qt/qtsql/qtsql-5.13.9999.ebuild @@ -38,6 +38,11 @@ QT5_GENTOO_PRIVATE_CONFIG=( :sql ) +PATCHES+=( + # Backport from 5.14 branch, bug #696870 + "${FILESDIR}/${PN}-5.13.1-postgresql-12.patch" +) + src_configure() { local myconf=( $(qt_use freetds sql-tds plugin)