-
Notifications
You must be signed in to change notification settings - Fork 713
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: The audit plugin implementation MySQL is reusing a variable that does not always reflect rows sent to client. This means that that in many cases, it is not counting the actual rows sent to the client. There is a more accurate count on the THD object that should be used instead. I am ignoring the documentation so that it just returns the number of rows returned the client: (https://dev.mysql.com/doc/refman/5.5/en/writing-audit-plugins.html) I am also adding new fields that will be passed into the audit plugin. This includes, number of affected rows, the connection certificate, and query attributes. Query attributes and connection certificates are currently not implemented, but will come shortly. If the distinction between commands that return no results, and commands that return empty results is important, then look at affected rows. For commands that return no results, affected rows is non-negative. For SELECTs that return empty results, affected rows is -1. Test Plan: Tested manually in gdb with SELECT/INSERT/UPDATE/DELETE queries: create table t (i int); select * from t; result rows: 0 affect rows: -1 insert into t values (1), (2); result rows: 0 affect rows: 2 update t set i = 3 where i = 2; result rows: 0 affect rows: 1 select * from t; result rows: 2 affect rows: -1 delete from t; result rows: 0 affect rows: 2 Reviewers: jtolmer, tianx Reviewed By: tianx Subscribers: webscalesql-eng Differential Revision: https://reviews.facebook.net/D49329
- Loading branch information
Showing
4 changed files
with
68 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters