diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-12-05 18:52:38 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-12-05 18:52:38 +0100 |
commit | f6dbdd9c16166f345fd5743886229192c97c2c4f (patch) | |
tree | 05e5e7b806dd627be4e3ba6fc9a32f115847acb0 /src/sql | |
parent | b8084618545570a8832d344a2e9586e1226cc697 (diff) | |
parent | 47efa9213d92a4366e03bd6d056837cd5bbadb1e (diff) |
Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
src/sql/drivers/sqlite/qsql_sqlite.cpp
Change-Id: Ia7cffd2c99ae3d5eea6b5740683c06e921336dcd
Diffstat (limited to 'src/sql')
-rw-r--r-- | src/sql/doc/src/sql-driver.qdoc | 16 | ||||
-rw-r--r-- | src/sql/drivers/ibase/qsql_ibase.cpp | 9 | ||||
-rw-r--r-- | src/sql/drivers/oci/qsql_oci.cpp | 1 | ||||
-rw-r--r-- | src/sql/drivers/sqlite/qsql_sqlite.cpp | 28 |
4 files changed, 33 insertions, 21 deletions
diff --git a/src/sql/doc/src/sql-driver.qdoc b/src/sql/doc/src/sql-driver.qdoc index 82dfa27e46..92727b2d1c 100644 --- a/src/sql/doc/src/sql-driver.qdoc +++ b/src/sql/doc/src/sql-driver.qdoc @@ -151,9 +151,8 @@ \snippet code/doc_src_sql-driver.qdoc 3 - After installing Qt, as described in the \l{Installing Qt for X11 - Platforms} document, you also need to install the plugin in the - standard location: + After installing Qt, you also need to install the plugin in the standard + location: \snippet code/doc_src_sql-driver.qdoc 4 @@ -478,8 +477,8 @@ \snippet code/doc_src_sql-driver.qdoc 13 - After installing Qt, as described in the \l{Installing Qt for X11 Platforms} document, - you also need to install the plugin in the standard location: + After installing Qt, you also need to install the plugin in the standard + location: \snippet code/doc_src_sql-driver.qdoc 14 @@ -565,8 +564,8 @@ \snippet code/doc_src_sql-driver.qdoc 18 - After installing Qt, as described in the \l{Installing Qt for X11 Platforms} document, - you also need to install the plugin in the standard location: + After installing Qt, you also need to install the plugin in the standard + location: \snippet code/doc_src_sql-driver.qdoc 19 @@ -640,8 +639,7 @@ \snippet code/doc_src_sql-driver.qdoc 21 - After installing Qt, as described in the \l{Installing Qt for X11 Platforms} document, - you also need to install the plugin in the standard location: + After installing Qt, you also need to install the plugin in the standard location: \snippet code/doc_src_sql-driver.qdoc 22 diff --git a/src/sql/drivers/ibase/qsql_ibase.cpp b/src/sql/drivers/ibase/qsql_ibase.cpp index 05e9a4aac8..98da296240 100644 --- a/src/sql/drivers/ibase/qsql_ibase.cpp +++ b/src/sql/drivers/ibase/qsql_ibase.cpp @@ -1445,7 +1445,7 @@ bool QIBaseDriver::open(const QString & db, const QString & user, const QString & password, const QString & host, - int /*port*/, + int port, const QString & connOpts) { Q_D(QIBaseDriver); @@ -1513,9 +1513,13 @@ bool QIBaseDriver::open(const QString & db, i += role.length(); } + QString portString; + if (port != -1) + portString = QStringLiteral("/%1").arg(port); + QString ldb; if (!host.isEmpty()) - ldb += host + QLatin1Char(':'); + ldb += host + portString + QLatin1Char(':'); ldb += db; isc_attach_database(d->status, 0, const_cast<char *>(ldb.toLocal8Bit().constData()), &d->ibase, i, ba.data()); @@ -1526,6 +1530,7 @@ bool QIBaseDriver::open(const QString & db, } setOpen(true); + setOpenError(false); return true; } diff --git a/src/sql/drivers/oci/qsql_oci.cpp b/src/sql/drivers/oci/qsql_oci.cpp index fe9ae42e6f..6843407e9c 100644 --- a/src/sql/drivers/oci/qsql_oci.cpp +++ b/src/sql/drivers/oci/qsql_oci.cpp @@ -2159,6 +2159,7 @@ bool QOCIDriver::hasFeature(DriverFeature f) const case SimpleLocking: case EventNotifications: case FinishQuery: + case CancelQuery: case MultipleResultSets: return false; case Unicode: diff --git a/src/sql/drivers/sqlite/qsql_sqlite.cpp b/src/sql/drivers/sqlite/qsql_sqlite.cpp index 3f93f34ee4..36a4b7d0c4 100644 --- a/src/sql/drivers/sqlite/qsql_sqlite.cpp +++ b/src/sql/drivers/sqlite/qsql_sqlite.cpp @@ -597,24 +597,32 @@ bool QSQLiteDriver::open(const QString & db, const QString &, const QString &, c if (isOpen()) close(); + + int timeOut = 5000; bool sharedCache = false; - int openMode = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, timeOut=5000; - QStringList opts=QString(conOpts).remove(QLatin1Char(' ')).split(QLatin1Char(';')); - foreach(const QString &option, opts) { + bool openReadOnlyOption = false; + bool openUriOption = false; + + const QStringList opts = QString(conOpts).remove(QLatin1Char(' ')).split(QLatin1Char(';')); + foreach (const QString &option, opts) { if (option.startsWith(QLatin1String("QSQLITE_BUSY_TIMEOUT="))) { bool ok; - int nt = option.mid(21).toInt(&ok); + const int nt = option.mid(21).toInt(&ok); if (ok) timeOut = nt; - } - if (option == QLatin1String("QSQLITE_OPEN_READONLY")) - openMode = SQLITE_OPEN_READONLY; - if (option == QLatin1String("QSQLITE_OPEN_URI")) - openMode |= SQLITE_OPEN_URI; - if (option == QLatin1String("QSQLITE_ENABLE_SHARED_CACHE")) + } else if (option == QLatin1String("QSQLITE_OPEN_READONLY")) { + openReadOnlyOption = true; + } else if (option == QLatin1String("QSQLITE_OPEN_URI")) { + openUriOption = true; + } else if (option == QLatin1String("QSQLITE_ENABLE_SHARED_CACHE")) { sharedCache = true; + } } + int openMode = (openReadOnlyOption ? SQLITE_OPEN_READONLY : (SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE)); + if (openUriOption) + openMode |= SQLITE_OPEN_URI; + sqlite3_enable_shared_cache(sharedCache); if (sqlite3_open_v2(db.toUtf8().constData(), &d->access, openMode, NULL) == SQLITE_OK) { |