diff options
author | Derick Hawcroft <derick.hawcroft@nokia.com> | 2009-06-15 06:30:55 (GMT) |
---|---|---|
committer | Derick Hawcroft <derick.hawcroft@nokia.com> | 2009-06-15 06:30:55 (GMT) |
commit | 034259d7139f4088806a114a4ec5074cc28d46e0 (patch) | |
tree | 1c6bf0c651125dc03df520ca0ca87261e153cdca /src/sql/drivers/tds/qsql_tds.cpp | |
parent | ced6ba7eee785caa7ba89d50f1a02f7f3994c839 (diff) | |
parent | b8430baeadd62b643ff07a2588c62141146c08fd (diff) | |
download | Qt-034259d7139f4088806a114a4ec5074cc28d46e0.zip Qt-034259d7139f4088806a114a4ec5074cc28d46e0.tar.gz Qt-034259d7139f4088806a114a4ec5074cc28d46e0.tar.bz2 |
Merge branch '4.5' of git@scm.dev.nokia.troll.no:qt/qt into 4.5
Diffstat (limited to 'src/sql/drivers/tds/qsql_tds.cpp')
-rw-r--r-- | src/sql/drivers/tds/qsql_tds.cpp | 21 |
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*")); |