Skip to content

Commit

Permalink
Merge #103643
Browse files Browse the repository at this point in the history
103643: sql: prevent panic when reading annotation in COPY TO r=rafiss a=rafiss

fixes #103541

Release note (bug fix): Fixed a panic that could occur if a COPY TO statement that had a subquery was logged with redaction markers.

Co-authored-by: Rafi Shamim <[email protected]>
  • Loading branch information
craig[bot] and rafiss committed May 19, 2023
2 parents 0bd4172 + a2859aa commit d529e9d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/sql/conn_executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -2893,7 +2893,7 @@ func (ex *connExecutor) setCopyLoggingFields(stmt statements.Statement[tree.Stat
ex.planner.stmt = Statement{
Statement: stmt,
}
ann := tree.MakeAnnotations(0)
ann := tree.MakeAnnotations(stmt.NumAnnotations)
ex.planner.extendedEvalCtx.Context.Annotations = &ann
ex.planner.extendedEvalCtx.Context.Placeholders = &tree.PlaceholderInfo{}
ex.planner.curPlan.init(&ex.planner.stmt, &ex.planner.instrumentation)
Expand Down

0 comments on commit d529e9d

Please sign in to comment.