postgis: test table/column names containing quotes

This commit is contained in:
Mickey Rose 2017-02-08 16:19:23 +01:00
parent d331b9d66a
commit d0e7b715dd
2 changed files with 19 additions and 1 deletions

@ -1 +1 @@
Subproject commit 5ad14e6bdf2c5e6babd8ac04aa057ed6c67ac617
Subproject commit 29df37a4a4007c5f97ea9cab7b3761a5954082f3

View file

@ -185,6 +185,24 @@ TEST_CASE("postgis") {
CHECK(ds->get_geometry_type() == mapnik::datasource_geometry_t::Point);
}
SECTION("Postgis properly escapes names with single quotes")
{
mapnik::parameters params(base_params);
params["table"] = "\"test'single'quotes\"";
auto ds = mapnik::datasource_cache::instance().create(params);
REQUIRE(ds != nullptr);
CHECK(ds->get_geometry_type() == mapnik::datasource_geometry_t::Point);
}
SECTION("Postgis properly escapes names with double quotes")
{
mapnik::parameters params(base_params);
params["table"] = "\"test\"\"double\"\"quotes\"";
auto ds = mapnik::datasource_cache::instance().create(params);
REQUIRE(ds != nullptr);
CHECK(ds->get_geometry_type() == mapnik::datasource_geometry_t::Point);
}
SECTION("Postgis query field names")
{
mapnik::parameters params(base_params);