mirror of
https://github.com/maplibre/martin.git
synced 2024-12-18 20:31:54 +03:00
chore: increase complexity of the SQL table test (#1256)
a few more characters that have to be properly escaped
This commit is contained in:
parent
7d1763f827
commit
9505a2107e
@ -60,7 +60,7 @@ postgres:
|
|||||||
"-function.withweired---_-characters":
|
"-function.withweired---_-characters":
|
||||||
content_type: application/x-protobuf
|
content_type: application/x-protobuf
|
||||||
description: a function source with special characters
|
description: a function source with special characters
|
||||||
".-Points---quote":
|
".-Points-----------quote":
|
||||||
content_type: application/x-protobuf
|
content_type: application/x-protobuf
|
||||||
description: Escaping test table
|
description: Escaping test table
|
||||||
MixPoints:
|
MixPoints:
|
||||||
|
@ -21,7 +21,7 @@ async fn table_source() {
|
|||||||
"-function.withweired---_-characters":
|
"-function.withweired---_-characters":
|
||||||
content_type: application/x-protobuf
|
content_type: application/x-protobuf
|
||||||
description: a function source with special characters
|
description: a function source with special characters
|
||||||
".-Points---quote":
|
".-Points-----------quote":
|
||||||
content_type: application/x-protobuf
|
content_type: application/x-protobuf
|
||||||
description: Escaping test table
|
description: Escaping test table
|
||||||
MixPoints:
|
MixPoints:
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
"content_type": "application/x-protobuf",
|
"content_type": "application/x-protobuf",
|
||||||
"description": "a function source with special characters"
|
"description": "a function source with special characters"
|
||||||
},
|
},
|
||||||
".-Points---quote": {
|
".-Points-----------quote": {
|
||||||
"content_type": "application/x-protobuf",
|
"content_type": "application/x-protobuf",
|
||||||
"description": "Escaping test table"
|
"description": "Escaping test table"
|
||||||
},
|
},
|
||||||
|
@ -4,11 +4,11 @@ postgres:
|
|||||||
auto_bounds: calc
|
auto_bounds: calc
|
||||||
auto_publish: true
|
auto_publish: true
|
||||||
tables:
|
tables:
|
||||||
.-Points---quote:
|
.-Points-----------quote:
|
||||||
schema: '"Quotes'' and Space.Dot.'
|
schema: '"Quotes'' \ \'' \" and Space.Dot.'
|
||||||
table: . Points" 'quote
|
table: . Points" \ \' \" 'quote
|
||||||
srid: 4326
|
srid: 4326
|
||||||
geometry_column: . "Geom"
|
geometry_column: . ' \ \' \" "Geom"
|
||||||
bounds:
|
bounds:
|
||||||
- -170.94984639004662
|
- -170.94984639004662
|
||||||
- -84.20025580733805
|
- -84.20025580733805
|
||||||
|
@ -3,11 +3,11 @@ postgres:
|
|||||||
auto_bounds: calc
|
auto_bounds: calc
|
||||||
auto_publish: true
|
auto_publish: true
|
||||||
tables:
|
tables:
|
||||||
.-Points---quote:
|
.-Points-----------quote:
|
||||||
schema: '"Quotes'' and Space.Dot.'
|
schema: '"Quotes'' \ \'' \" and Space.Dot.'
|
||||||
table: . Points" 'quote
|
table: . Points" \ \' \" 'quote
|
||||||
srid: 4326
|
srid: 4326
|
||||||
geometry_column: . "Geom"
|
geometry_column: . ' \ \' \" "Geom"
|
||||||
bounds:
|
bounds:
|
||||||
- -170.94984639004662
|
- -170.94984639004662
|
||||||
- -84.20025580733805
|
- -84.20025580733805
|
||||||
|
@ -3,11 +3,11 @@ postgres:
|
|||||||
auto_bounds: calc
|
auto_bounds: calc
|
||||||
auto_publish: true
|
auto_publish: true
|
||||||
tables:
|
tables:
|
||||||
.-Points---quote:
|
.-Points-----------quote:
|
||||||
schema: '"Quotes'' and Space.Dot.'
|
schema: '"Quotes'' \ \'' \" and Space.Dot.'
|
||||||
table: . Points" 'quote
|
table: . Points" \ \' \" 'quote
|
||||||
srid: 4326
|
srid: 4326
|
||||||
geometry_column: . "Geom"
|
geometry_column: . ' \ \' \" "Geom"
|
||||||
bounds:
|
bounds:
|
||||||
- -170.94984639004662
|
- -170.94984639004662
|
||||||
- -84.20025580733805
|
- -84.20025580733805
|
||||||
|
@ -3,11 +3,11 @@ postgres:
|
|||||||
auto_bounds: calc
|
auto_bounds: calc
|
||||||
auto_publish: true
|
auto_publish: true
|
||||||
tables:
|
tables:
|
||||||
.-Points---quote:
|
.-Points-----------quote:
|
||||||
schema: '"Quotes'' and Space.Dot.'
|
schema: '"Quotes'' \ \'' \" and Space.Dot.'
|
||||||
table: . Points" 'quote
|
table: . Points" \ \' \" 'quote
|
||||||
srid: 4326
|
srid: 4326
|
||||||
geometry_column: . "Geom"
|
geometry_column: . ' \ \' \" "Geom"
|
||||||
bounds:
|
bounds:
|
||||||
- -170.94984639004662
|
- -170.94984639004662
|
||||||
- -84.20025580733805
|
- -84.20025580733805
|
||||||
|
29
tests/fixtures/tables/SpacesAndQuotes.sql
vendored
29
tests/fixtures/tables/SpacesAndQuotes.sql
vendored
@ -1,27 +1,14 @@
|
|||||||
DROP SCHEMA IF EXISTS """Quotes' and Space.Dot." CASCADE;
|
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,
|
"' id '" SERIAL PRIMARY KEY,
|
||||||
".namE " TEXT,
|
".namE " TEXT,
|
||||||
". ""Geom""" GEOMETRY(POINT, 4326)
|
". ' \ \' \"" ""Geom""" GEOMETRY(POINT, 4326)
|
||||||
);
|
);
|
||||||
|
|
||||||
-- INSERT INTO """Quotes' and Space.Dot.".". Points"" 'quote"
|
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"
|
|
||||||
values (1, '02daedc70702ec68753fde38351f5d9d', '0101000020E610000050C4D38CE9DA61401EFC0EC7C3DA2740'),
|
values (1, '02daedc70702ec68753fde38351f5d9d', '0101000020E610000050C4D38CE9DA61401EFC0EC7C3DA2740'),
|
||||||
(2, '7418427ba8a960c3661235f47cc13d46', '0101000020E6100000CC2F4170E9DA6140DEDB02B581DA2740'),
|
(2, '7418427ba8a960c3661235f47cc13d46', '0101000020E6100000CC2F4170E9DA6140DEDB02B581DA2740'),
|
||||||
(3, 'd5a11dee7203a09442168eec74c7bea8', '0101000020E6100000008E66E9E6DA614059944356B4DA2740'),
|
(3, 'd5a11dee7203a09442168eec74c7bea8', '0101000020E6100000008E66E9E6DA614059944356B4DA2740'),
|
||||||
@ -53,10 +40,10 @@ values (1, '02daedc70702ec68753fde38351f5d9d', '0101000020E610000050C4D38CE9DA61
|
|||||||
(29, 'fd0775c59700ac8c1982aa3efe6cb0c7', '0101000020E6100000D6CF48A3E1A9464077D6BBFDD00C55C0'),
|
(29, 'fd0775c59700ac8c1982aa3efe6cb0c7', '0101000020E6100000D6CF48A3E1A9464077D6BBFDD00C55C0'),
|
||||||
(30, '404175d17b08782edc9d316c378adc86', '0101000020E6100000F9B5A5ADB7265BC0EE07F81F2F284840');
|
(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
|
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"
|
"description": "Escaping test table"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user