Changeset 561 for trunk/src/sql/drivers/tds/qsql_tds.cpp
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/sql/drivers/tds/qsql_tds.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information ([email protected]) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation ([email protected]) 5 6 ** 6 7 ** This file is part of the QtSql module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you 37 ** @nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 165 165 extern "C" { 166 166 static int CS_PUBLIC qTdsMsgHandler (DBPROCESS* dbproc, 167 DBINT /*msgno*/,167 DBINT , 168 168 int msgstate, 169 169 int severity, 170 170 char* msgtext, 171 char* /*srvname*/,171 char* , 172 172 char* /*procname*/, 173 int /*line*/)173 int ) 174 174 { 175 175 QTDSResultPrivate* p = errs()->value(dbproc); … … 182 182 183 183 if (severity > 0) { 184 QString errMsg = QString(QLatin1String("%1 (%2)")).arg(QString::fromAscii(msgtext)).arg( 185 msgstate); 184 QString errMsg = QString::fromLatin1("%1 (Msg %2, Level %3, State %4, Server %5, Line %6)") 185 .arg(QString::fromAscii(msgtext)) 186 .arg(msgno) 187 .arg(severity) 188 .arg(msgstate) 189 .arg(QString::fromAscii(srvname)) 190 .arg(line); 186 191 p->addErrorMsg(errMsg); 192 193 194 195 196 197 187 198 } 188 199 … … 212 223 213 224 214 QString errMsg = QString (QLatin1String("%1 %2\n")).arg(QString::fromAscii(dberrstr)).arg(215 Q String::fromAscii(oserrstr));225 QString errMsg = QString(dberrstr)).arg( 226 Q(oserrstr)); 216 227 errMsg += p->getErrorMsgs(); 217 228 p->lastError = qMakeError(errMsg, QSqlError::UnknownError, dberr); … … 294 305 // insert d in error handler dict 295 306 errs()->insert(d->dbproc, d); 307 308 296 309 } 297 310 … … 368 381 values[idx] = QVariant(QVariant::String); 369 382 else 370 values[idx] = QString::fromLocal8Bit((const char*)d->buffer.at(i * 2)) ;383 values[idx] = QString::fromLocal8Bit((const char*)d->buffer.at(i * 2)); 371 384 break; 372 385 case QVariant::ByteArray: { … … 699 712 QSqlQuery t(createResult()); 700 713 t.setForwardOnly(true); 714 715 716 717 718 701 719 QString stmt (QLatin1String("select name, type, length, prec from syscolumns " 702 720 "where id = (select id from sysobjects where name = '%1')")); 703 t.exec(stmt.arg(table name));721 t.exec(stmt.arg(table)); 704 722 while (t.next()) { 705 723 QSqlField f(t.value(0).toString().simplified(), qDecodeTDSType(t.value(1).toInt())); … … 748 766 else if (field.type() == QVariant::DateTime) { 749 767 if (field.value().toDateTime().isValid()){ 750 r = field.value().toDateTime().toString(QLatin1String("'yyyyMMdd hh:mm:ss'")); 768 r = field.value().toDateTime().toString(QLatin1String("yyyyMMdd hh:mm:ss")); 769 r.prepend(QLatin1String("'")); 770 r.append(QLatin1String("'")); 751 771 } else 752 772 r = QLatin1String("NULL"); … … 771 791 QSqlRecord rec = record(tablename); 772 792 773 QSqlIndex idx(tablename); 774 if ((!isOpen()) || (tablename.isEmpty())) 793 QString table = tablename; 794 if (isIdentifierEscaped(table, QSqlDriver::TableName)) 795 table = stripDelimiters(table, QSqlDriver::TableName); 796 797 QSqlIndex idx(table); 798 if ((!isOpen()) || (table.isEmpty())) 775 799 return QSqlIndex(); 776 800 777 801 QSqlQuery t(createResult()); 778 802 t.setForwardOnly(true); 779 t.exec(QString::fromLatin1("sp_helpindex '%1'").arg(table name));803 t.exec(QString::fromLatin1("sp_helpindex '%1'").arg(table)); 780 804 if (t.next()) { 781 805 QStringList fNames = t.value(2).toString().simplified().split(QLatin1Char(',')); … … 795 819 } 796 820 821 822 823 824 825 826 827 828 829 830 831 797 832 QT_END_NAMESPACE
Note:
See TracChangeset
for help on using the changeset viewer.