+ applied patch from numenor

This commit is contained in:
Artem Pavlenko 2009-03-29 11:32:22 +00:00
parent 2eec236fc2
commit e9a0f020b4

View file

@ -220,11 +220,11 @@ std::string postgis_datasource::table_from_sql(const std::string& sql)
std::string table_name = boost::algorithm::to_lower_copy(sql); std::string table_name = boost::algorithm::to_lower_copy(sql);
boost::algorithm::replace_all(table_name,"\n"," "); boost::algorithm::replace_all(table_name,"\n"," ");
std::string::size_type idx = table_name.rfind("from"); std::string::size_type idx = table_name.rfind(" from ");
if (idx!=std::string::npos) if (idx!=std::string::npos)
{ {
idx=table_name.find_first_not_of(" ",idx+4); idx=table_name.find_first_not_of(" ",idx+5);
if (idx != std::string::npos) if (idx != std::string::npos)
{ {
table_name=table_name.substr(idx); table_name=table_name.substr(idx);