You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
0 commit comments