Bug #47281 BML may not block all it should
Submitted: 11 Sep 2009 19:27 Modified: 7 Mar 2010 19:46
Reporter: Chuck Bell Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Backup Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: Thava Alagu CPU Architecture:Any

[11 Sep 2009 19:27] Chuck Bell
Description:
There are two additional commands that should be evaluated for the BML. These are ANALYZE TABLE and CHECK TABLE. The CHECK TABLE command can in some cases modify a table by updating its index statistics (MyISAM).

How to repeat:
Code inspection.

Suggested fix:
Two options:

1) If these are 'safe' to use in conjunction with backup without the BML, then the bug can be closed as 'not a bug' and a test created to verify this assumption.

2) Add these to the BML list of blocked operations.
[30 Sep 2009 11:55] Thava Alagu
CHECK TABLE command with FOR UPGRADE option can also change the .frm file with the latest mysql version number. ANALYZE TABLE command updates the key distribution for the table. These commands need to be protected by backup metadata lock.
[5 Oct 2009 12:16] 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/commits/85745

2870 Thava Alagu	2009-10-05
      Bug#47281: BML may not block all it should
      
      Added check table and analyze table commands to the list of
      statements protected by backup meta lock.
[5 Oct 2009 14:33] Rafal Somla
Good to push.
[5 Oct 2009 14:41] Chuck Bell
Approved.
[12 Jan 2010 19:06] 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/commits/96663

3055 Ingo Struewing	2010-01-12
      WL#5101 - MySQL Backup back port
      Merged revid:thavamuni.alagu@sun.com-20091006120732-v58n9i67p9j062c7
        Bug#47281: BML may not block all it should
        
          Added check table and analyze table commands to the list of
          statements protected by backup meta lock.
     @ sql/sql_parse.cc
        WL#5101 - MySQL Backup back port
            Added check table and analyze table commands to the list of
            statements protected by backup meta lock.
[20 Feb 2010 9:16] Bugs System
Pushed into 6.0.14-alpha (revid:ingo.struewing@sun.com-20100218152520-s4v1ld76bif06eqn) (version source revid:ingo.struewing@sun.com-20100119103538-wtp5alpz4p2jayl5) (merge vers: 6.0.14-alpha) (pib:16)
[7 Mar 2010 19:46] Paul DuBois
Noted in 6.0.14 changelog.

ANALYZE TABLE and CHECK TABLE are now included in the set of 
statements blocked by the backup metadata lock because under some
conditions these statements can modify tables.

Also updated MySQL Backup manual.