diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2013-09-05 13:02:10 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2013-09-05 13:02:10 +0200 |
commit | 654826cdafaac4199c8a8c90ef3396e312f0944f (patch) | |
tree | 5fb40bdbca960c426fe9d20a4450d89fc6250a7d /odb/relational/pgsql | |
parent | 7e922ee487bad99ce3cad3a2b2bec8ac2b381c92 (diff) |
Versioned section support
Diffstat (limited to 'odb/relational/pgsql')
-rw-r--r-- | odb/relational/pgsql/source.cxx | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/odb/relational/pgsql/source.cxx b/odb/relational/pgsql/source.cxx index 8a11914..a287dd2 100644 --- a/odb/relational/pgsql/source.cxx +++ b/odb/relational/pgsql/source.cxx @@ -312,6 +312,19 @@ namespace relational // unsigned long long av (added (mi.m)); unsigned long long dv (deleted (mi.m)); + + // If the addition/deletion version is the same as the section's, + // then we don't need the test. + // + if (user_section* s = dynamic_cast<user_section*> (section_)) + { + if (av == added (*s->member)) + av = 0; + + if (dv == deleted (*s->member)) + dv = 0; + } + if (av != 0 || dv != 0) { os << "if ("; @@ -338,7 +351,18 @@ namespace relational { if (var_override_.empty ()) { - if (added (mi.m) || deleted (mi.m)) + unsigned long long av (added (mi.m)); + unsigned long long dv (deleted (mi.m)); + if (user_section* s = dynamic_cast<user_section*> (section_)) + { + if (av == added (*s->member)) + av = 0; + + if (dv == deleted (*s->member)) + dv = 0; + } + + if (av != 0 || dv != 0) os << "}"; } |