Bug #60879 C API: mysql_refresh() options REFRESH_*_LOGS not documented
Submitted: 15 Apr 2011 9:34 Modified: 15 Apr 2011 14:15
Reporter: Daniël van Eeden Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Documentation Severity:S4 (Feature request)
Version:5.5.8 OS:Any
Assigned to: CPU Architecture:Any

[15 Apr 2011 9:34] Daniël van Eeden
Description:
From sql/sql_reload.cc:
    options|= REFRESH_BINARY_LOG;
    options|= REFRESH_RELAY_LOG;
    options|= REFRESH_SLOW_LOG;
    options|= REFRESH_GENERAL_LOG;
    options|= REFRESH_ENGINE_LOG;
    options|= REFRESH_ERROR_LOG;

Are these options supported for mysql_refresh()? If so, these should be documented.

How to repeat:
Read http://dev.mysql.com/doc/refman/5.5/en/mysql-refresh.html

Suggested fix:
Document
[15 Apr 2011 9:35] Daniël van Eeden
Related: Bug #60878 (mysqladmin doesn't support flushing specific logs)
[15 Apr 2011 10:27] Davi Arnaut
No, these are server internal flags.
[15 Apr 2011 10:37] Davi Arnaut
These aren't supported in mysql_refresh() because of a limitation in the COM_REFRESH packet (http://forge.mysql.com/wiki/MySQL_Internals_ClientServer_Protocol#COM_REFRESH) -- only 8 bits are available for flags, which are all taken.

For what it's worth, these flags can be "triggered" using a regular FLUSH [log_type] LOGS statement, where log_type is BINARY, GENERAL, SLOW, etc. See http://dev.mysql.com/doc/refman/5.5/en/flush.html for more details.
[15 Apr 2011 11:09] Daniël van Eeden
So the packet now looks like (fixed 2 byte):
0x07 COM_REFRESH
0x02 REFRESH_LOG

Could we modify it like this (fixed 3 byte)? This will add an extra bitmap for the log type.
0x07 COM_REFRESH
0x02 REFRESH_LOG
0x11 REFRESH_ERROR_LOG
[15 Apr 2011 12:55] Davi Arnaut
Yeah, but changes to the protocol are only viable for the next major version. Do you really need these flags in mysql_refresh()? I would advise to use regular FLUSH statements instead.
[15 Apr 2011 13:07] Daniël van Eeden
So if mysqladmin would need to flush a specific log it should use FLUSH LOGS instead? (See Bug #60878).

Is there a place to register requested changes to the protocol?

I've changed this bug from S3 to S4 (Feature request).
[15 Apr 2011 13:09] Davi Arnaut
Yes to both, mysqladmin should use FLUSH [log_type] LOGS and this is the right place.
[15 Apr 2011 13:30] Valeriy Kravchuk
So, is this a documentation request (should not be, as explained by Davi, I think) or request to change protocol? Please, clarify.
[15 Apr 2011 13:59] Daniël van Eeden
Pleas close this bug as not a bug.

As explained mysqladmin should use the available interface. There is no change needed in the documentation.

This bug will server as a valuable resource for Bug #60878.