From 01ba76036b5d9dbf57a0909869c4811f12ea8bee Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 4 May 2016 21:01:22 +0200 Subject: Ignore section logic when dealing with container elements The container member itself can be in a section. --- common/section/basics/driver.cxx | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'common/section/basics/driver.cxx') diff --git a/common/section/basics/driver.cxx b/common/section/basics/driver.cxx index bdd5e64..b9fa667 100644 --- a/common/section/basics/driver.cxx +++ b/common/section/basics/driver.cxx @@ -1694,6 +1694,37 @@ main (int argc, char* argv[]) t.commit (); } } + + // Regression: BLOB in a value type used as a map value that is in a + // section. + // + { + using namespace test19; + + object o; + o.m[1].b.assign (560, 'x'); // Size greater than the default image. + + { + transaction t (db->begin ()); + db->persist (o); + t.commit (); + } + + { + // Hold "old" connection to force a new set of statements/image + // buffers. + // + connection_ptr c (db->connection ()); + + transaction t (db->begin ()); + auto_ptr p (db->load (o.id)); + + db->load (*p, p->s); + assert (p->m[1].b == o.m[1].b); + + t.commit (); + } + } } catch (const odb::exception& e) { -- cgit v1.1