@@ -120,7 +120,6 @@ func (s executorType) logLabel() string { return logLabels[s] }
120120func (p * planner ) maybeLogStatement (
121121 ctx context.Context ,
122122 execType executorType ,
123- isCopy bool ,
124123 numRetries , txnCounter , rows , stmtCount int ,
125124 bulkJobId uint64 ,
126125 err error ,
@@ -132,7 +131,7 @@ func (p *planner) maybeLogStatement(
132131 statsCollector sqlstats.StatsCollector ,
133132) {
134133 p .maybeAuditRoleBasedAuditEvent (ctx , execType )
135- p .maybeLogStatementInternal (ctx , execType , isCopy , numRetries , txnCounter ,
134+ p .maybeLogStatementInternal (ctx , execType , numRetries , txnCounter ,
136135 rows , stmtCount , bulkJobId , err , queryReceived , hasAdminRoleCache ,
137136 telemetryLoggingMetrics , stmtFingerprintID , queryStats , statsCollector ,
138137 )
@@ -141,7 +140,6 @@ func (p *planner) maybeLogStatement(
141140func (p * planner ) maybeLogStatementInternal (
142141 ctx context.Context ,
143142 execType executorType ,
144- isCopy bool ,
145143 numRetries , txnCounter , rows , stmtCount int ,
146144 bulkJobId uint64 ,
147145 err error ,
@@ -235,7 +233,7 @@ func (p *planner) maybeLogStatementInternal(
235233 auditEvent := builder .BuildAuditEvent (ctx , p , eventpb.CommonSQLEventDetails {}, execDetails )
236234 entries [idx ] = auditEvent
237235 }
238- p .logEventsOnlyExternally (ctx , isCopy , entries ... )
236+ p .logEventsOnlyExternally (ctx , entries ... )
239237 }
240238
241239 if slowQueryLogEnabled && (
@@ -247,12 +245,12 @@ func (p *planner) maybeLogStatementInternal(
247245 switch {
248246 case execType == executorTypeExec :
249247 // Non-internal queries are always logged to the slow query log.
250- p .logEventsOnlyExternally (ctx , isCopy , & eventpb.SlowQuery {CommonSQLExecDetails : execDetails })
248+ p .logEventsOnlyExternally (ctx , & eventpb.SlowQuery {CommonSQLExecDetails : execDetails })
251249
252250 case execType == executorTypeInternal && slowInternalQueryLogEnabled :
253251 // Internal queries that surpass the slow query log threshold should only
254252 // be logged to the slow-internal-only log if the cluster setting dictates.
255- p .logEventsOnlyExternally (ctx , isCopy , & eventpb.SlowQueryInternal {CommonSQLExecDetails : execDetails })
253+ p .logEventsOnlyExternally (ctx , & eventpb.SlowQueryInternal {CommonSQLExecDetails : execDetails })
256254 }
257255 }
258256
@@ -267,13 +265,12 @@ func (p *planner) maybeLogStatementInternal(
267265 // see a copy of the execution on the DEV Channel.
268266 dst : LogExternally | LogToDevChannelIfVerbose ,
269267 verboseTraceLevel : execType .vLevel (),
270- isCopy : isCopy ,
271268 },
272269 & eventpb.QueryExecute {CommonSQLExecDetails : execDetails })
273270 }
274271
275272 if shouldLogToAdminAuditLog {
276- p .logEventsOnlyExternally (ctx , isCopy , & eventpb.AdminQuery {CommonSQLExecDetails : execDetails })
273+ p .logEventsOnlyExternally (ctx , & eventpb.AdminQuery {CommonSQLExecDetails : execDetails })
277274 }
278275
279276 if telemetryLoggingEnabled && ! p .SessionData ().TroubleshootingMode {
@@ -412,34 +409,32 @@ func (p *planner) maybeLogStatementInternal(
412409 SchemaChangerMode : p .curPlan .instrumentation .schemaChangerMode .String (),
413410 }
414411
415- p .logOperationalEventsOnlyExternally (ctx , isCopy , & sampledQuery )
412+ p .logOperationalEventsOnlyExternally (ctx , & sampledQuery )
416413 } else {
417414 telemetryMetrics .incSkippedQueryCount ()
418415 }
419416 }
420417}
421418
422- func (p * planner ) logEventsOnlyExternally (
423- ctx context.Context , isCopy bool , entries ... logpb.EventPayload ,
424- ) {
419+ func (p * planner ) logEventsOnlyExternally (ctx context.Context , entries ... logpb.EventPayload ) {
425420 // The API contract for logEventsWithOptions() is that it returns
426421 // no error when system.eventlog is not written to.
427422 _ = p .logEventsWithOptions (ctx ,
428423 2 , /* depth: we want to use the caller location */
429- eventLogOptions {dst : LogExternally , isCopy : isCopy },
424+ eventLogOptions {dst : LogExternally },
430425 entries ... )
431426}
432427
433428// logOperationalEventsOnlyExternally is a helper that sets redaction
434429// options to omit SQL Name redaction. This is used when logging to
435430// the telemetry channel when we want additional metadata available.
436431func (p * planner ) logOperationalEventsOnlyExternally (
437- ctx context.Context , isCopy bool , entries ... logpb.EventPayload ,
432+ ctx context.Context , entries ... logpb.EventPayload ,
438433) {
439434 // The API contract for logEventsWithOptions() is that it returns
440435 // no error when system.eventlog is not written to.
441436 _ = p .logEventsWithOptions (ctx ,
442437 2 , /* depth: we want to use the caller location */
443- eventLogOptions {dst : LogExternally , isCopy : isCopy , rOpts : redactionOptions {omitSQLNameRedaction : true }},
438+ eventLogOptions {dst : LogExternally , rOpts : redactionOptions {omitSQLNameRedaction : true }},
444439 entries ... )
445440}
0 commit comments