mirror of
https://github.com/mapnik/mapnik.git
synced 2025-12-08 20:13:09 +00:00
+ revert to "limit 1" logic
+ discard everything after table name when building table descriptor to avoid seq scan
This commit is contained in:
parent
7537c14d77
commit
2cb4265091
@ -182,8 +182,11 @@ sqlite_datasource::sqlite_datasource(parameters const& params)
|
||||
we cannot determine the right columns types and names
|
||||
as all column_type are SQLITE_NULL
|
||||
*/
|
||||
|
||||
std::string::size_type idx = table_.find(table_name);
|
||||
std::ostringstream s;
|
||||
s << "select * from " << table_ << " limit 0";
|
||||
s << "select * from (" << table_.substr(0,idx + table_name.length()) << ") limit 1";
|
||||
|
||||
boost::scoped_ptr<sqlite_resultset> rs (dataset_->execute_query (s.str()));
|
||||
if (rs->is_valid () && rs->step_next())
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user