Skip to content

Commit

Permalink
Write more compact log detail for matcher
Browse files Browse the repository at this point in the history
  • Loading branch information
nassibnassar committed Oct 8, 2024
1 parent 7d5b570 commit b87adaa
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion cmd/metadb/server/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,21 @@ func isCurrentIdenticalMatch(ctx context.Context, cmd *command.Command, tx *pgxp
b.WriteString(" LIMIT 1")
rows, err := tx.Query(ctx, b.String())
if err != nil {
log.Detail("%s", b.String())
var d strings.Builder
fmt.Fprintf(&d, "matching: %s.%s:", table.Schema, table.Table)
fmt.Fprintf(&d, " __origin='%s'", cmd.Origin)
for i := range columns {
if columns[i].Unavailable {
continue
}
fmt.Fprintf(&d, " %s=", columns[i].Name)
if columns[i].Data == nil {
d.WriteString("null")
} else {
encodeSQLData(&d, columns[i].SQLData, columns[i].DType)
}
}
log.Detail("%s", d.String())
return false, 0, fmt.Errorf("querying for matching current row: %w", err)
}
defer rows.Close()
Expand Down

0 comments on commit b87adaa

Please sign in to comment.