diff --git a/plugins/input/sqlite/sqlite_datasource.cpp b/plugins/input/sqlite/sqlite_datasource.cpp index 57569cfb5..b14cf1dbc 100644 --- a/plugins/input/sqlite/sqlite_datasource.cpp +++ b/plugins/input/sqlite/sqlite_datasource.cpp @@ -548,33 +548,24 @@ featureset_ptr sqlite_datasource::features(query const& q) const std::ostringstream s; mapnik::context_ptr ctx = boost::make_shared(); - std::set const& props = q.property_names(); - std::set::const_iterator pos = props.begin(); - std::set::const_iterator end = props.end(); s << "SELECT " << geometry_field_; if (!key_field_.empty()) { s << "," << key_field_; ctx->push(key_field_); - for ( ;pos != end;++pos) - { - if (*pos != key_field_) - { - s << ",[" << *pos << "]"; - ctx->push(*pos); - } - } - } - else - { - for ( ;pos != end;++pos) - { - s << ",[" << *pos << "]"; - ctx->push(*pos); - } } + std::set const& props = q.property_names(); + std::set::const_iterator pos = props.begin(); + std::set::const_iterator end = props.end(); + for ( ;pos != end;++pos) + { + // TODO - should we restrict duplicate key query? + //if (*pos != key_field_) + s << ",[" << *pos << "]"; + ctx->push(*pos); + } s << " FROM "; std::string query(table_);