summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/qt3support/sql/q3sqlcursor.cpp2
-rw-r--r--src/sql/drivers/db2/qsql_db2.cpp4
2 files changed, 4 insertions, 2 deletions
diff --git a/src/qt3support/sql/q3sqlcursor.cpp b/src/qt3support/sql/q3sqlcursor.cpp
index 6b0c69f..aa6aae2 100644
--- a/src/qt3support/sql/q3sqlcursor.cpp
+++ b/src/qt3support/sql/q3sqlcursor.cpp
@@ -879,7 +879,7 @@ QString Q3SqlCursor::toString(const QString& prefix, QSqlField* field, const QSt
{
QString f;
if (field && driver()) {
- f = (prefix.length() > 0 ? prefix + QLatin1Char('.') : QString()) + field->name();
+ f = (prefix.length() > 0 ? prefix + QLatin1Char('.') : QString()) + driver()->escapeIdentifier(field->name(), QSqlDriver::FieldName);
f += QLatin1Char(' ') + fieldSep + QLatin1Char(' ');
if (field->isNull()) {
f += QLatin1String("NULL");
diff --git a/src/sql/drivers/db2/qsql_db2.cpp b/src/sql/drivers/db2/qsql_db2.cpp
index 474c53d..a32b3aa 100644
--- a/src/sql/drivers/db2/qsql_db2.cpp
+++ b/src/sql/drivers/db2/qsql_db2.cpp
@@ -868,11 +868,13 @@ bool QDB2Result::fetch(int i)
SQL_FETCH_ABSOLUTE,
actualIdx);
}
- if (r != SQL_SUCCESS && r != SQL_SUCCESS_WITH_INFO) {
+ if (r != SQL_SUCCESS && r != SQL_SUCCESS_WITH_INFO && r != SQL_NO_DATA) {
setLastError(qMakeError(QCoreApplication::translate("QDB2Result",
"Unable to fetch record %1").arg(i), QSqlError::StatementError, d));
return false;
}
+ else if (r == SQL_NO_DATA)
+ return false;
setAt(i);
return true;
}