diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2012-07-27 16:04:12 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2012-07-27 16:04:12 +0200 |
commit | f97cf788bb37f978d42ed4dba5874d3d74830e2a (patch) | |
tree | 714f661a001d5fea072e6eae777350430656a95c | |
parent | bde2483880bf7e3407fa3b843142ced646dca043 (diff) |
Handle special case of array of zero elements
-rw-r--r-- | odb/relational/pgsql/source.cxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/odb/relational/pgsql/source.cxx b/odb/relational/pgsql/source.cxx index c1ca854..d4c67d3 100644 --- a/odb/relational/pgsql/source.cxx +++ b/odb/relational/pgsql/source.cxx @@ -718,6 +718,13 @@ namespace relational statement_oids st (statement_insert); st.traverse (c); + // Empty array are not portable. So add a dummy member if we + // are not sending anything with the insert statement. + // + if (cc.total == cc.inverse + cc.optimistic_managed + + (id != 0 && !poly_derived && auto_ (*id) ? cc.id : 0)) + os << "0"; + os << "};"; } |