sqlite: query from geometry_table_ rather than table_ to hopefully avoid problems with rowid being missing from subquery
This commit is contained in:
parent
9f4deb00c0
commit
6d5c6d7458
1 changed files with 7 additions and 1 deletions
|
@ -410,10 +410,16 @@ void sqlite_datasource::bind() const
|
||||||
|
|
||||||
// final fallback to gather extent
|
// final fallback to gather extent
|
||||||
if (!extent_initialized_ || !has_spatial_index_) {
|
if (!extent_initialized_ || !has_spatial_index_) {
|
||||||
|
|
||||||
|
/*if (use_spatial_index_ && key_field_ == "rowid" && boost::algorithm::icontains(geometry_table_,"from")) {
|
||||||
|
// this is an impossible situation because rowid will be null via a subquery
|
||||||
|
throw datasource_exception("Sqlite Plugin: Using a spatial index will require creating one on the fly which is not possible unless you supply a 'key_field' value that references the primary key of your spatial table. To avoid using a spatial index set 'use_spatial_index'=false");
|
||||||
|
}*/
|
||||||
|
|
||||||
std::ostringstream s;
|
std::ostringstream s;
|
||||||
|
|
||||||
s << "SELECT " << geometry_field_ << "," << key_field_
|
s << "SELECT " << geometry_field_ << "," << key_field_
|
||||||
<< " FROM " << table_;
|
<< " FROM " << geometry_table_;
|
||||||
if (row_limit_ > 0) {
|
if (row_limit_ > 0) {
|
||||||
s << " LIMIT " << row_limit_;
|
s << " LIMIT " << row_limit_;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue