Merge branch 'master' into amiedes-fix-api-auth

pull/15651/head
Alberto Miedes Garcés 4 years ago
commit 5feaef2dce

@ -24,6 +24,7 @@ Development
- Fix kepler.gl link in Maps section ([#15644](https://github.com/CartoDB/cartodb/issues/15644))
- /api/v3/me endpoint returns less public data ([#5627](https://github.com/CartoDB/cartodb-platform/issues/5627))
- Retrieve IPs before adding or removing to avoid inconsistencies ([#15643](https://github.com/CartoDB/cartodb/pull/15643))
- Faster geometry types calculation for big datasets ([#15654](https://github.com/CartoDB/cartodb/pull/15654))
- Return error for requests whose authentication was succeeding with an expired session ([#15637](https://github.com/CartoDB/cartodb/pull/15637))
4.37.0 (2020-04-24)

@ -1288,17 +1288,23 @@ class Table
def query_geometry_types
# We do not query the DB, if the_geom does not exist we just recover
begin
owner.in_database[ %Q{
SELECT DISTINCT ST_GeometryType(the_geom) FROM (
owner.in_database[distinct_geometry_sql].all.map { |r| r[:st_geometrytype] }
rescue StandardError
[]
end
def distinct_geometry_sql
%{
SELECT DISTINCT ST_GeometryType(the_geom) FROM (
SELECT the_geom
FROM (
SELECT the_geom
FROM #{qualified_table_name}
WHERE (the_geom is not null) LIMIT 10
) as foo
}].all.map {|r| r[:st_geometrytype] }
rescue
[]
end
FROM #{qualified_table_name}
LIMIT 10000
) as limited
WHERE (the_geom is not null) LIMIT 10
) as not_null
}
end
def cache

Loading…
Cancel
Save