From 15f718bbf874a77b1079a55f29335447aeba17dd Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 2 Nov 2011 10:18:25 +0200 Subject: Prevent potential image overwrite in MySQL query result --- common/query/driver.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common/query/driver.cxx b/common/query/driver.cxx index d9d0f12..45392b8 100644 --- a/common/query/driver.cxx +++ b/common/query/driver.cxx @@ -422,7 +422,12 @@ main (int argc, char* argv[]) ++i; assert (i != r.end ()); auto_ptr joe (db->load (3)); - assert (i->last_name_ == "Doe"); + assert (i->last_name_ == "Doe"); // Actual load. + + person p; + joe.reset (db->load (3)); // Overwrite object image again. + i.load (p); + assert (p.last_name_ == "Doe"); t.commit (); } -- cgit v1.1