Mailinglist Archive: opensuse-commit (1774 mails)

< Previous Next >
commit libqt4 for openSUSE:Factory

Hello community,

here is the log from the commit of package libqt4 for openSUSE:Factory
checked in at Fri Feb 4 17:56:57 CET 2011.



--------
--- libqt4/libqt4-devel-doc-data.changes 2010-12-04 17:16:49.000000000
+0100
+++ libqt4/libqt4-devel-doc-data.changes 2011-02-03 16:26:27.000000000
+0100
@@ -1,0 +2,5 @@
+Thu Feb 3 16:25:56 CET 2011 - dmueller@xxxxxxx
+
+- add support for postgresql 8.3 and 9 (bnc#668210)
+
+-------------------------------------------------------------------
libqt4-devel-doc.changes: same change
libqt4-sql-plugins.changes: same change
libqt4.changes: same change

calling whatdependson for head-i586


New:
----
fix-psql.diff

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libqt4-devel-doc-data.spec ++++++
--- /var/tmp/diff_new_pack.r95qAC/_old 2011-02-04 17:53:15.000000000 +0100
+++ /var/tmp/diff_new_pack.r95qAC/_new 2011-02-04 17:53:15.000000000 +0100
@@ -1,7 +1,7 @@
#
-# spec file for package libqt4-devel-doc-data (Version 4.7.1)
+# spec file for package libqt4-devel-doc-data
#
-# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -28,7 +28,7 @@
# COMMON-VERSION-BEGIN
# COMMON-VERSION-BEGIN
Version: 4.7.1
-Release: 2
+Release: 3
%define base_name libqt4
%define x11_free -everywhere-opensource-src-
%define rversion %version
@@ -79,6 +79,7 @@
Patch121: webkit-sparc64.diff
Patch122: push-glib-context.diff
Patch123: use-cups-default-print-settings-bnc552218.diff
+Patch124: fix-psql.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define common_options --opensource -fast -no-separate-debug-info -shared
-xkb -xrender -xcursor -dbus-linked -xfixes -xrandr -xinerama -sm -no-nas-sound
-no-rpath -system-libjpeg -system-libpng -accessibility -cups -stl -nis
-system-zlib -qt-gif -prefix /usr -L %_libdir -libdir %_libdir -docdir
%_docdir/%{base_name} -examplesdir %_libdir/qt4/examples -demosdir
%_libdir/qt4/demos -plugindir %plugindir -translationdir
/usr/share/qt4/translations -iconv -sysconfdir /etc/settings -datadir
/usr/share/qt4/ -no-pch -reduce-relocations -exceptions -system-libtiff -glib
-optimized-qmake -no-webkit -no-xmlpatterns -system-sqlite -qt3support
-no-sql-mysql -importdir %plugindir/imports -xsync -xinput -gtkstyle
%define check_config \
@@ -136,6 +137,7 @@
%endif
%patch122
%patch123
+%patch124
# ### 47 rediff
#%patch121 -p1
# be sure not to use them

libqt4-devel-doc.spec: same change
libqt4-sql-plugins.spec: same change
++++++ libqt4.spec ++++++
--- /var/tmp/diff_new_pack.r95qAC/_old 2011-02-04 17:53:15.000000000 +0100
+++ /var/tmp/diff_new_pack.r95qAC/_new 2011-02-04 17:53:15.000000000 +0100
@@ -1,7 +1,7 @@
#
-# spec file for package libqt4 (Version 4.7.1)
+# spec file for package libqt4
#
-# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -54,7 +54,7 @@
Obsoletes: libqt4-dbus-1 < 4.4.0
# COMMON-VERSION-BEGIN
Version: 4.7.1
-Release: 2
+Release: 3
%define base_name libqt4
%define x11_free -everywhere-opensource-src-
%define rversion %version
@@ -96,6 +96,7 @@
Patch121: webkit-sparc64.diff
Patch122: push-glib-context.diff
Patch123: use-cups-default-print-settings-bnc552218.diff
+Patch124: fix-psql.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define common_options --opensource -fast -no-separate-debug-info -shared
-xkb -xrender -xcursor -dbus-linked -xfixes -xrandr -xinerama -sm -no-nas-sound
-no-rpath -system-libjpeg -system-libpng -accessibility -cups -stl -nis
-system-zlib -qt-gif -prefix /usr -L %_libdir -libdir %_libdir -docdir
%_docdir/%{base_name} -examplesdir %_libdir/qt4/examples -demosdir
%_libdir/qt4/demos -plugindir %plugindir -translationdir
/usr/share/qt4/translations -iconv -sysconfdir /etc/settings -datadir
/usr/share/qt4/ -no-pch -reduce-relocations -exceptions -system-libtiff -glib
-optimized-qmake -no-webkit -no-xmlpatterns -system-sqlite -qt3support
-no-sql-mysql -importdir %plugindir/imports -xsync -xinput -gtkstyle
%define check_config \
@@ -153,6 +154,7 @@
%endif
%patch122
%patch123
+%patch124
# ### 47 rediff
#%patch121 -p1
# be sure not to use them



++++++ fix-psql.diff ++++++
--- src/sql/drivers/psql/qsql_psql.cpp
+++ src/sql/drivers/psql/qsql_psql.cpp
@@ -54,7 +54,6 @@
#include <qstringlist.h>
#include <qmutex.h>

-
#include <libpq-fe.h>
#include <pg_config.h>

@@ -619,6 +618,50 @@
PQclear(result);
}

