<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>transactions? on FromDual GmbH</title><link>https://www.fromdual.com/blog/mysql-logon-and-logoff-trigger-for-auditing/comment-89/</link><description>Recent content in transactions? on FromDual GmbH</description><generator>Hugo</generator><language>en-GB</language><managingEditor>oli.sennhauser@fromdual.com (Oli Sennhauser)</managingEditor><webMaster>oli.sennhauser@fromdual.com (Oli Sennhauser)</webMaster><copyright>© FromDual GmbH</copyright><lastBuildDate>Sat, 11 Dec 2010 00:28:30 +0200</lastBuildDate><atom:link href="https://www.fromdual.com/blog/mysql-logon-and-logoff-trigger-for-auditing/comment-89/index.xml" rel="self" type="application/rss+xml"/><item><title>transactions?</title><link>https://www.fromdual.com/blog/mysql-logon-and-logoff-trigger-for-auditing/comment-89/</link><pubDate>Sat, 11 Dec 2010 00:28:30 +0200</pubDate><author>oli.sennhauser@fromdual.com (Oli Sennhauser)</author><guid>https://www.fromdual.com/blog/mysql-logon-and-logoff-trigger-for-auditing/comment-89/</guid><description>&lt;p&gt;Does the statement run in its own transaction after the main connection terminates?&lt;/p&gt;
&lt;p&gt;For example:
conn_begin
BEGIN
insert into some_table (&amp;hellip;)
/* connection is lost*/
(implicit rollback)&lt;/p&gt;
&lt;p&gt;audit_trigger_begin:
BEGIN &amp;ndash; hope this doesn&amp;rsquo;t commit the old work!
INSERT INTO some_audit_table (&amp;hellip;)
COMMIT&lt;/p&gt;
&lt;p&gt;Does the SQL properly increment global status variables, etc?&lt;/p&gt;
&lt;p&gt;Also your triggers access the information schema a lot. Consider reading from STATUS_VARIABLES/GLOBAL_VARIABLES and pulling multiple values at once. The entire structure is materialized when you access the table so you might as well access as much data as you can in one pass.&lt;/p&gt;</description></item></channel></rss>