aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--odb/mssql/statement.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/odb/mssql/statement.cxx b/odb/mssql/statement.cxx
index 960a61a..4283b55 100644
--- a/odb/mssql/statement.cxx
+++ b/odb/mssql/statement.cxx
@@ -1042,8 +1042,9 @@ namespace odb
if (!SQL_SUCCEEDED (r))
translate_error (r, conn_, stmt_);
- // Fetch the row containing the id/version if this statement is
- // returning.
+ // Fetch the row containing the version if this statement is
+ // returning. We still need to close the cursor even if we
+ // haven't updated any rows.
//
if (returning_version_)
{
@@ -1059,7 +1060,7 @@ namespace odb
translate_error (r, conn_, stmt_);
}
- if (r == SQL_NO_DATA)
+ if (rows != 0 && r == SQL_NO_DATA)
throw database_exception (
0,
"?????",