+static QPSQLDriver::Protocol qMakePSQLVersion(int vMaj, int vMin)
+{
+ switch (vMaj) {
+ case 6:
+ return QPSQLDriver::Version6;
+ case 7:
+ {
+ switch (vMin) {
+ case 1:
+ return QPSQLDriver::Version71;
+ case 3:
+ return QPSQLDriver::Version73;
+ case 4:
+ return QPSQLDriver::Version74;
+ default:
+ return QPSQLDriver::Version7;
+ }
+ break;
+ }
+ case 8:
+ {
+ switch (vMin) {
+ case 1:
+ return QPSQLDriver::Version81;
+ case 2:
+ return QPSQLDriver::Version82;
+ case 3:
+ return QPSQLDriver::Version83;
+ case 4:
+ return QPSQLDriver::Version84;
+ default:
+ return QPSQLDriver::Version8;
+ }
+ break;
+ }
+ case 9:
+ return QPSQLDriver::Version9;
+ break;
+ default:
+ break;
+ }
+ return QPSQLDriver::VersionUnknown;
+}
+
static QPSQLDriver::Protocol getPSQLVersion(PGconn* connection)
{
QPSQLDriver::Protocol serverVersion = QPSQLDriver::Version6;
@@ -626,50 +669,44 @@
int status = PQresultStatus(result);
if (status == PGRES_COMMAND_OK || status == PGRES_TUPLES_OK) {
QString val = QString::fromAscii(PQgetvalue(result, 0, 0));
+
QRegExp rx(QLatin1String("(\\d+)\\.(\\d+)"));
rx.setMinimal(true); // enforce non-greedy RegExp
+
if (rx.indexIn(val) != -1) {
int vMaj = rx.cap(1).toInt();
int vMin = rx.cap(2).toInt();
+ serverVersion = qMakePSQLVersion(vMaj, vMin);
+#ifdef PG_MAJORVERSION
+ if (rx.indexIn(QLatin1String(PG_MAJORVERSION)) != -1) {
+ vMaj = rx.cap(1).toInt();
+ vMin = rx.cap(2).toInt();
+ }
+ QPSQLDriver::Protocol clientVersion = qMakePSQLVersion(vMaj, vMin);

- switch (vMaj) {
- case 7:
- switch (vMin) {
- case 0:
- serverVersion = QPSQLDriver::Version7;
- break;
- case 1:
- case 2:
- serverVersion = QPSQLDriver::Version71;
- break;
- default:
- serverVersion = QPSQLDriver::Version73;
- break;
- }
- break;
- case 8:
- switch (vMin) {
- case 0:
- serverVersion = QPSQLDriver::Version8;
- break;
- case 1:
- serverVersion = QPSQLDriver::Version81;
- break;
- case 2:
- default:
- serverVersion = QPSQLDriver::Version82;
- break;
- }
- break;
- default:
- break;
+ if (serverVersion >= QPSQLDriver::Version9 && clientVersion <
QPSQLDriver::Version9) {
+ //Client version before QPSQLDriver::Version9 only supports
escape mode for bytea type,
+ //but bytea format is set to hex by default in PSQL 9 and
above. So need to force the
+ //server use the old escape mode when connects to the new
server with old client library.
+ result = PQexec(connection, "SET bytea_output=escape; ");
+ status = PQresultStatus(result);
+ } else if (serverVersion == QPSQLDriver::VersionUnknown) {
+ serverVersion = clientVersion;
+ if (serverVersion != QPSQLDriver::VersionUnknown)
+ qWarning("The server version of this PostgreSQL is unknown,
falling back to the client version.");
}
+#endif
}
}
PQclear(result);

- if (serverVersion < QPSQLDriver::Version71)
+ //keep the old behavior unchanged
+ if (serverVersion == QPSQLDriver::VersionUnknown)
+ serverVersion = QPSQLDriver::Version6;
+
+ if (serverVersion < QPSQLDriver::Version71) {
qWarning("This version of PostgreSQL is not supported and may not
work.");
+ }

return serverVersion;
}
@@ -852,7 +889,10 @@
// This hack can dissapear once there is an API to query this sort of
information.
if (d->pro == QPSQLDriver::Version8 ||
d->pro == QPSQLDriver::Version81 ||
- d->pro == QPSQLDriver::Version82) {
+ d->pro == QPSQLDriver::Version82 ||
+ d->pro == QPSQLDriver::Version83 ||
+ d->pro == QPSQLDriver::Version84 ||
+ d->pro == QPSQLDriver::Version9) {
transaction_failed = qstrcmp(PQcmdStatus(res), "ROLLBACK") == 0;
}

@@ -963,6 +1003,9 @@
case QPSQLDriver::Version8:
case QPSQLDriver::Version81:
case QPSQLDriver::Version82:
+ case QPSQLDriver::Version83:
+ case QPSQLDriver::Version84:
+ case QPSQLDriver::Version9:
stmt = QLatin1String("SELECT pg_attribute.attname,
pg_attribute.atttypid::int, "
"pg_class.relname "
"FROM pg_attribute, pg_class "
@@ -978,6 +1021,9 @@
stmt = stmt.arg(QString::fromLatin1("pg_class.relnamespace =
(select oid from "
"pg_namespace where pg_namespace.nspname = '%1') AND
").arg(schema));
break;
+ case QPSQLDriver::VersionUnknown:
+ qFatal("PSQL version is unknown");
+ break;
}

i.exec(stmt.arg(tbl));
@@ -1046,6 +1092,9 @@
case QPSQLDriver::Version8:
case QPSQLDriver::Version81:
case QPSQLDriver::Version82:
+ case QPSQLDriver::Version83:
+ case QPSQLDriver::Version84:
+ case QPSQLDriver::Version9:
stmt = QLatin1String("select pg_attribute.attname,
pg_attribute.atttypid::int, "
"pg_attribute.attnotnull, pg_attribute.attlen,
pg_attribute.atttypmod, "
"pg_attrdef.adsrc "
@@ -1064,6 +1113,9 @@
stmt = stmt.arg(QString::fromLatin1("pg_class.relnamespace =
(select oid from "
"pg_namespace where pg_namespace.nspname =
'%1')").arg(schema));
break;
+ case QPSQLDriver::VersionUnknown:
+ qFatal("PSQL version is unknown");
+ break;
}

QSqlQuery query(createResult());
--- src/sql/drivers/psql/qsql_psql.h
+++ src/sql/drivers/psql/qsql_psql.h
@@ -97,6 +97,7 @@
Q_OBJECT
public:
enum Protocol {
+ VersionUnknown = -1,
Version6 = 6,
Version7 = 7,
Version71 = 8,
@@ -104,7 +105,10 @@
Version74 = 10,
Version8 = 11,
Version81 = 12,
- Version82 = 13
+ Version82 = 13,
+ Version83 = 14,
+ Version84 = 15,
+ Version9 = 16,
};

explicit QPSQLDriver(QObject *parent=0);


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Remember to have fun...

--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages