diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2013-08-30 06:05:32 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2013-08-30 06:05:32 +0200 |
commit | b5ed13549a87dccb56f756d6fbc5f7bf537e9640 (patch) | |
tree | fbd04a8212da865758db44b6f41c2d4818eea359 /odb/pgsql/query.cxx | |
parent | 0745f84e2d5c7133f6ee6608487089d69d7ad519 (diff) |
Statement processing/optimization base work
Diffstat (limited to 'odb/pgsql/query.cxx')
-rw-r--r-- | odb/pgsql/query.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/odb/pgsql/query.cxx b/odb/pgsql/query.cxx index d054450..4cbad67 100644 --- a/odb/pgsql/query.cxx +++ b/odb/pgsql/query.cxx @@ -167,8 +167,8 @@ namespace odb // We don't want extra spaces after '(' as well as before ',' // and ')'. // - if (last != ' ' && last != '(' && - first != ' ' && first != ',' && first != ')') + if (last != ' ' && last != '\n' && last != '(' && + first != ' ' && first != '\n' && first != ',' && first != ')') s += ' '; s += q; @@ -276,7 +276,7 @@ namespace odb // It either has to be an exact match, or there should be // a whitespace following the keyword. // - if (s.size () == n || s[n] == ' ' || s[n] =='\t') + if (s.size () == n || s[n] == ' ' || s[n] == '\n' || s[n] =='\t') return true; } @@ -336,7 +336,7 @@ namespace odb { case clause_part::kind_column: { - if (last != ' ' && last != '(') + if (last != ' ' && last != '\n' && last != '(') r += ' '; r += i->part; @@ -344,7 +344,7 @@ namespace odb } case clause_part::kind_param: { - if (last != ' ' && last != '(') + if (last != ' ' && last != '\n' && last != '(') r += ' '; ostringstream os; @@ -375,8 +375,8 @@ namespace odb const string& p (i->part); char first (!p.empty () ? p[0] : ' '); - if (last != ' ' && last != '(' && - first != ' ' && first != ',' && first != ')') + if (last != ' ' && last != '\n' && last != '(' && + first != ' ' && first != '\n' && first != ',' && first != ')') r += ' '; r += p; @@ -384,7 +384,7 @@ namespace odb } case clause_part::kind_bool: { - if (last != ' ' && last != '(') + if (last != ' ' && last != '\n' && last != '(') r += ' '; r += i->bool_part ? "TRUE" : "FALSE"; |