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

workload/schemachange: implement COMMENT ON #115360

Closed
wants to merge 4 commits into from

Conversation

chrisseto
Copy link
Contributor

@chrisseto chrisseto commented Nov 30, 2023

This PR is stacked on top of others!

Please consider reviewing those PRs first. This message will be removed once prerequisite PRs are merged and this one is rebased.


be063ef workload/schemachange: implement COMMENT ON

This commit adds support for attaching comments to various schema
elements in the RSW. Notably, commenting on databases has been omitted
as the workload operates within the scope of a given database.

Unfortunately, COMMENT ON will consistently trigger the bug reported
in #72820. Therefore it is disabled by default.

Epic: CRDB-19168
Informs: CRDB-3265
Informs: #72820
Release note: None

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@chrisseto chrisseto changed the title workload/schemachange: implement COMMENT ON workload/schemachange: implement COMMENT ON Nov 30, 2023
@rafiss rafiss requested a review from Xiang-Gu December 4, 2023 15:12
@chrisseto chrisseto marked this pull request as ready for review December 19, 2023 19:20
@chrisseto chrisseto requested a review from a team as a code owner December 19, 2023 19:20
@chrisseto chrisseto requested review from DarrylWong and renatolabs and removed request for a team December 19, 2023 19:20
This commit adds support for the `CREATE FUNCTION` DDL to the RSW.

While the space for possible UDF incantations is quite large, this
commit focused on permutations that are of interest to schema changes.
That is to say, the body of the UDF does not have much, if any,
variation but will be comprised of references to tables and UDTs.

Unfortunately, the introduction of UDFs in the descriptor graph has
aggravated an issue within `DROP SCHEMA CASCADE`.

This commit contains attempts to correct said issues to no avail. It's
possible that either the DSC or LSC are missing some logic for handling
UDFs that contain references to UDTs. Prior to this commit, errors
preventing the schema from being dropped would be thrown. After it,
expected errors are not thrown appropriately despite the checks being
hand verified for correctness.

Epic: CRDB-19168
Informs: CRDB-3265
Release note: None
This commit adds support for the `DROP FUNCTION` DDL to the RSW.

Epic: CRDB-19168
Informs: CRDB-3265
This commit adds support for the `ALTER FUNCTION RENAME TO` and the `ALTER
FUNCTION SET SCHEMA` DDLs to the RSW.

Other incantations of `ALTER FUNCTION`, namely `OWNER TO` and modifiers,
such as `STRICT`, have been omitted as they seem less likely to discover
schema related issues.

Epic: CRDB-19168
Informs: CRDB-3265
Release note: None
This commit adds support for attaching comments to various schema
elements in the RSW. Notably, commenting on databases has been omitted
as the workload operates within the scope of a given database.

Unfortunately, `COMMENT ON` will consistently trigger the bug reported
in cockroachdb#72820. Therefore it is disabled by default.

Epic: CRDB-19168
Informs: CRDB-3265
Informs: cockroachdb#72820
Release note: None
craig bot pushed a commit that referenced this pull request Dec 26, 2023
116790: workload/schemachange: fix `CREATE SCHEMA` for the DSC r=rafiss a=chrisseto

### This PR is stacked on top of others!

Please consider reviewing those PRs first. This message will be removed once prerequisite PRs are merged and this one is rebased.

* 6e1ea5d is from #115357
* 230b588 is from #115358
* 4cc9b45 is from #115359
* be063ef is from #115360
* 4e89e34 is from #116788
* 95ffcf4 is from #116789

---

#### 89e761126789d2828e141339c34e739203da2310 workload/schemachange: fix `CREATE SCHEMA` for the DSC

Previously, `CREATE SCHEMA` would break if executed with the declarative
schema changer due to the inclusion of `AUTHORIZATION`.

This commit removes the `AUTHORIZATION` clause from `CREATE SCHEMA`
operations until it's support within the DSC.

Epic: none
Release note: None

Co-authored-by: Chris Seto <chriskseto@gmail.com>
@rafiss
Copy link
Collaborator

rafiss commented Dec 26, 2023

subsumed by #116790

@rafiss rafiss closed this Dec 26, 2023
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.

None yet

3 participants