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

sql: fix leak of prepared statements #33529

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 2 additions & 5 deletions pkg/sql/conn_executor.go
Expand Up @@ -1596,7 +1596,7 @@ func (ex *connExecutor) commitPrepStmtNamespace(ctx context.Context) {
ctx, &ex.prepStmtsNamespace)
}

// commitPrepStmtNamespace deallocates everything in prepStmtsNamespace that's
// rewindPrepStmtNamespace deallocates everything in prepStmtsNamespace that's
// not part of prepStmtsNamespaceAtTxnRewindPos.
func (ex *connExecutor) rewindPrepStmtNamespace(ctx context.Context) {
ex.prepStmtsNamespace.resetTo(
Expand Down Expand Up @@ -2210,10 +2210,7 @@ func (ps connExPrepStmtsAccessor) Delete(ctx context.Context, name string) bool

// DeleteAll is part of the preparedStatementsAccessor interface.
func (ps connExPrepStmtsAccessor) DeleteAll(ctx context.Context) {
ps.ex.prepStmtsNamespace = prepStmtNamespace{
prepStmts: make(map[string]prepStmtEntry),
portals: make(map[string]portalEntry),
}
ps.ex.prepStmtsNamespace.resetTo(ctx, &prepStmtNamespace{})
}

// contextStatementKey is an empty type for the handle associated with the
Expand Down