Skip to content

Commit 27fa7e6

Browse files
committed
sql: don't redact post-query type from errors
This commit fixes a minor oversight from when we introduced AFTER triggers: the type of post-query (cascade vs trigger) is redacted in error messages. This information is safe, so this commit marks the action type as a `SafeString`. Epic: None Release note: None
1 parent 99ad9a0 commit 27fa7e6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pkg/sql/opt/exec/execbuilder/post_queries.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717
"github.com/cockroachdb/cockroach/pkg/sql/sem/eval"
1818
"github.com/cockroachdb/cockroach/pkg/sql/sem/tree"
1919
"github.com/cockroachdb/errors"
20+
"github.com/cockroachdb/redact"
2021
)
2122

2223
// postQueryBuilder is a helper that fills in exec.PostQuery metadata; it
@@ -162,7 +163,7 @@ func (cb *postQueryBuilder) setupCascade(cascade *memo.FKCascade) exec.PostQuery
162163
numBufferedRows int,
163164
allowAutoCommit bool,
164165
) (exec.Plan, error) {
165-
const actionName = "cascade"
166+
const actionName redact.SafeString = "cascade"
166167
return cb.planPostQuery(
167168
ctx, semaCtx, evalCtx, execFactory, bufferRef, numBufferedRows, allowAutoCommit,
168169
cascade.Builder, actionName,
@@ -185,7 +186,7 @@ func (cb *postQueryBuilder) setupTriggers(triggers *memo.AfterTriggers) exec.Pos
185186
numBufferedRows int,
186187
allowAutoCommit bool,
187188
) (exec.Plan, error) {
188-
const actionName = "trigger"
189+
const actionName redact.SafeString = "trigger"
189190
return cb.planPostQuery(
190191
ctx, semaCtx, evalCtx, execFactory, bufferRef, numBufferedRows, allowAutoCommit,
191192
triggers.Builder, actionName,
@@ -209,7 +210,7 @@ func (cb *postQueryBuilder) planPostQuery(
209210
numBufferedRows int,
210211
allowAutoCommit bool,
211212
builder memo.PostQueryBuilder,
212-
actionName string,
213+
actionName redact.SafeString,
213214
) (exec.Plan, error) {
214215
// 1. Set up a brand new memo in which to plan the cascading query.
215216
var err error

0 commit comments

Comments
 (0)