summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2009-11-04 03:55:59 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2009-11-04 03:55:59 (GMT)
commite2ecd43f569f172909fdd3e02fe3c1b70b02fc9e (patch)
tree03886843b681a05db08caae800b4b2c93b284d5d /src
parent936a4571f0997d776c4672ea298c9840f676042d (diff)
parent064383eba647c2729e283f68db2394cb6a8df0c3 (diff)
downloadQt-e2ecd43f569f172909fdd3e02fe3c1b70b02fc9e.zip
Qt-e2ecd43f569f172909fdd3e02fe3c1b70b02fc9e.tar.gz
Qt-e2ecd43f569f172909fdd3e02fe3c1b70b02fc9e.tar.bz2
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6
Diffstat (limited to 'src')
-rw-r--r--src/sql/drivers/tds/qsql_tds.cpp21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/sql/drivers/tds/qsql_tds.cpp b/src/sql/drivers/tds/qsql_tds.cpp
index 2508833..ca1502c 100644
--- a/src/sql/drivers/tds/qsql_tds.cpp
+++ b/src/sql/drivers/tds/qsql_tds.cpp
@@ -164,13 +164,13 @@ Q_GLOBAL_STATIC(QTDSErrorHash, errs)
extern "C" {
static int CS_PUBLIC qTdsMsgHandler (DBPROCESS* dbproc,
- DBINT /*msgno*/,
+ DBINT msgno,
int msgstate,
int severity,
char* msgtext,
- char* /*srvname*/,
+ char* srvname,
char* /*procname*/,
- int /*line*/)
+ int line)
{
QTDSResultPrivate* p = errs()->value(dbproc);
@@ -181,9 +181,20 @@ static int CS_PUBLIC qTdsMsgHandler (DBPROCESS* dbproc,
}
if (severity > 0) {
- QString errMsg = QString::fromLatin1("%1 (%2)").arg(QString::fromAscii(msgtext)).arg(
- msgstate);
+ QString errMsg = QString::fromLatin1("%1 (Msg %2, Level %3, State %4, Server %5, Line %6)")
+ .arg(QString::fromAscii(msgtext))
+ .arg(msgno)
+ .arg(severity)
+ .arg(msgstate)
+ .arg(QString::fromAscii(srvname))
+ .arg(line);
p->addErrorMsg(errMsg);
+ if (severity > 10) {
+ // Severe messages are really errors in the sense of lastError
+ errMsg = p->getErrorMsgs();
+ p->lastError = qMakeError(errMsg, QSqlError::UnknownError, msgno);
+ p->clearErrorMsgs();
+ }
}
return INT_CANCEL;