Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v10] Fix DB Query always return success false in audit log #23276

Merged
merged 2 commits into from
Mar 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/srv/db/common/audit.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ func (a *audit) OnQuery(ctx context.Context, session *Session, query Query) {
DatabaseMetadata: MakeDatabaseMetadata(session),
DatabaseQuery: query.Query,
DatabaseQueryParameters: query.Parameters,
Status: events.Status{
Success: true,
},
}
if query.Database != "" {
event.DatabaseMetadata.DatabaseName = query.Database
Expand Down
3 changes: 3 additions & 0 deletions lib/srv/db/sqlserver/engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ func TestHandleConnectionAuditEvents(t *testing.T) {
Code: libevents.DatabaseSessionQueryCode,
},
DatabaseQuery: "\nselect 'foo' as 'bar'\n ",
Status: events.Status{
Success: true,
},
}),
},
},
Expand Down