summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2021-01-13 13:23:30 +0100
committerAndy Shaw <andy.shaw@qt.io>2021-01-14 19:53:16 +0000
commit4d3d981144d810fbf1fe263741d36b07a9227621 (patch)
treeeb89cd123536e04f6019ec9cea637add8ef027ae /src/plugins
parent00505ed2b57d0a6911c8274af2bff883a93f583a (diff)
Interbase: Don't error out if closing an already closed cursor
Pick-to: 6.0 5.15 Change-Id: If6964f5ae45c5ca4c0b34e417326fea1f33d7628 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/sqldrivers/ibase/qsql_ibase.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/plugins/sqldrivers/ibase/qsql_ibase.cpp b/src/plugins/sqldrivers/ibase/qsql_ibase.cpp
index 82ea0919a5..384bb93fd7 100644
--- a/src/plugins/sqldrivers/ibase/qsql_ibase.cpp
+++ b/src/plugins/sqldrivers/ibase/qsql_ibase.cpp
@@ -1060,8 +1060,14 @@ bool QIBaseResult::exec()
if (ok) {
isc_dsql_free_statement(d->status, &d->stmt, DSQL_close);
- if (d->isError(QT_TRANSLATE_NOOP("QIBaseResult", "Unable to close statement")))
+ QString imsg;
+ ISC_LONG sqlcode;
+ if (getIBaseError(imsg, d->status, sqlcode) && sqlcode != -501) {
+ setLastError(QSqlError(QCoreApplication::translate("QIBaseResult", "Unable to close statement"),
+ imsg, QSqlError::UnknownError,
+ sqlcode != -1 ? QString::number(sqlcode) : QString()));
return false;
+ }
if (colCount() && d->queryType != isc_info_sql_stmt_exec_procedure) {
cleanup();
}