Track partition offsets and only log unsafe for non-selects

This commit is contained in:
Kegan Dougal 2020-09-01 19:17:01 +01:00
parent bfecc8e0e9
commit 7bf2a27319
2 changed files with 15 additions and 2 deletions

View file

@ -53,7 +53,7 @@ func (in *traceInterceptor) StmtQueryContext(ctx context.Context, stmt driver.St
safe = w.Safe()
}
}
if safe != "" {
if safe != "" && !strings.HasPrefix(query, "SELECT ") {
logrus.Infof("unsafe: %s -- %s", safe, query)
}
@ -75,7 +75,7 @@ func (in *traceInterceptor) StmtExecContext(ctx context.Context, stmt driver.Stm
safe = w.Safe()
}
}
if safe != "" {
if safe != "" && !strings.HasPrefix(query, "SELECT ") {
logrus.Infof("unsafe: %s -- %s", safe, query)
}