Skip to content

Commit

Permalink
Fix bug with escaping content query in export_to_s3_perform
Browse files Browse the repository at this point in the history
Signed-off-by: Benjamin Rögner <[email protected]>
  • Loading branch information
roegi committed Oct 10, 2024
1 parent 4311640 commit c684888
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion xyz-util/src/main/resources/sql/s3_export.sql
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ BEGIN
||' NULL,'
||' %5$L )',

format('select jsondata || jsonb_build_object(''''geometry'''', ST_AsGeoJSON(geo, 8)::jsonb) from (%1$s) X', content_query),
format('select jsondata || jsonb_build_object(''''geometry'''', ST_AsGeoJSON(geo, 8)::jsonb) from (%1$s) X', REPLACE(content_query, $x$'$x$, $x$''$x$)),
s3_bucket,
s3_path,
s3_region,
Expand Down
2 changes: 1 addition & 1 deletion xyz-util/src/main/resources/sql/transport.sql
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ BEGIN
ctx JSONB := '$wrappedouter$||(ctx::TEXT)||$wrappedouter$'::JSONB;
work_item JSONB := '$wrappedouter$||(work_item::TEXT)||$wrappedouter$'::JSONB;
format TEXT := '$wrappedouter$||format||$wrappedouter$'::TEXT;
content_query TEXT := '$wrappedouter$||(coalesce(content_query,''))||$wrappedouter$'::TEXT;
content_query TEXT := $x$$wrappedouter$||coalesce(content_query,'')||$wrappedouter$$x$::TEXT;
retry_count INT := 2;
BEGIN
BEGIN
Expand Down

0 comments on commit c684888

Please sign in to comment.