Bug #5739 init_connect='set autocommit=0' doesn't work on Windows
Submitted: 24 Sep 2004 18:33 Modified: 25 Sep 2004 7:07
Reporter: Daniel Cournoyer Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S2 (Serious)
Version:4.15 OS:Windows (Windows 2000/XP)
Assigned to: CPU Architecture:Any

[24 Sep 2004 18:33] Daniel Cournoyer
Description:
When setting the global value "init_connect='set autocommit=0'" or putting it in my.cnf, the variable "autocommit" is write but not loaded.

How to repeat:
init_connect='set autocommit=0' present in my.cnf. Connect to mysql with the command line client. Then, a "show variables" shows the correct content of init_connect (SET AUTOCOMMIT=0) but "select @@autocommit" still show 1.

Tested with:
  - Client MySQL 4.14 and 4.15 on Windows XP and 2000
  - Server MySQL 4.14 and 4.15 on Windows XP and 2000

Server process running as service.

Suggested fix:
Make sure that the init_connect get process.
[25 Sep 2004 7:07] Guilhem Bichot
Thank you for your bug report. This issue has been addressed in the
documentation. The updated documentation will appear on our website
shortly, and will be included in the next release of the relevant
product(s).

Additional info:

Bonjour Daniel,
You are right, there is something wrong. The behaviour you see is expected, but the documentation forgot to mention it. I just added this to the manual:

Note that the content of @code{init_connect} is not executed for users having
the @code{SUPER} privilege; this is in case that content has been wrongly set
(contains a wrong query, for example with a syntax error),
thus making all connections fail. Not executing it for @code{SUPER} users
enables those to open a connection and fix @code{init_connect}.

(as a consequence, if you are running the MySQL server with --skip-grant-tables, init-connect will never be executed as every user gets SUPER in that case).
Thank you for your bug report.