summaryrefslogtreecommitdiffstats
path: root/src/sql/drivers/sqlite/qsql_sqlite.cpp
diff options
context:
space:
mode:
authorBill King <bill.king@nokia.com>2009-06-15 10:28:47 +1000
committerBill King <bill.king@nokia.com>2009-06-15 13:09:19 +1000
commitb8430baeadd62b643ff07a2588c62141146c08fd (patch)
treedc2d7d5e0add68df3b60b67faeaa778617b76ced /src/sql/drivers/sqlite/qsql_sqlite.cpp
parent16fe846058aa0a89577660d18bdc0aceda7fecfd (diff)
BT Revert "Fix the behaviour of sql classes regarding quoted identifiers"
This reverts commit bb7bddc47dd0748b45d22180d9e3c8e5209010b3 due to forward binary compatibility issues in a point release.
Diffstat (limited to 'src/sql/drivers/sqlite/qsql_sqlite.cpp')
-rw-r--r--src/sql/drivers/sqlite/qsql_sqlite.cpp16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/sql/drivers/sqlite/qsql_sqlite.cpp b/src/sql/drivers/sqlite/qsql_sqlite.cpp
index f732077a93..605c4e8cd3 100644
--- a/src/sql/drivers/sqlite/qsql_sqlite.cpp
+++ b/src/sql/drivers/sqlite/qsql_sqlite.cpp
@@ -661,13 +661,9 @@ QSqlIndex QSQLiteDriver::primaryIndex(const QString &tblname) const
if (!isOpen())
return QSqlIndex();
- QString table = tblname;
- if (isIdentifierEscaped(table, QSqlDriver::TableName))
- table = stripDelimiters(table, QSqlDriver::TableName);
-
QSqlQuery q(createResult());
q.setForwardOnly(true);
- return qGetTableInfo(q, table, true);
+ return qGetTableInfo(q, tblname, true);
}
QSqlRecord QSQLiteDriver::record(const QString &tbl) const
@@ -675,13 +671,9 @@ QSqlRecord QSQLiteDriver::record(const QString &tbl) const
if (!isOpen())
return QSqlRecord();
- QString table = tbl;
- if (isIdentifierEscaped(table, QSqlDriver::TableName))
- table = stripDelimiters(table, QSqlDriver::TableName);
-
QSqlQuery q(createResult());
q.setForwardOnly(true);
- return qGetTableInfo(q, table);
+ return qGetTableInfo(q, tbl);
}
QVariant QSQLiteDriver::handle() const
@@ -689,10 +681,10 @@ QVariant QSQLiteDriver::handle() const
return qVariantFromValue(d->access);
}
-QString QSQLiteDriver::escapeIdentifier(const QString &identifier, IdentifierType type) const
+QString QSQLiteDriver::escapeIdentifier(const QString &identifier, IdentifierType /*type*/) const
{
QString res = identifier;
- if(!identifier.isEmpty() && !isIdentifierEscaped(identifier, type) ) {
+ if(!identifier.isEmpty() && identifier.left(1) != QString(QLatin1Char('"')) && identifier.right(1) != QString(QLatin1Char('"')) ) {
res.replace(QLatin1Char('"'), QLatin1String("\"\""));
res.prepend(QLatin1Char('"')).append(QLatin1Char('"'));
res.replace(QLatin1Char('.'), QLatin1String("\".\""));