diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2013-09-02 09:22:39 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2013-09-02 09:22:39 +0200 |
commit | a6733021db61a87ebff94495d5b65d3ef521dd45 (patch) | |
tree | 182f62c7f3a8f2759a83d955bcb0f9ad24b0c88d /odb/relational/pgsql | |
parent | 3e23b0478aa8f426e0443d2c4c0189b4da0e6198 (diff) |
Fix UPDATE statement for smart containers with read-only value members
Here we have to include them (think what happens when we erase an element
somewhere in the middle of a container).
Diffstat (limited to 'odb/relational/pgsql')
-rw-r--r-- | odb/relational/pgsql/source.cxx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/odb/relational/pgsql/source.cxx b/odb/relational/pgsql/source.cxx index a7834a2..8a11914 100644 --- a/odb/relational/pgsql/source.cxx +++ b/odb/relational/pgsql/source.cxx @@ -1044,9 +1044,14 @@ namespace relational << "update_types[] =" << "{"; - statement_oids so (statement_where); + { + // Use insert instead of update to include read-only members. + // + statement_oids so (statement_insert); + so.traverse (m, vt, "value", "value"); + } - so.traverse (m, vt, "value", "value"); + statement_oids so (statement_where, false); so.traverse (m, idt, "id", "object_id"); switch (ck) |