SQL/ODBC: don't escape a driver string
We must not try to escape a driver string, the user has to make sure that everything is correctly escaped when passing a complete driver string. This fixes a regression from QTBUG-122642. Fixes: QTBUG-123444 Change-Id: I43316c7a09060f5c8117fdc3c464d239e37d9cdf Reviewed-by: Mark Brand <mabrand@mabrand.nl> (cherry picked from commit 9873f4b283dcabefc20b1720bef1958c2b1ccc02) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
81581819c7
commit
8f25cdc94e
@ -1968,7 +1968,7 @@ bool QODBCDriver::open(const QString & db,
|
|||||||
connQStr = "FILEDSN="_L1 + ensureEscaped(db);
|
connQStr = "FILEDSN="_L1 + ensureEscaped(db);
|
||||||
else if (db.contains("DRIVER="_L1, Qt::CaseInsensitive)
|
else if (db.contains("DRIVER="_L1, Qt::CaseInsensitive)
|
||||||
|| db.contains("SERVER="_L1, Qt::CaseInsensitive))
|
|| db.contains("SERVER="_L1, Qt::CaseInsensitive))
|
||||||
connQStr = ensureEscaped(db);
|
connQStr = db;
|
||||||
else
|
else
|
||||||
connQStr = "DSN="_L1 + ensureEscaped(db);
|
connQStr = "DSN="_L1 + ensureEscaped(db);
|
||||||
|
|
||||||
|
@ -404,15 +404,20 @@
|
|||||||
of the ODBC driver. ODBC support can be used as a fallback for compliant
|
of the ODBC driver. ODBC support can be used as a fallback for compliant
|
||||||
databases if no native driver is available.
|
databases if no native driver is available.
|
||||||
|
|
||||||
On Windows, an ODBC driver manager should be installed by default.
|
On Windows, an ODBC driver manager is installed by default.
|
||||||
For Unix systems, there are some implementations which must be
|
For Unix systems, there are some implementations which must be
|
||||||
installed first. Note that every end user of your application is
|
installed first. Note that every end user of your application is
|
||||||
required to have an ODBC driver manager installed, otherwise the
|
required to have an ODBC driver manager installed, otherwise the
|
||||||
QODBC plugin will not work.
|
QODBC plugin will not work.
|
||||||
|
|
||||||
When connecting to an ODBC datasource, you should pass the name
|
When connecting to an ODBC datasource, you should pass the name
|
||||||
of the ODBC datasource to the QSqlDatabase::setDatabaseName()
|
of the ODBC datasource (DSN) to the QSqlDatabase::setDatabaseName()
|
||||||
function, rather than the actual database name.
|
function, rather than the actual database name.
|
||||||
|
It's also possible to pass a FILEDSN (*.dsn) filename or a complete
|
||||||
|
ODBC driver string. When passing a driver string you must make sure,
|
||||||
|
that all parameters (username, password, ...) are properly escaped.
|
||||||
|
Passing the username or password through the QSqlDatabase functions,
|
||||||
|
the escaping is done by the QODBC plugin.
|
||||||
|
|
||||||
The QODBC Plugin needs an ODBC compliant driver manager version 2.0 or
|
The QODBC Plugin needs an ODBC compliant driver manager version 2.0 or
|
||||||
later. Some ODBC drivers claim to be version-2.0-compliant,
|
later. Some ODBC drivers claim to be version-2.0-compliant,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user