From 17852d5140c176346414d25335bed7e171b9658f Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Mon, 5 Dec 2011 13:22:00 -0800 Subject: [PATCH] sqlite: ensure non-existant columns requested in query prompt error by switching quoting character to brackets - closes #984 - refs #792 --- plugins/input/sqlite/sqlite_datasource.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/input/sqlite/sqlite_datasource.cpp b/plugins/input/sqlite/sqlite_datasource.cpp index 53bfccf57..7946dfead 100644 --- a/plugins/input/sqlite/sqlite_datasource.cpp +++ b/plugins/input/sqlite/sqlite_datasource.cpp @@ -453,7 +453,9 @@ featureset_ptr sqlite_datasource::features(query const& q) const std::set::const_iterator end = props.end(); while (pos != end) { - s << ",\"" << *pos << "\""; + // TODO - should we restrict duplicate key query? + //if (*pos != key_field_) + s << ",[" << *pos << "]"; ++pos; } @@ -492,7 +494,7 @@ featureset_ptr sqlite_datasource::features(query const& q) const #ifdef MAPNIK_DEBUG std::clog << "Sqlite Plugin: table: " << table_ << "\n\n"; - std::clog << "Sqlite Plugin: query:" << s.str() << "\n\n"; + std::clog << "Sqlite Plugin: query: " << s.str() << "\n\n"; #endif boost::shared_ptr rs(dataset_->execute_query(s.str())); @@ -527,7 +529,7 @@ featureset_ptr sqlite_datasource::features_at_point(coord2d const& pt) const std::string fld_name = itr->get_name(); if (fld_name != key_field_) { - s << ",\"" << itr->get_name() << "\""; + s << ",[" << itr->get_name() << "]"; } ++itr;