aboutsummaryrefslogtreecommitdiff
path: root/odb/mysql/query.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'odb/mysql/query.cxx')
-rw-r--r--odb/mysql/query.cxx25
1 files changed, 16 insertions, 9 deletions
diff --git a/odb/mysql/query.cxx b/odb/mysql/query.cxx
index ca858b1..14477d6 100644
--- a/odb/mysql/query.cxx
+++ b/odb/mysql/query.cxx
@@ -84,11 +84,9 @@ namespace odb
}
void query::
- append (const string& q, clause_part::kind_type k)
+ append (const string& q)
{
- if (k == clause_part::native &&
- !clause_.empty () &&
- clause_.back ().kind == clause_part::native)
+ if (!clause_.empty () && clause_.back ().kind == clause_part::native)
{
string& s (clause_.back ().part);
@@ -105,7 +103,19 @@ namespace odb
s += q;
}
else
- clause_.push_back (clause_part (k, q));
+ clause_.push_back (clause_part (clause_part::native, q));
+ }
+
+ void query::
+ append (const char* table, const char* column)
+ {
+ string s ("`");
+ s += table;
+ s += "`.`";
+ s += column;
+ s += '`';
+
+ clause_.push_back (clause_part (clause_part::column, s));
}
void query::
@@ -157,7 +167,7 @@ namespace odb
}
string query::
- clause (string const& table) const
+ clause () const
{
string r;
@@ -173,9 +183,6 @@ namespace odb
if (last != ' ' && last != '(')
r += ' ';
- if (i->part[0] == '.')
- r += table;
-
r += i->part;
break;
}