-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
plpgsql: implement CLOSE statements #111330
Conversation
The first two commits are #110709. |
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.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @mgartner)
856777a
to
235c32a
Compare
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 1 of 15 files at r3, 35 of 35 files at r5, 29 of 29 files at r6, all commit messages.
Reviewable status: complete! 1 of 0 LGTMs obtained (and 1 stale) (waiting on @DrewKimball)
pkg/sql/faketreeeval/evalctx.go
line 343 at r5 (raw file):
// PLpgSQLCloseCursor is part of the eval.Planner interface. func (*DummyEvalPlanner) PLpgSQLCloseCursor(_ tree.Name) error { return nil
nit: Shouldn't this return an error like some of the methods up above?
This patch adds the `crdb_internal.plpgsql_close` builtin, which closes the cursor with the given name. It returns a `34000` error if there is no cursor with the given name. A following commit will use this to implement the PLpgSQL CLOSE statement. Informs cockroachdb#109709 Release note: None
This patch implements the PLpgSQL CLOSE statement, which allows a PLpgSQL routine to close a cursor with the name specified by a cursor variable. Closing the cursor is handled by the internal builtin function `crdb_internal.plpgsql_close`. Informs cockroachdb#109709 Release note (sql change): Added support for the PLpgSQL CLOSE statement.
235c32a
to
d2070e5
Compare
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.
TFTRs!
Reviewable status: complete! 1 of 0 LGTMs obtained (and 1 stale) (waiting on @DrewKimball)
pkg/sql/faketreeeval/evalctx.go
line 343 at r5 (raw file):
Previously, mgartner (Marcus Gartner) wrote…
nit: Shouldn't this return an error like some of the methods up above?
Done.
bors r+ |
Build succeeded: |
plpgsql: add builtin function for closing cursors
This patch adds the
crdb_internal.plpgsql_close
builtin, which closesthe cursor with the given name. It returns a
34000
error if there isno cursor with the given name. A following commit will use this to
implement the PLpgSQL CLOSE statement.
Informs #109709
Release note: None
plpgsql: implement CLOSE statements
This patch implements the PLpgSQL CLOSE statement, which allows a
PLpgSQL routine to close a cursor with the name specified by a cursor
variable. Closing the cursor is handled by the internal builtin function
crdb_internal.plpgsql_close
.Informs #109709
Release note (sql change): Added support for the PLpgSQL CLOSE statement.