summaryrefslogtreecommitdiffstats
path: root/src/sql/drivers/tds/qsql_tds.cpp
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/tds/qsql_tds.cpp
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/tds/qsql_tds.cpp')
-rw-r--r--src/sql/drivers/tds/qsql_tds.cpp21
1 files changed, 5 insertions, 16 deletions
diff --git a/src/sql/drivers/tds/qsql_tds.cpp b/src/sql/drivers/tds/qsql_tds.cpp
index 515f0de..46e4a0b 100644
--- a/src/sql/drivers/tds/qsql_tds.cpp
+++ b/src/sql/drivers/tds/qsql_tds.cpp
@@ -293,8 +293,6 @@ QTDSResult::QTDSResult(const QTDSDriver* db)
// insert d in error handler dict
errs()->insert(d->dbproc, d);
- dbcmd(d->dbproc, "set quoted_identifier on");
- dbsqlexec(d->dbproc);
}
QTDSResult::~QTDSResult()
@@ -369,7 +367,7 @@ bool QTDSResult::gotoNext(QSqlCachedResult::ValueCache &values, int index)
if (qIsNull(d->buffer.at(i * 2 + 1)))
values[idx] = QVariant(QVariant::String);
else
- values[idx] = QString::fromLocal8Bit((const char*)d->buffer.at(i * 2)).trimmed();
+ values[idx] = QString::fromLocal8Bit((const char*)d->buffer.at(i * 2));
break;
case QVariant::ByteArray: {
if (qIsNull(d->buffer.at(i * 2 + 1)))
@@ -700,14 +698,9 @@ QSqlRecord QTDSDriver::record(const QString& tablename) const
return info;
QSqlQuery t(createResult());
t.setForwardOnly(true);
-
- QString table = tablename;
- if (isIdentifierEscaped(table, QSqlDriver::TableName))
- table = stripDelimiters(table, QSqlDriver::TableName);
-
QString stmt (QLatin1String("select name, type, length, prec from syscolumns "
"where id = (select id from sysobjects where name = '%1')"));
- t.exec(stmt.arg(table));
+ t.exec(stmt.arg(tablename));
while (t.next()) {
QSqlField f(t.value(0).toString().simplified(), qDecodeTDSType(t.value(1).toInt()));
f.setLength(t.value(2).toInt());
@@ -777,17 +770,13 @@ QSqlIndex QTDSDriver::primaryIndex(const QString& tablename) const
{
QSqlRecord rec = record(tablename);
- QString table = tablename;
- if (isIdentifierEscaped(table, QSqlDriver::TableName))
- table = stripDelimiters(table, QSqlDriver::TableName);
-
- QSqlIndex idx(table);
- if ((!isOpen()) || (table.isEmpty()))
+ QSqlIndex idx(tablename);
+ if ((!isOpen()) || (tablename.isEmpty()))
return QSqlIndex();
QSqlQuery t(createResult());
t.setForwardOnly(true);
- t.exec(QString::fromLatin1("sp_helpindex '%1'").arg(table));
+ t.exec(QString::fromLatin1("sp_helpindex '%1'").arg(tablename));
if (t.next()) {
QStringList fNames = t.value(2).toString().simplified().split(QLatin1Char(','));
QRegExp regx(QLatin1String("\\s*(\\S+)(?:\\s+(DESC|desc))?\\s*"));