Bug #28722 Multi-engine statements on has_own_binlogging engine
Submitted: 28 May 2007 11:16 Modified: 5 Jul 2007 13:32
Reporter: Lars Thalmann Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:5.1 source OS:Any
Assigned to: Mats Kindahl CPU Architecture:Any

[28 May 2007 11:16] Lars Thalmann
Description:
If an engine has its own logging capability (only NDB has this right now), then any statement over both this engine and some other engine can not be correctly logged (entries from one engine can be logged before entries from the other engine) and there is currently no error message generated for this.

How to repeat:
Execute update statement over both NDB and MyISAM.  No error message 
is generated and the log becomes inconsistent between the engines.

Suggested fix:
Generate error message whenever a multi-engine statement is executed 
on an engine that is has_own_binlogging set.

Before this bug report is closed, we should also add documentation:

1. Document in code and manual what has_own_binlogging means:

   a) Server does not log anything related to has_own_binlogging
      engines.
   b) Engine logging capabilities are still checked (WL#3303).
   c) Another engine can still log things for the other parts of the
      statement.

   For STATEMENT format, nothing is logged by server.  If more than
   one engine is involved in the statement, an error is generated.

   For MIXED format, nothing is logged by server.  If more than one
   engine is involved in the statement, an error is generated.

   For ROW format, nothing is logged by server.  If more than one
   engine is involved in the statement, an error is generated.

2. Document in manual:

   If several engines are used in a statement and at least one of them
   is "has_own_binlogging", then an error message is generated and the 
   statement is not executed.
[19 Jun 2007 12:52] 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/29102

ChangeSet@1.2556, 2007-06-19 14:52:07+02:00, mats@kindahl-laptop.dnsalias.net +3 -0
  BUG#28722 (Multi-engine statements on has_own_binlogging engine):
  WL#3931 (Multi-table statement involving self-logging engines):
  
  Adding logic to generate error if more than one engine is involved in
  the statement and at least one engine is self-logging (i.e., has the
  HA_HAS_OWN_BINLOGGING table flags set).
[20 Jun 2007 21:36] Chuck Bell
The patch looks. I was able to see all of the combinations described in the bug report. 

I have one suggestion: Would you consider inserting the documentation concerning has_own_binlogging into the code in sql_base.cc? Perhaps as a note or paraphrase of your points. I think that it would help newer engineers understand the code a bit faster.
[21 Jun 2007 11:32] 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/29266

ChangeSet@1.2557, 2007-06-21 13:32:23+02:00, mats@kindahl-laptop.dnsalias.net +1 -0
  BUG#28722:
  Renaming variable
[21 Jun 2007 11:34] 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/29267

ChangeSet@1.2556, 2007-06-21 13:34:06+02:00, mats@kindahl-laptop.dnsalias.net +3 -0
  BUG#28722 (Multi-engine statements on has_own_binlogging engine):
  WL#3931 (Multi-table statement involving self-logging engines):
  
  Adding logic to generate error if more than one engine is involved in
  the statement and at least one engine is self-logging (i.e., has the
  HA_HAS_OWN_BINLOGGING table flags set).
[21 Jun 2007 23:39] 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/29351

ChangeSet@1.2531, 2007-06-22 01:39:23+02:00, mats@kindahl-laptop.dnsalias.net +9 -0
  BUG#28722 (Multi-engine statements on has_own_binlogging engine):
  Test fixes resulting from changed semantics.
[3 Jul 2007 18:57] Bugs System
Pushed into 5.1.21-beta
[5 Jul 2007 13:32] Jon Stephens
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release.

If necessary, you can access the source repository and build the latest available version, including the bug fix. More information about accessing the source trees is available at

    http://dev.mysql.com/doc/en/installing-source.html

Documented bugfix in 5.1.21 changelog.