Skip to content

Function config_params truncates values containing equals signs #1137

Description

@hsusul

Bug

FUNCTIONS_SQL parses proconfig with:

(string_to_array(unnest(proconfig), '='))[1] as param,
(string_to_array(unnest(proconfig), '='))[2] as value

Any config value that itself contains = (e.g. SET application_name TO 'api=worker') is truncated at the first extra =. Observed: application_nameapi instead of api=worker.

This is the same class of bug as role config truncation (#1117), but in the functions catalog path — Studio list/retrieve/update-recreate of functions can corrupt GUC values that contain =.

Reproduce

create function public.config_eq_test() returns void
language sql set application_name to 'api=worker'
as $$ select 1; $$;

Then inspect config_params from GET /functions / functions.retrieve.

Expected

config_params.application_name === 'api=worker'

Suggested fix

Split on the first = only, e.g. split_part(cfg, '=', 1) + substring(cfg from position('=' in cfg) + 1) via lateral unnest(proconfig).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions