diff options
Diffstat (limited to 'src/sql/drivers/odbc/qsql_odbc.cpp')
-rw-r--r-- | src/sql/drivers/odbc/qsql_odbc.cpp | 58 |
1 files changed, 25 insertions, 33 deletions
diff --git a/src/sql/drivers/odbc/qsql_odbc.cpp b/src/sql/drivers/odbc/qsql_odbc.cpp index 23eff8dbe3..f95fb8868e 100644 --- a/src/sql/drivers/odbc/qsql_odbc.cpp +++ b/src/sql/drivers/odbc/qsql_odbc.cpp @@ -5,36 +5,28 @@ ** ** This file is part of the QtSql module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ +** $QT_BEGIN_LICENSE:LGPL21$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** ** $QT_END_LICENSE$ ** ****************************************************************************/ @@ -1668,14 +1660,14 @@ QVariant QODBCResult::lastInsertId() const QString sql; switch (d->driverPrivate->dbmsType) { - case QODBCDriverPrivate::MSSqlServer: - case QODBCDriverPrivate::Sybase: + case QSqlDriver::MSSqlServer: + case QSqlDriver::Sybase: sql = QLatin1String("SELECT @@IDENTITY;"); break; - case QODBCDriverPrivate::MySqlServer: + case QSqlDriver::MySqlServer: sql = QLatin1String("SELECT LAST_INSERT_ID();"); break; - case QODBCDriverPrivate::PostgreSQL: + case QSqlDriver::PostgreSQL: sql = QLatin1String("SELECT lastval();"); break; default: @@ -1815,14 +1807,14 @@ bool QODBCDriver::hasFeature(DriverFeature f) const case CancelQuery: return false; case LastInsertId: - return (d->dbmsType == QODBCDriverPrivate::MSSqlServer) - || (d->dbmsType == QODBCDriverPrivate::Sybase) - || (d->dbmsType == QODBCDriverPrivate::MySqlServer) - || (d->dbmsType == QODBCDriverPrivate::PostgreSQL); + return (d->dbmsType == MSSqlServer) + || (d->dbmsType == Sybase) + || (d->dbmsType == MySqlServer) + || (d->dbmsType == PostgreSQL); case MultipleResultSets: return d->hasMultiResultSets; case BLOB: { - if (d->dbmsType == QODBCDriverPrivate::MySqlServer) + if (d->dbmsType == MySqlServer) return true; else return false; @@ -1919,7 +1911,7 @@ bool QODBCDriver::open(const QString & db, d->checkDateTimePrecision(); setOpen(true); setOpenError(false); - if (d->dbmsType == QODBCDriverPrivate::MSSqlServer) { + if (d->dbmsType == MSSqlServer) { QSqlQuery i(createResult()); i.exec(QLatin1String("SET QUOTED_IDENTIFIER ON")); } @@ -2105,15 +2097,15 @@ void QODBCDriverPrivate::checkDBMS() serverType = QString::fromUtf8((const char *)serverString.constData(), t); #endif if (serverType.contains(QLatin1String("PostgreSQL"), Qt::CaseInsensitive)) - dbmsType = PostgreSQL; + dbmsType = QSqlDriver::PostgreSQL; else if (serverType.contains(QLatin1String("Oracle"), Qt::CaseInsensitive)) - dbmsType = Oracle; + dbmsType = QSqlDriver::Oracle; else if (serverType.contains(QLatin1String("MySql"), Qt::CaseInsensitive)) - dbmsType = MySqlServer; + dbmsType = QSqlDriver::MySqlServer; else if (serverType.contains(QLatin1String("Microsoft SQL Server"), Qt::CaseInsensitive)) - dbmsType = MSSqlServer; + dbmsType = QSqlDriver::MSSqlServer; else if (serverType.contains(QLatin1String("Sybase"), Qt::CaseInsensitive)) - dbmsType = Sybase; + dbmsType = QSqlDriver::Sybase; } r = SQLGetInfo(hDbc, SQL_DRIVER_NAME, |