Skip to content

Added users data to history table#1079

Open
losgrandes wants to merge 3 commits intopercona:3.xfrom
losgrandes:mychanges
Open

Added users data to history table#1079
losgrandes wants to merge 3 commits intopercona:3.xfrom
losgrandes:mychanges

Conversation

@losgrandes
Copy link

Background

Idea behind this PR is to add information about DB users who executed a query to the history table. I've decided to add JSON column to store array of users for each query. There are probably more elegant solutions, but I wanted to keep "one table" concept.

Summary of changes

  • added optional usernames JSON type column with support for it in history table
  • updated documentation
  • updated existing and added new tests case

@losgrandes losgrandes marked this pull request as ready for review February 19, 2026 07:37
@svetasmirnova
Copy link
Collaborator

Thank you for the contribution. You modified auto-generated code that will be rewritten after we run , ./utils/update-modules. Please add your changes into lib/QueryHistory.pm, then update modules in all tools as described in CONTRIBUTING.md

Copy link
Collaborator

@svetasmirnova svetasmirnova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update lib/QueryHistory.pm

@losgrandes
Copy link
Author

Thank you for the contribution. You modified auto-generated code that will be rewritten after we run , ./utils/update-modules. Please add your changes into lib/QueryHistory.pm, then update modules in all tools as described in CONTRIBUTING.md

My apologies for overlooking this.
I've run for t in bin/*; do ./util/update-modules ${t} QueryHistory; done and committed these changes. Should be good.
Thanks.

@svetasmirnova
Copy link
Collaborator

Changes look good for me, thank you!

But MySQL user accounts consist of two parts: usernames and hosts. E.g., sveta@percona.com is not the same user as sveta@my.blog. Maybe it makes sense to store host part too?

Copy link
Collaborator

@svetasmirnova svetasmirnova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix this stalled table name in the user manual part of the code too (query_review_history -> query_history).

Co-authored-by: Sveta Smirnova <svetasmirnova@users.noreply.github.com>
@losgrandes
Copy link
Author

Changes look good for me, thank you!

But MySQL user accounts consist of two parts: usernames and hosts. E.g., sveta@percona.com is not the same user as sveta@my.blog. Maybe it makes sense to store host part too?

This is very good idea, Sveta. In this code change I have reused already available user data which doesn't contain host information.
Adding that info requires reworking tools' core logic, which I would like to avoid currently.
I think it would be safer to add it later. WDYT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants