diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2013-05-21 18:12:57 -0400 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2013-05-21 18:12:57 -0400 |
commit | 2475b7eaf84805e4ec4f5b29e1510e73876a0542 (patch) | |
tree | 43182006ddc2c9f307da69a1896752af37d0b48b | |
parent | 619348d0d14cf22d36149bafc9594859ac75dfdf (diff) |
Handle no rows case in returning UPDATE statement
-rw-r--r-- | odb/mssql/statement.cxx | 7 |
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, "?????", |