summaryrefslogtreecommitdiffstats
path: root/src/sql
diff options
context:
space:
mode:
Diffstat (limited to 'src/sql')
-rw-r--r--src/sql/drivers/ibase/qsql_ibase.cpp14
-rw-r--r--src/sql/kernel/qsqlquery.cpp2
2 files changed, 13 insertions, 3 deletions
diff --git a/src/sql/drivers/ibase/qsql_ibase.cpp b/src/sql/drivers/ibase/qsql_ibase.cpp
index d50078b5ff..cc26bfe7e8 100644
--- a/src/sql/drivers/ibase/qsql_ibase.cpp
+++ b/src/sql/drivers/ibase/qsql_ibase.cpp
@@ -1313,6 +1313,7 @@ int QIBaseResult::numRowsAffected()
{
static char acCountInfo[] = {isc_info_sql_records};
char cCountType;
+ bool bIsProcedure = false;
switch (d->queryType) {
case isc_info_sql_stmt_select:
@@ -1327,6 +1328,9 @@ int QIBaseResult::numRowsAffected()
case isc_info_sql_stmt_insert:
cCountType = isc_info_req_insert_count;
break;
+ case isc_info_sql_stmt_exec_procedure:
+ bIsProcedure = true; // will sum all changes
+ break;
default:
qWarning() << "numRowsAffected: Unknown statement type (" << d->queryType << ")";
return -1;
@@ -1344,8 +1348,14 @@ int QIBaseResult::numRowsAffected()
pcBuf += 2;
int iValue = isc_vax_integer (pcBuf, sLength);
pcBuf += sLength;
-
- if (cType == cCountType) {
+ if (bIsProcedure) {
+ if (cType == isc_info_req_insert_count || cType == isc_info_req_update_count
+ || cType == isc_info_req_delete_count) {
+ if (iResult == -1)
+ iResult = 0;
+ iResult += iValue;
+ }
+ } else if (cType == cCountType) {
iResult = iValue;
break;
}
diff --git a/src/sql/kernel/qsqlquery.cpp b/src/sql/kernel/qsqlquery.cpp
index 0cfc37833d..b08f6bc8ef 100644
--- a/src/sql/kernel/qsqlquery.cpp
+++ b/src/sql/kernel/qsqlquery.cpp
@@ -311,7 +311,7 @@ QSqlQuery& QSqlQuery::operator=(const QSqlQuery& other)
/*!
Returns \c true if the query is not \l{isActive()}{active},
the query is not positioned on a valid record,
- there is no such field, or the field is null; otherwise \c false.
+ there is no such \a field, or the \a field is null; otherwise \c false.
Note that for some drivers, isNull() will not return accurate
information until after an attempt is made to retrieve data.