diff --git a/martin/tests/pg_server_test.rs b/martin/tests/pg_server_test.rs index e1a65780..600e774a 100644 --- a/martin/tests/pg_server_test.rs +++ b/martin/tests/pg_server_test.rs @@ -60,7 +60,7 @@ postgres: "-function.withweired---_-characters": content_type: application/x-protobuf description: a function source with special characters - ".-Points---quote": + ".-Points-----------quote": content_type: application/x-protobuf description: Escaping test table MixPoints: diff --git a/martin/tests/pg_table_source_test.rs b/martin/tests/pg_table_source_test.rs index 29f93936..d4179167 100644 --- a/martin/tests/pg_table_source_test.rs +++ b/martin/tests/pg_table_source_test.rs @@ -21,7 +21,7 @@ async fn table_source() { "-function.withweired---_-characters": content_type: application/x-protobuf description: a function source with special characters - ".-Points---quote": + ".-Points-----------quote": content_type: application/x-protobuf description: Escaping test table MixPoints: diff --git a/tests/expected/auto/catalog_auto.json b/tests/expected/auto/catalog_auto.json index d3b77b68..e3d4a353 100644 --- a/tests/expected/auto/catalog_auto.json +++ b/tests/expected/auto/catalog_auto.json @@ -4,7 +4,7 @@ "content_type": "application/x-protobuf", "description": "a function source with special characters" }, - ".-Points---quote": { + ".-Points-----------quote": { "content_type": "application/x-protobuf", "description": "Escaping test table" }, diff --git a/tests/expected/auto/save_config.yaml b/tests/expected/auto/save_config.yaml index a46b295f..3b1105ca 100644 --- a/tests/expected/auto/save_config.yaml +++ b/tests/expected/auto/save_config.yaml @@ -4,11 +4,11 @@ postgres: auto_bounds: calc auto_publish: true tables: - .-Points---quote: - schema: '"Quotes'' and Space.Dot.' - table: . Points" 'quote + .-Points-----------quote: + schema: '"Quotes'' \ \'' \" and Space.Dot.' + table: . Points" \ \' \" 'quote srid: 4326 - geometry_column: . "Geom" + geometry_column: . ' \ \' \" "Geom" bounds: - -170.94984639004662 - -84.20025580733805 diff --git a/tests/expected/martin-cp/flat-with-hash_save_config.yaml b/tests/expected/martin-cp/flat-with-hash_save_config.yaml index bdbe22a9..4e811e61 100644 --- a/tests/expected/martin-cp/flat-with-hash_save_config.yaml +++ b/tests/expected/martin-cp/flat-with-hash_save_config.yaml @@ -3,11 +3,11 @@ postgres: auto_bounds: calc auto_publish: true tables: - .-Points---quote: - schema: '"Quotes'' and Space.Dot.' - table: . Points" 'quote + .-Points-----------quote: + schema: '"Quotes'' \ \'' \" and Space.Dot.' + table: . Points" \ \' \" 'quote srid: 4326 - geometry_column: . "Geom" + geometry_column: . ' \ \' \" "Geom" bounds: - -170.94984639004662 - -84.20025580733805 diff --git a/tests/expected/martin-cp/flat_save_config.yaml b/tests/expected/martin-cp/flat_save_config.yaml index bdbe22a9..4e811e61 100644 --- a/tests/expected/martin-cp/flat_save_config.yaml +++ b/tests/expected/martin-cp/flat_save_config.yaml @@ -3,11 +3,11 @@ postgres: auto_bounds: calc auto_publish: true tables: - .-Points---quote: - schema: '"Quotes'' and Space.Dot.' - table: . Points" 'quote + .-Points-----------quote: + schema: '"Quotes'' \ \'' \" and Space.Dot.' + table: . Points" \ \' \" 'quote srid: 4326 - geometry_column: . "Geom" + geometry_column: . ' \ \' \" "Geom" bounds: - -170.94984639004662 - -84.20025580733805 diff --git a/tests/expected/martin-cp/normalized_save_config.yaml b/tests/expected/martin-cp/normalized_save_config.yaml index bdbe22a9..4e811e61 100644 --- a/tests/expected/martin-cp/normalized_save_config.yaml +++ b/tests/expected/martin-cp/normalized_save_config.yaml @@ -3,11 +3,11 @@ postgres: auto_bounds: calc auto_publish: true tables: - .-Points---quote: - schema: '"Quotes'' and Space.Dot.' - table: . Points" 'quote + .-Points-----------quote: + schema: '"Quotes'' \ \'' \" and Space.Dot.' + table: . Points" \ \' \" 'quote srid: 4326 - geometry_column: . "Geom" + geometry_column: . ' \ \' \" "Geom" bounds: - -170.94984639004662 - -84.20025580733805 diff --git a/tests/fixtures/tables/SpacesAndQuotes.sql b/tests/fixtures/tables/SpacesAndQuotes.sql index a8f83637..d942461b 100644 --- a/tests/fixtures/tables/SpacesAndQuotes.sql +++ b/tests/fixtures/tables/SpacesAndQuotes.sql @@ -1,27 +1,14 @@ DROP SCHEMA IF EXISTS """Quotes' and Space.Dot." CASCADE; -CREATE SCHEMA """Quotes' and Space.Dot."; +CREATE SCHEMA """Quotes' \ \' \"" and Space.Dot."; -CREATE TABLE """Quotes' and Space.Dot.".". Points"" 'quote" +CREATE TABLE """Quotes' \ \' \"" and Space.Dot.".". Points"" \ \' \"" 'quote" ( - "' id '" SERIAL PRIMARY KEY, - ".namE " TEXT, - ". ""Geom""" GEOMETRY(POINT, 4326) + "' id '" SERIAL PRIMARY KEY, + ".namE " TEXT, + ". ' \ \' \"" ""Geom""" GEOMETRY(POINT, 4326) ); --- INSERT INTO """Quotes' and Space.Dot.".". Points"" 'quote" --- SELECT generate_series(1, 3), --- md5(random()::text), --- (ST_DUMP(ST_GENERATEPOINTS(st_transform(st_tileenvelope(18, 235085, 122323), 4326), 3))).Geom; --- INSERT INTO """Quotes' and Space.Dot.".". Points"" 'quote" --- SELECT generate_series(4, 30), --- md5(random()::text), --- (ST_DUMP(ST_GENERATEPOINTS(st_transform(st_tileenvelope(0, 0, 0), 4326), 27))).Geom; --- --- To dump the data above, uncomment code the above, comment the INSERT code bellow, and run: --- just restart --- just pg_dump --data-only --inserts --rows-per-insert=100 --table="""Quotes' and Space.Dot.".". Points"" 'quote" - -INSERT INTO """Quotes' and Space.Dot.".". Points"" 'quote" +INSERT INTO """Quotes' \ \' \"" and Space.Dot.".". Points"" \ \' \"" 'quote" values (1, '02daedc70702ec68753fde38351f5d9d', '0101000020E610000050C4D38CE9DA61401EFC0EC7C3DA2740'), (2, '7418427ba8a960c3661235f47cc13d46', '0101000020E6100000CC2F4170E9DA6140DEDB02B581DA2740'), (3, 'd5a11dee7203a09442168eec74c7bea8', '0101000020E6100000008E66E9E6DA614059944356B4DA2740'), @@ -53,10 +40,10 @@ values (1, '02daedc70702ec68753fde38351f5d9d', '0101000020E610000050C4D38CE9DA61 (29, 'fd0775c59700ac8c1982aa3efe6cb0c7', '0101000020E6100000D6CF48A3E1A9464077D6BBFDD00C55C0'), (30, '404175d17b08782edc9d316c378adc86', '0101000020E6100000F9B5A5ADB7265BC0EE07F81F2F284840'); -CREATE INDEX ON """Quotes' and Space.Dot.".". Points"" 'quote" USING GIST (". ""Geom"""); +CREATE INDEX ON """Quotes' \ \' \"" and Space.Dot.".". Points"" \ \' \"" 'quote" USING GIST (". ' \ \' \"" ""Geom"""); DO $do$ BEGIN - EXECUTE 'COMMENT ON TABLE """Quotes'' and Space.Dot.".". Points"" ''quote" IS $tj$' || $$ + EXECUTE 'COMMENT ON TABLE """Quotes'' \ \'' \"" and Space.Dot.".". Points"" \ \'' \"" ''quote" IS $tj$' || $$ { "description": "Escaping test table" }