aboutsummaryrefslogtreecommitdiff
path: root/odb/relational/pgsql
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2013-09-05 13:02:10 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2013-09-05 13:02:10 +0200
commit654826cdafaac4199c8a8c90ef3396e312f0944f (patch)
tree5fb40bdbca960c426fe9d20a4450d89fc6250a7d /odb/relational/pgsql
parent7e922ee487bad99ce3cad3a2b2bec8ac2b381c92 (diff)
Versioned section support
Diffstat (limited to 'odb/relational/pgsql')
-rw-r--r--odb/relational/pgsql/source.cxx26
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 << "}";
}