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-23.2: backupccl: replace UDT IDs within routine bodies and views #116841
release-23.2: backupccl: replace UDT IDs within routine bodies and views #116841
Conversation
During a database RESTORE, it is necessary to replace descriptor IDs from the old database with those from the new. Previously, we forgot to do this rewrite for UDT IDs in routine bodies and views. This would prevent using a database RESTORE with a user-defined function, stored procedure, or view, that referenced a user-defined type. This patch adds the needed rewrite logic and expands existing tests. Fixes #116653 Release note (bug fix): Fixed a bug that prevented database RESTORE when the database contained a view or routine that referenced a user-defined type in the body string. For views, this bug was introduced in v20.2, when UDTs were introduced. For routines, this bug was introduced in v22.2, when UDFs were introduced.
24d8a4e
to
7164ca9
Compare
Thanks for opening a backport. Please check the backport criteria before merging:
If your backport adds new functionality, please ensure that the following additional criteria are satisfied:
Also, please add a brief release justification to the body of your PR to justify this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 6 of 6 files at r1, all commit messages.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @rafiss)
Test failure is an unrelated timeout. |
Backport 1/1 commits from #116656 on behalf of @DrewKimball.
/cc @cockroachdb/release
During a database RESTORE, it is necessary to replace descriptor IDs
from the old database with those from the new. Previously, we forgot
to do this rewrite for UDT IDs in routine bodies and views. This would
prevent using a database RESTORE with a user-defined function, stored
procedure, or view, that referenced a user-defined type. This patch
adds the needed rewrite logic and expands existing tests.
Fixes #116653
Release note (bug fix): Fixed a bug that prevented database RESTORE when
the database contained a view or routine that referenced a user-defined
type in the body string. For views, this bug was introduced in v20.2, when
UDTs were introduced. For routines, this bug was introduced in v22.2, when
UDFs were introduced.
Release justification: bug fix for broken functions after restore