summaryrefslogtreecommitdiffstats
path: root/src/sql/drivers/sqlite2/qsql_sqlite2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/sql/drivers/sqlite2/qsql_sqlite2.cpp')
-rw-r--r--src/sql/drivers/sqlite2/qsql_sqlite2.cpp24
1 files changed, 5 insertions, 19 deletions
diff --git a/src/sql/drivers/sqlite2/qsql_sqlite2.cpp b/src/sql/drivers/sqlite2/qsql_sqlite2.cpp
index d0c6e18..76bef08 100644
--- a/src/sql/drivers/sqlite2/qsql_sqlite2.cpp
+++ b/src/sql/drivers/sqlite2/qsql_sqlite2.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtSql module of the Qt Toolkit.
**
@@ -34,7 +34,7 @@
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
+** contact the sales department at http://www.qtsoftware.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -167,15 +167,7 @@ void QSQLite2ResultPrivate::init(const char **cnames, int numCols)
for (int i = 0; i < numCols; ++i) {
const char* lastDot = strrchr(cnames[i], '.');
const char* fieldName = lastDot ? lastDot + 1 : cnames[i];
-
- //remove quotations around the field name if any
- QString fieldStr = QString::fromAscii(fieldName);
- QString quote = QString::fromLatin1("\"");
- if ( fieldStr.length() > 2 && fieldStr.left(1) == quote && fieldStr.right(1) == quote) {
- fieldStr = fieldStr.mid(1);
- fieldStr.chop(1);
- }
- rInf.append(QSqlField(fieldStr,
+ rInf.append(QSqlField(QString::fromAscii(fieldName),
nameToType(QString::fromAscii(cnames[i+numCols]))));
}
}
@@ -511,11 +503,8 @@ QSqlIndex QSQLite2Driver::primaryIndex(const QString &tblname) const
QSqlQuery q(createResult());
q.setForwardOnly(true);
- QString table = tblname;
- if (isIdentifierEscaped(table, QSqlDriver::TableName))
- table = stripDelimiters(table, QSqlDriver::TableName);
// finrst find a UNIQUE INDEX
- q.exec(QLatin1String("PRAGMA index_list('") + table + QLatin1String("');"));
+ q.exec(QLatin1String("PRAGMA index_list('") + tblname + QLatin1String("');"));
QString indexname;
while(q.next()) {
if (q.value(2).toInt()==1) {
@@ -528,7 +517,7 @@ QSqlIndex QSQLite2Driver::primaryIndex(const QString &tblname) const
q.exec(QLatin1String("PRAGMA index_info('") + indexname + QLatin1String("');"));
- QSqlIndex index(table, indexname);
+ QSqlIndex index(tblname, indexname);
while(q.next()) {
QString name = q.value(2).toString();
QVariant::Type type = QVariant::Invalid;
@@ -543,9 +532,6 @@ QSqlRecord QSQLite2Driver::record(const QString &tbl) const
{
if (!isOpen())
return QSqlRecord();
- QString table = tbl;
- if (isIdentifierEscaped(tbl, QSqlDriver::TableName))
- table = stripDelimiters(table, QSqlDriver::TableName);
QSqlQuery q(createResult());
q.setForwardOnly(true);