aboutsummaryrefslogtreecommitdiff
path: root/odb/sqlite/query.txx
diff options
context:
space:
mode:
Diffstat (limited to 'odb/sqlite/query.txx')
-rw-r--r--odb/sqlite/query.txx25
1 files changed, 15 insertions, 10 deletions
diff --git a/odb/sqlite/query.txx b/odb/sqlite/query.txx
index b51b45a..909807f 100644
--- a/odb/sqlite/query.txx
+++ b/odb/sqlite/query.txx
@@ -100,19 +100,24 @@ namespace odb
query_base query_column<T, ID>::
in_range (I begin, I end) const
{
- query_base q (table_, column_);
- q += "IN (";
-
- for (I i (begin); i != end; ++i)
+ if (begin != end)
{
- if (i != begin)
- q += ",";
+ query_base q (table_, column_);
+ q += "IN (";
- q.append<T, ID> (val_bind<T> (*i), conversion_);
- }
+ for (I i (begin); i != end; ++i)
+ {
+ if (i != begin)
+ q += ",";
- q += ")";
- return q;
+ q.append<T, ID> (val_bind<T> (*i), conversion_);
+ }
+
+ q += ")";
+ return q;
+ }
+ else
+ return query_base (false);
}
// like