From 4964bf912004c9190421ef573df6d1df4897e64c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 21 May 2013 18:12:57 -0400 Subject: Handle no rows case in returning UPDATE statement --- mssql/types/driver.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'mssql/types') diff --git a/mssql/types/driver.cxx b/mssql/types/driver.cxx index 1c2d7d8..33b606e 100644 --- a/mssql/types/driver.cxx +++ b/mssql/types/driver.cxx @@ -9,6 +9,7 @@ #include #include +#include #include #include @@ -285,8 +286,17 @@ main (int argc, char* argv[]) p->str += 'd'; db->update (*p); assert (p->version > o.version); + o.str += 'D'; + try + { + db->update (o); + assert (false); + } + catch (const odb::object_changed&) {} db->reload (o); assert (o.version == p->version); + o.str += 'D'; + db->update (o); t.commit (); } } -- cgit v1.1