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

check for invalid delimiter #981

Merged
merged 2 commits into from
Sep 16, 2024
Merged

check for invalid delimiter #981

merged 2 commits into from
Sep 16, 2024

Conversation

brennanjl
Copy link
Collaborator

This adds a delimiter $kwil_reserved_delim$, and checks that users aren't trying to maliciously use it in procedure or table creation.

We should not backport this to the TSN fix, since it is a breaking change with how snapshots are created.

@brennanjl
Copy link
Collaborator Author

One pretty big issue we might have here is upgradability.

Any old schema will be pgdumped with the $$ delimiter. I guess its not too big a deal since it won't break anything, but its something we should keep in mind.

Copy link
Member

@jchappelow jchappelow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jchappelow
Copy link
Member

jchappelow commented Sep 16, 2024

Any old schema will be pgdumped with the $$ delimiter. I guess its not too big a deal since it won't break anything, but its something we should keep in mind.

Mmmm, not ideal but I also imagine that's fine, particularly given there has been no real working snapshots yet anyway.

Still, just throwing this out there -- dump sanitize could do a string replacement, but we risk messing up the dump if not done just so.

@brennanjl
Copy link
Collaborator Author

Mmmm, not ideal but I also imagine that's fine, particularly given there has been no real working snapshots yet anyway.

Still, just throwing this out there -- dump sanitize could do a string replacement, but we risk messing up the dump if not done just so.

The thing is, we only want to replace the string for dumps that are using the current $$ delimiter, instead of $kwil_reserved_delim$. IMO it seems more error prone, especially since dumps using the current delimiter would work find anyways.

@brennanjl brennanjl merged commit 48d8f65 into main Sep 16, 2024
2 checks passed
@brennanjl brennanjl deleted the statement-delimiter branch September 16, 2024 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants