summaryrefslogtreecommitdiffstats
path: root/src/sql/drivers/sqlite
diff options
context:
space:
mode:
authorBill King <bill.king@nokia.com>2009-06-15 00:28:47 (GMT)
committerBill King <bill.king@nokia.com>2009-06-15 03:09:19 (GMT)
commitb8430baeadd62b643ff07a2588c62141146c08fd (patch)
treedc2d7d5e0add68df3b60b67faeaa778617b76ced /src/sql/drivers/sqlite
parent16fe846058aa0a89577660d18bdc0aceda7fecfd (diff)
downloadQt-b8430baeadd62b643ff07a2588c62141146c08fd.zip
Qt-b8430baeadd62b643ff07a2588c62141146c08fd.tar.gz
Qt-b8430baeadd62b643ff07a2588c62141146c08fd.tar.bz2
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')
-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 f732077..605c4e8 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("\".\""));