Skip to content

*: fix some audit log error#26767

Merged
ti-chi-bot merged 10 commits intopingcap:masterfrom
tiancaiamao:fix-audit-log-master
Aug 5, 2021
Merged

*: fix some audit log error#26767
ti-chi-bot merged 10 commits intopingcap:masterfrom
tiancaiamao:fix-audit-log-master

Conversation

@tiancaiamao
Copy link
Contributor

What problem does this PR solve?

Problem Summary:

Some of the audit log are incorrect:
https://docs.google.com/spreadsheets/d/1E59z7busbRwjb2D20QLbmAGhLT75vec44HTB5vi2WrI/edit#gid=0

What is changed and how it works?

What's Changed:

Fix the following bugs:

  • 'drop review' is not logged as 'drop table'
  • 'create sesson binding' logged as 'explain'
  • prepare statement operation is not logged
  • 'trace' statement is logged as 'select'
  • no audit log for 'shutdown' statement

How it Works:

Some are caused by AST not registed in GetStmtLabel()
Some are caused by the statement execute some other SQL internally and change the statement context

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Fix some audit log that do not work as expected, including 'drop view'/'create session binding'/'prepare'/'trace'/'shutdown' etc

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Jul 31, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • djshow832
  • lysu

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Details

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 31, 2021
@tiancaiamao
Copy link
Contributor Author

release 3.0 is fixed by #26489

@github-actions github-actions bot added sig/execution SIG execution sig/planner SIG: Planner sig/sql-infra SIG: SQL Infra labels Jul 31, 2021
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Aug 3, 2021
Co-authored-by: djshow832 <zhangming@pingcap.com>
@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Aug 4, 2021
@tiancaiamao
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

DetailsCommit hash: bcf9547

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Aug 5, 2021
@ti-chi-bot ti-chi-bot merged commit 072cf27 into pingcap:master Aug 5, 2021
@tiancaiamao tiancaiamao deleted the fix-audit-log-master branch August 5, 2021 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/execution SIG execution sig/planner SIG: Planner sig/sql-infra SIG: SQL Infra size/L Denotes a PR that changes 100-499 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants