Hi!
On Mar 14, Antony T Curtis wrote:
> On 14 Mar, 2008, at 13:02, Sergei Golubchik wrote:
> >On Feb 29, Antony T Curtis wrote:
> >>On 27 Feb, 2008, at 12:52, Sergei Golubchik wrote:
> >>
> >>>>--- /dev/null Wed Dec 31 16:00:00 196900
> >>>>+++ b/include/mysql/plugin_audit.h 2008-02-22 08:56:22 -08:00
> >>>>@@ -0,0 +1,78 @@
> >>>.....
> >>>>+#define MYSQL_AUDIT_CLASS_MASK_SIZE 1
> >>>>+typedef unsigned long long
> >>>>mysql_audit_mask_t[MYSQL_AUDIT_CLASS_MASK_SIZE];
> >>>>+
> >>>>+struct st_mysql_audit
> >>>>+{
> >>>>+ int interface_version;
> >>>>+ const mysql_audit_mask_t *class_mask;
> >>>
> >>>sorry, I don't understand - a pointer to an array ?
> >>>You had a pointer to ulonglong, I suggested to change a pointer to
> >>>an array. But now you have a pointer to an array. One dereference
> >>>too much.
> >>
> >>Pointer to an array, same amount of dereferencing as original pointer
> >>to ulonglong except that array is now not unbounded.
> >
> >okay, but why not to have this array in the st_mysql_audit structure ?
>
> future proofing... allows mask to grow without changing structure.
> Additional logic can be added in the future so that for audit iface
> version X has A class_mask elements etc.
Okay, what about a (simpler, I think) solution that builds on top of the
existing code and doesn't require additional logic:
make an array inlined in st_mysql_audit, but move it to the end of the
structure. This way it can be expanded in the future, increasing the
minor API version - version checking code will do the rest.
> >>>>+ void (*release_thd)(MYSQL_THD);
> >>>>+ void (*event_notify)(MYSQL_THD, const struct mysql_event *);
> >>>>+};
> >>>>+
> >>>>diff -Nrup a/sql/mysqld.cc b/sql/mysqld.cc
> >>>>--- a/sql/mysqld.cc 2008-02-14 01:00:48 -08:00
> >>>>+++ b/sql/mysqld.cc 2008-02-22 08:56:20 -08:00
> >>>>@@ -4313,6 +4325,7 @@ int main(int argc, char **argv)
> >>>>#endif
> >>>>clean_up(1);
> >>>>wait_for_signal_thread_to_end();
> >>>>+ mysql_audit_finalize();
> >>>
> >>>Cannot you have mysql_audit_finalize() in one place ?
> >>
> >>It seemed to interfere with my aesthetic sense having it in
> >>clean_up_mutexes() because all the other lines in that function are
> >>pthread_mutex_destroy() calls.
> >
> >okay, I can see that.
> >Could you try to find a place for this call to have it only once and
> >still not interfere with your aesthetic sense ?
>
> ok, I shall investigate suitable locations.
Thanks.
Regards / Mit vielen Grüssen,
Sergei
--
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Sergei Golubchik <serg@stripped>
/ /|_/ / // /\ \/ /_/ / /__ Principal Software Developer/Server Architect
/_/ /_/\_, /___/\___\_\___/ MySQL GmbH, Dachauer Str. 37, D-80335 München
<___/ Geschäftsführer: Kaj Arnö - HRB
München 162140