summaryrefslogtreecommitdiff
path: root/odb/relational/source.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-03-11 14:21:52 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-03-21 15:40:00 +0200
commita6630dff5bf2002c0c133ea6c5e16d8a0a22138f (patch)
tree64e05f2b2a6e0d602fe2d89bec8698ca9b0b70f4 /odb/relational/source.hxx
parent7208e97cabf7c21169a036ae7cf697042984e9cb (diff)
Create indexes in separate SQL statements
This is more vendor-neutral.
Diffstat (limited to 'odb/relational/source.hxx')
-rw-r--r--odb/relational/source.hxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/odb/relational/source.hxx b/odb/relational/source.hxx
index 37dfa27..106bf27 100644
--- a/odb/relational/source.hxx
+++ b/odb/relational/source.hxx
@@ -27,14 +27,16 @@ namespace relational
pre ()
{
first_ = true;
- os << "db.execute (";
}
virtual void
line (const std::string& l)
{
if (first_)
+ {
first_ = false;
+ os << "db.execute (";
+ }
else
os << endl;
@@ -44,7 +46,8 @@ namespace relational
virtual void
post ()
{
- os << ");" << endl;
+ if (!first_) // Ignore empty statements.
+ os << ");" << endl;
}
private: