maria-developers team mailing list archive
-
maria-developers team
-
Mailing list archive
-
Message #06178
Re: Rev 3876: MDEV-4472 Audit-plugin. Server-related part of the task
Hi, Alexey!
On Sep 04, Alexey Botchkov wrote:
> 03.09.2013 16:02, Sergei Golubchik wrote:
> >
> >> + long long query_id;
> > should it rather be unsigned?
>
> For the THD structure we have:
> typedef int64 query_id_t;
> So that it's originally unsigned.
You mean "originally signed". Yes, I know.
But I think that for API purposes we'd better make it unsigned.
> > + char *local_mysql_data_home;
> > +#ifdef _WIN32
> > + local_mysql_data_home= (char *)GetProcAddress(0, "mysql_data_home");
> > +#else
> > + local_mysql_data_home= mysql_data_home;
> > +#endif /*_WIN32*/
> > You shouldn't need it, file_logger.c is part of the server, not a
> > dynamically loaded plugin.
>
> For now the plugin supposed to handle older Maria's and even MySQL.
> So we have to include the file-logger code in there.
Yes. But this file is part of the server code, not part of the plugin.
The plugin is not even in the tree.
> >> === modified file 'sql/sql_audit.h'
> >> --- a/sql/sql_audit.h 2013-04-19 10:50:16 +0000
> >> +++ b/sql/sql_audit.h 2013-09-03 08:25:21 +0000
> >> @@ -139,7 +140,8 @@ void mysql_audit_general(THD *thd, uint
> >>
> >> mysql_audit_notify(thd, MYSQL_AUDIT_GENERAL_CLASS, event_subtype,
> >> error_code, time, user, userlen, msg, msglen,
> >> - query.str(), query.length(), query.charset(), rows);
> >> + query.str(), query.length(), query.charset(), rows,
> >> + thd->db, thd->db_length);
> > no query_id?
>
> No query_id.
> An appropriate 'handler' is called inside the mysql_audit_notify for
> each type of events, receiving
> the 'thd' as a parameter.
> There the event->query_id is actually set. See general_class_handler()
> in sql/sql_audit.cc for example.
Right. Sorry. I've missed that.
Regards,
Sergei
Follow ups
References