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

release-20.2: sql: fix reg* cast escaping #58030

Closed
wants to merge 2 commits into from

Conversation

rafiss
Copy link
Collaborator

@rafiss rafiss commented Dec 17, 2020

Backport 2/2 commits from #55607.

/cc @cockroachdb/release

fixes #57971
see #57559 for an explanation of the changed logic test output for "char"


Resolves #53686


tree: add more casting fixes for text to reg*

Release note (sql change): Added ability to cast a string containing all
integers to be cast into a given regtype, e.g. '1234'::regproc is now
valid.

Release note (bug fix): Fixed a bug where casts from string to regproc,
regtype or regprocedure would not work if they contained " characters at
the beginning or at the end.

sql: fix unescaped casts to regclass types

Release note (bug fix): Fix a bug where casts to
regclass were not escaped (i.e. when the
type or table name had " characters).

Release note (bug fix): Fix a bug where casts to
regclass were not escaped (i.e. when the
type or table name had " characters).
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Release note (sql change): Added ability to cast a string containing all
integers to be cast into a given regtype, e.g. '1234'::regproc is now
valid.

Release note (bug fix): Fixed a bug where casts from string to regproc,
regtype or regprocedure would not work if they contained " characters at
the beginning or at the end.
@rafiss rafiss force-pushed the backport20.2-55607 branch from 27bf5ac to 5f2388d Compare December 17, 2020 23:09
@rafiss rafiss requested review from solongordon and a team December 18, 2020 00:09
@solongordon
Copy link
Contributor

This fix looks somewhat involved so I want to better understand the severity of the bug so we can make a call about the risk. Is the main reason for backporting this to support TypeORM? Is it newly broken in 20.2? Do we know if TypeORM will be well-supported once this bug is fixed?

@otan
Copy link
Contributor

otan commented Jan 3, 2021

I didn't backport this for the reason above, i.e. it is a high risk change which was already a bug before 20.2...

@rafiss
Copy link
Collaborator Author

rafiss commented Jan 4, 2021

My bad, I thought this broke TypeORM starting in 20.2 since I misread #57971. But this is new behavior in TypeORM (typeorm/typeorm@bc623a4#diff-3af60f660db25bba92d1aadb6b0d86dfad4cc1e4f0061f8b767b66c3c512b05d)

@rafiss rafiss closed this Jan 4, 2021
@rafiss rafiss deleted the backport20.2-55607 branch January 4, 2021 17:08
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.

4 participants