Skip to content

sql: remove unused dropOwnedByNode#137739

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
mgartner:remove-drop-owned-by
Dec 19, 2024
Merged

sql: remove unused dropOwnedByNode#137739
craig[bot] merged 1 commit intocockroachdb:masterfrom
mgartner:remove-drop-owned-by

Conversation

@mgartner
Copy link
Copy Markdown
Contributor

@mgartner mgartner commented Dec 19, 2024

DROP OWNED BY is supported only in the declarative schema changer and
dropOwnedByNode is not used, so it has been removed.

Epic: None

Release note: None

@mgartner mgartner requested a review from a team as a code owner December 19, 2024 02:38
@blathers-crl
Copy link
Copy Markdown

blathers-crl bot commented Dec 19, 2024

It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR?

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Member

@yuzefovich yuzefovich left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 4 of 4 files at r1, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @mgartner)

Copy link
Copy Markdown
Collaborator

@rafiss rafiss left a comment

Choose a reason for hiding this comment

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

i'm not sure if we should go with this PR. it would cause the following noisy behavior in explicit transactions:

root@localhost:26257/defaultdb> begin;
BEGIN

root@localhost:26257/defaultdb  OPEN> drop owned by root;
ERROR: internal error: unknown opaque statement *tree.DropOwnedBy
SQLSTATE: XX000
DETAIL: stack trace:
pkg/sql/opaque.go:312: planOpaque()
pkg/sql/opaque.go:59: buildOpaque()
pkg/sql/opt/optbuilder/opaque.go:65: tryBuildOpaque()
pkg/sql/opt/optbuilder/builder.go:483: buildStmt()
pkg/sql/opt/optbuilder/builder.go:316: buildStmtAtRootWithScope()
pkg/sql/opt/optbuilder/builder.go:297: buildStmtAtRoot()
pkg/sql/opt/optbuilder/builder.go:276: Build()
pkg/sql/plan_opt.go:824: buildExecMemo()
pkg/sql/plan_opt.go:260: makeOptimizerPlan()
pkg/sql/conn_executor_exec.go:3187: makeExecPlan()
pkg/sql/conn_executor_exec.go:2729: dispatchToExecutionEngine()
pkg/sql/conn_executor_exec.go:1025: execStmtInOpenState()
pkg/sql/conn_executor_exec.go:164: func2()
pkg/sql/conn_executor_exec.go:4334: execWithProfiling()
pkg/sql/conn_executor_exec.go:163: execStmt()
pkg/sql/conn_executor.go:2381: func1()
pkg/sql/conn_executor.go:2386: execCmd()
pkg/sql/conn_executor.go:2303: run()
pkg/sql/conn_executor.go:999: ServeConn()
pkg/sql/pgwire/conn.go:252: processCommands()
pkg/sql/pgwire/server.go:1197: func4()
src/runtime/asm_arm64.s:1222: goexit()

a related issue is #137615; we want to move all these statements that are unimplemented in the legacy schema changer to one place.

`DROP OWNED BY` is supported only in the declarative schema changer and
`dropOwnedByNode` is not used, so it has been removed.

Release note: None
@mgartner mgartner force-pushed the remove-drop-owned-by branch from dd9588e to abbbbc2 Compare December 19, 2024 14:39
@mgartner
Copy link
Copy Markdown
Contributor Author

Ahh, good catch @rafiss. I changed the PR to just remove the plan node, not the unimplemented error code path.

Copy link
Copy Markdown
Collaborator

@rafiss rafiss left a comment

Choose a reason for hiding this comment

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

thanks for the cleanup!

Reviewed 1 of 4 files at r1, 3 of 3 files at r2, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @mgartner)

@mgartner
Copy link
Copy Markdown
Contributor Author

TFTRs!

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Dec 19, 2024

@craig craig bot merged commit a833dc2 into cockroachdb:master Dec 19, 2024
@mgartner mgartner deleted the remove-drop-owned-by branch December 19, 2024 21:13
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