Bug #59826 | interaction of init_connect options are not documented | ||
---|---|---|---|
Submitted: | 30 Jan 2011 20:50 | Modified: | 5 Aug 2021 9:03 |
Reporter: | Peter Laursen (Basic Quality Contributor) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Documentation | Severity: | S3 (Non-critical) |
Version: | any | OS: | Any |
Assigned to: | Paul DuBois | CPU Architecture: | Any |
Tags: | qc |
[30 Jan 2011 20:50]
Peter Laursen
[30 Jan 2011 22:46]
Peter Laursen
Maybe you'll find this off-topic, but I cannot help say that I personally find init-connect option 'antique' as with introduction of SESSION variables the client can handle all this (with the sole exception of AUTOCOMMIT = 0) and as mysql_options() (with reconnect flag set) is a more consistent way with recent servers in my opinion. The 'thinking' is that server should decide over clients but anybody can execute (SET) statement overriding the init-connect for the session. The option does not ensure the server settings over client settings. init-connect option is simply inconsistent with MySQL 5.x, I think.
[30 Jan 2011 23:00]
Peter Laursen
My remark "(with the sole exception of AUTOCOMMIT = 0)" was wrong. What I meant: Using init_connect is only required to set (GLOBAL) AUTOCOMMIT = 0 at startup. Anyway .. now that and as long as both init_connect and (API/client) mysql_options() are there please clarify in detail what happens if both are used.
[31 Jan 2011 8:38]
Valeriy Kravchuk
For me it is expected that options you set with mysql_option() redefine values you get from option files (as described at http://dev.mysql.com/doc/refman/5.1/en/option-files.html). Do you have any evidence that it is not the case? Why do you consider init_connect option as something so special that it needs separate explicit documenting?
[31 Jan 2011 9:08]
Peter Laursen
I do not have any evidence that it is not the case as you describe it. Actually that is exactly what I see myself when setting different SQL_modes the two places. But I think it is not obvious for users that do not know server internals. In particular if they only know/find one of the pages. This page http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html#sysvar_init_connect .. just says "A string to be executed by the server for each client that connects". I think it should have a note that any statement defined here may effectively be overridden by a client's settings in mysql_options() - if that is what happens. Or in other words: mysqloptions() are executed after --init_connect so in case of conflicts settings, settings in mysqloptions() will have effect for the new connection. And http://dev.mysql.com/doc/refman/5.1/en/mysql-options.html .. could have a similar note/reference/link as well. Now as docs was not clear to me I had to *experiment a little* last night. This should not be necessary for users to do.
[17 Apr 2011 17:02]
MySQL Verification Team
i would certainly not want the global init_connect options to be overridden for a non-super user who connects and gives a mysql_options() value.. super user should ignore the global init_connect option though. just my 2c.