Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[YSQL] Import Warning on SET of nonexisting setting with a prefix reserved by an extension #10748

Closed
tedyu opened this issue Dec 1, 2021 · 0 comments
Assignees
Labels
area/ysql Yugabyte SQL (YSQL)

Comments

@tedyu
Copy link
Contributor

tedyu commented Dec 1, 2021

Description

Commit was 75d22069e00d638d08c04e3aba71688f3fb002ed

Commit message was

An extension can already de facto reserve a GUC prefix using
EmitWarningsOnPlaceholders().  But this was only checked against
settings that exist at the time the extension is loaded (or the
extension chooses to call this).  No diagnostic is given when a SET
command later uses a nonexisting setting with a custom prefix.

With this change, EmitWarningsOnPlaceholders() saves the prefixes it
reserves in a list, and SET checks when it finds a "placeholder"
setting whether it belongs to a reserved prefix and issues a warning
in that case.

Add a regression test that checks the patch using the "plpgsql"
registered prefix.

Author: Florin Irion <[email protected]>
Discussion: https://www.postgresql.org/message-id/flat/CA+HEvJDhWuuTpGTJT9Tgbdzm4QS4EzPAwDBScWK18H2Q=FVJFw@mail.gmail.com
@tedyu tedyu added the area/ysql Yugabyte SQL (YSQL) label Dec 1, 2021
@tedyu tedyu self-assigned this Dec 1, 2021
tedyu added a commit that referenced this issue Dec 8, 2021
…efix reserved by an extension

Summary:
Commit was 75d22069e00d638d08c04e3aba71688f3fb002ed

Commit message was
```
An extension can already de facto reserve a GUC prefix using
EmitWarningsOnPlaceholders().  But this was only checked against
settings that exist at the time the extension is loaded (or the
extension chooses to call this).  No diagnostic is given when a SET
command later uses a nonexisting setting with a custom prefix.

With this change, EmitWarningsOnPlaceholders() saves the prefixes it
reserves in a list, and SET checks when it finds a "placeholder"
setting whether it belongs to a reserved prefix and issues a warning
in that case.

Add a regression test that checks the patch using the "plpgsql"
registered prefix.

Author: Florin Irion <[email protected]>
Discussion: https://www.postgresql.org/message-id/flat/CA+HEvJDhWuuTpGTJT9Tgbdzm4QS4EzPAwDBScWK18H2Q=FVJFw@mail.gmail.com
```

Test Plan: mvn test -Dtest=org.yb.pgsql.TestPgRegressMisc

Reviewers: amartsinchyk, myang

Reviewed By: myang

Subscribers: yql

Differential Revision: https://phabricator.dev.yugabyte.com/D14191
@tedyu tedyu closed this as completed Dec 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ysql Yugabyte SQL (YSQL)
Projects
None yet
Development

No branches or pull requests

1 participant