summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMatt Newell <newellm@blur.com>2012-03-22 17:42:56 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-01-27 00:01:19 (GMT)
commitaa1b7f3c11d3f222e5c5029c603e9982d0a10e1c (patch)
treef5d23a2c96d336bef913de776eed9ec187a00f20 /tests
parent131ccbb445ae13402c35e957b64153644fd4d09c (diff)
downloadQt-aa1b7f3c11d3f222e5c5029c603e9982d0a10e1c.zip
Qt-aa1b7f3c11d3f222e5c5029c603e9982d0a10e1c.tar.gz
Qt-aa1b7f3c11d3f222e5c5029c603e9982d0a10e1c.tar.bz2
Fix postgres notification support in the QPSQLDriver.
This patch fixes a critical bug in the qsqlpsql driver where notifications aren't delivered when received. Any blocking libpq function(specifically PQexec) will read all the incoming data from the socket, including any pending notifications. This would cause the socket notifier to never be fired for incoming notifications that are already queued inside libpq. The qsqldriver test case was skipping the postgres notification test because of this bug, now its enabled and passing. In order to fix this bug I made a wrapper function for PQexec in QPSQLDriverPrivate that calls _q_handleNotification via QMetaObject::callMethod QueuedConnection in order to deliver pending notifications when control returns to the event loop. I also added a flag to ensure only one call is made each time the event loop is entered. This backport omits the changes to the NotificationSource version of the "notification" signal that were included in the original commit, since NotificationSource itself has not yet been introduced into Qt4. (Backport of qtbase aea684506945a12312fc05fb3bb4f549da93f7f5) Change-Id: I19f5297094ae7ae46bfb0717e4fca744d69f7b92 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qsqldatabase/tst_qsqldatabase.cpp4
1 files changed, 0 insertions, 4 deletions
diff --git a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp
index fda678b..bbd08bd 100644
--- a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp
+++ b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp
@@ -2415,10 +2415,6 @@ void tst_QSqlDatabase::eventNotificationPSQL()
QSqlDatabase db = QSqlDatabase::database(dbName);
CHECK_DATABASE(db);
-#if defined(Q_OS_LINUX)
- QSKIP( "Event support doesn't work on linux", SkipAll );
-#endif
-
QSqlQuery query(db);
QString procedureName = qTableName("posteventProc", __FILE__);