diff options
author | Liang Qi <liang.qi@qt.io> | 2018-02-19 14:56:24 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-02-19 16:02:52 +0100 |
commit | 48577b2e7f17a26c1d903cb8ecbd30e41c231137 (patch) | |
tree | e7498f68a15e2e18b8412eefe7f248d379d94d99 /src | |
parent | fa0906bc5664913f232721d611e6e7906892d766 (diff) | |
parent | 6c6ace9d23f90845fd424e474d38fe30f070775e (diff) |
Merge remote-tracking branch 'origin/5.10.1' into 5.11
Conflicts:
src/plugins/sqldrivers/psql/qsql_psql.cpp
Change-Id: I070b455078b41e75c46562fcea5676d6218cd00c
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/tools/qstring.cpp | 9 | ||||
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoawindow.mm | 2 | ||||
-rw-r--r-- | src/plugins/sqldrivers/psql/qsql_psql.cpp | 11 |
3 files changed, 8 insertions, 14 deletions
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 08fe9b899d..b56ad34546 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -568,10 +568,6 @@ static int ucstricmp(const QChar *a, const QChar *ae, const QChar *b, const QCha { if (a == b) return (ae - be); - if (a == 0) - return be - b; - if (b == 0) - return a - ae; const QChar *e = ae; if (be - b < ae - a) @@ -600,11 +596,6 @@ static int ucstricmp(const QChar *a, const QChar *ae, const QChar *b, const QCha // Case-insensitive comparison between a Unicode string and a QLatin1String static int ucstricmp(const QChar *a, const QChar *ae, const char *b, const char *be) { - if (!a) - return be - b; - if (!b) - return a - ae; - auto e = ae; if (be - b < ae - a) e = a + (be - b); diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index ca580e7d17..d0593a473d 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -1131,7 +1131,7 @@ void QCocoaWindow::handleGeometryChange() // Guard against processing window system events during QWindow::setGeometry // calls, which Qt and Qt applications do not expect. if (!m_inSetGeometry) - QWindowSystemInterface::flushWindowSystemEvents(); + QWindowSystemInterface::flushWindowSystemEvents(QEventLoop::ExcludeUserInputEvents | QEventLoop::ExcludeSocketNotifiers); } void QCocoaWindow::handleExposeEvent(const QRegion ®ion) diff --git a/src/plugins/sqldrivers/psql/qsql_psql.cpp b/src/plugins/sqldrivers/psql/qsql_psql.cpp index 6f105f79ca..368b777ca5 100644 --- a/src/plugins/sqldrivers/psql/qsql_psql.cpp +++ b/src/plugins/sqldrivers/psql/qsql_psql.cpp @@ -204,6 +204,7 @@ public: void setDatestyle(); void setByteaOutput(); void detectBackslashEscape(); + mutable QHash<int, QString> oidToTable; }; void QPSQLDriverPrivate::appendTables(QStringList &tl, QSqlQuery &t, QChar type) @@ -815,18 +816,20 @@ QSqlRecord QPSQLResult::record() const f.setName(QString::fromUtf8(PQfname(d->result, i))); else f.setName(QString::fromLocal8Bit(PQfname(d->result, i))); - + const int tableOid = PQftable(d->result, i); + auto &tableName = d->drv_d_func()->oidToTable[tableOid]; // WARNING: We cannot execute any other SQL queries on // the same db connection while forward-only mode is active // (this would discard all results of forward-only query). // So we just skip this... - if (!isForwardOnly()) { + if (tableName.isEmpty() && !isForwardOnly()) { QSqlQuery qry(driver()->createResult()); if (qry.exec(QStringLiteral("SELECT relname FROM pg_class WHERE pg_class.oid = %1") - .arg(PQftable(d->result, i))) && qry.next()) { - f.setTableName(qry.value(0).toString()); + .arg(tableOid)) && qry.next()) { + tableName = qry.value(0).toString(); } } + f.setTableName(tableName); int ptype = PQftype(d->result, i); f.setType(qDecodePSQLType(ptype)); int len = PQfsize(d->result, i); |