summaryrefslogtreecommitdiffstats
path: root/src/sql/kernel/qsqlerror.cpp
diff options
context:
space:
mode:
authorChristian Ehrlicher <ch.ehrlicher@gmx.de>2023-03-05 14:04:53 +0100
committerChristian Ehrlicher <ch.ehrlicher@gmx.de>2023-03-07 22:09:28 +0100
commit4ec5c0efc756a39162b43367438fee965c229ae7 (patch)
tree9a7ee43a6111eaecaf186ce79fa4345150e7d0c9 /src/sql/kernel/qsqlerror.cpp
parent4b197c3f52b443c11e980f87aa035b81948871ce (diff)
SQL/ODBC: Return all native error codes
ODBC can (similar to DB2) return more than one native error code for an error but only the last one was recorded which may made the error diagnostic more complicated. Therefore return a concatenated list of native error codes the way it's done for DB2. [ChangeLog][SQL][ODBC] QSqlError::errorCode() might return a semicolon separated list of native error codes. Fixes: QTBUG-45087 Change-Id: I70d02adeb33e72897f13e0c72fbbd2c60f307e2f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/sql/kernel/qsqlerror.cpp')
-rw-r--r--src/sql/kernel/qsqlerror.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/sql/kernel/qsqlerror.cpp b/src/sql/kernel/qsqlerror.cpp
index fa4daed097..7f56357c10 100644
--- a/src/sql/kernel/qsqlerror.cpp
+++ b/src/sql/kernel/qsqlerror.cpp
@@ -88,9 +88,6 @@ public:
Constructs an error containing the driver error text \a
driverText, the database-specific error text \a databaseText, the
type \a type and the error code \a code.
-
- \note DB2: It is possible for DB2 to report more than one error code.
- When this happens, \c ; is used as separator between the error codes.
*/
QSqlError::QSqlError(const QString &driverText, const QString &databaseText,
ErrorType type, const QString &code)
@@ -192,6 +189,9 @@ QSqlError::ErrorType QSqlError::type() const
/*!
Returns the database-specific error code, or an empty string if
it cannot be determined.
+ \note Some drivers (like DB2 or ODBC) may return more than one
+ error code. When this happens, \c ; is used as separator between
+ the error codes.
*/
QString QSqlError::nativeErrorCode() const