sql: allow escape of any character for COPY#52068
Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom Jul 29, 2020
Merged
sql: allow escape of any character for COPY#52068craig[bot] merged 1 commit intocockroachdb:masterfrom
craig[bot] merged 1 commit intocockroachdb:masterfrom
Conversation
Member
According to the PostgreSQL docs: Any other backslashed character that is not mentioned in the above table will be taken to represent itself. Reflect that change by converting error conditions from decodeCopy into interpreting the characters as is. Release note (bug fix): `COPY` previously did not allow a backslash of any character other than the special table set. CockroachDB would error in these cases. This is changed to allow in any character after a backslash and interpret it to mean the character itself as per PostgreSQL (e.g. now `\a` will be interpreted as `a`). Furthermore, non hex-digits following a `\x` is now interpreted without the backslash, (e.g. `\xH` as `xH`). Strings ending with a single backslash will use the backslash (e.g. `x\\` is interpreted as `x\`).
madelynnblue
approved these changes
Jul 29, 2020
Contributor
Author
|
bors r=mjibson |
1 similar comment
Contributor
Author
|
bors r=mjibson |
Contributor
|
Build succeeded: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
According to the PostgreSQL docs:
Any other backslashed character that is not mentioned in the above
table will be taken to represent itself.
Reflect that change by converting error conditions from decodeCopy into
interpreting the characters as is.
Resolves #52067.
Release note (bug fix):
COPYpreviously did not allow a backslash ofany character other than the special table set. CockroachDB would error
in these cases. This is changed to allow in any character after a
backslash and interpret it to mean the character itself as per PostgreSQL
(e.g. now
\awill be interpreted asa). Furthermore, non hex-digitsfollowing a
\xis now interpreted without the backslash, (e.g.\xHasxH). Strings ending with a single backslash will use the backslash(e.g.
x\\is interpreted asx\).