Bug #12004 SHOW BINARY LOGS reports 0 for the size of all binlogs but the current one
Submitted: 18 Jul 2005 12:15 Modified: 18 Jul 2005 20:20
Reporter: Guilhem Bichot Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:4.1 OS:Linux (linux)
Assigned to: Guilhem Bichot CPU Architecture:Any

[18 Jul 2005 12:15] Guilhem Bichot
Description:
SHOW BINARY LOGS reports 0 for the size of all binlogs but the current one, IF those binlogs are not located in the datadir (which is the default location where they are put unless --log-bin gives another path).
This is because show_binlogs() assumes that binlogs are in datadir. As datadir is the current working directory of mysqld, show_binlogs() simply passes the basename to my_open(). But if binlog is not in  datadir, this will fail:
T@10782094: | | | | >my_open
T@10782094: | | | | | my: Name: 'master-bin.000001'  Flags: 0  MyFlags: 0
T@10782094: | | | | <my_open
T@10782094: | | | | error: Got error 2 on open

How to repeat:
mysqld --log-bin=/tmp
(if datadir is different from /tmp).
FLUSH LOGS;
SHOW BINARY LOGS;
or look at result of rpl_log (it has 0 in it).

Suggested fix:
will fix it now
[18 Jul 2005 12:47] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/27247
[18 Jul 2005 12:54] Guilhem Bichot
Fixed in 4.1.14, and in 5.0.10 when merged (can't merge myself now, too many hard unmerged csets)
[18 Jul 2005 20:20] Paul DuBois
Noted in 4.1.14, 5.0.10 changelogs.