Bug #35363 Errors during execution of init_script are not reported to client
Submitted: 18 Mar 2008 6:14 Modified: 18 Mar 2008 23:47
Reporter: Rizwan Maredia Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Security: Privileges Severity:S2 (Serious)
Version:5.1.22 OS:Any
Assigned to: CPU Architecture:Any
Tags: init_connect

[18 Mar 2008 6:14] Rizwan Maredia
Description:
When we set 'set @@global.init_connect' in init_connect, and connect using non super privileged user we get errors that either Mysql server has gone away or lost connection to Mysql server during query. This behavior should not happen and it should give error that non privileged user cant set init_connect value.

How to repeat:
This is a sample test in mysql testing environment.

Sample Code: 
create user user1@localhost;
SET @@global.init_connect = "SET @@global.init_connect=''";
connect (con1,localhost,user1,,,,);
connection con1;
--Error 2006,2013
SELECT 'a';

Output:
create user user1@localhost;
SET @@global.init_connect = "SET @@global.init_connect=''";
SELECT 'a';
Got one of the listed errors

Suggested fix:
Connection should not drop at this situation and user should be issued an error that non privileged user can not set init_conenct system variable.
[18 Mar 2008 23:47] MySQL Verification Team
Thank you for the bug report.
[20 Mar 2008 20:37] Omer Barnir
triage: