Bug #54516 NdbApi : ABI compatibility break due to greater number of columns supported
Submitted: 15 Jun 2010 14:17 Modified: 2 Jul 2010 5:06
Reporter: Frazer Clement Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: NDB API Severity:S3 (Non-critical)
Version:mysql-5.1-telco-7.0 OS:Any
Assigned to: Jonas Oreland CPU Architecture:Any

[15 Jun 2010 14:17] Frazer Clement
Description:
In mysql-5.1-telco-7.0.15, the maximum number of columns constant was increased.

This constant defined the width of the m_read_mask member of NdbOperation which as an inline member, affects the placement of other members within a physical NdbOperation instance.

As some NdbOperation members are inlineable, existing compiled NdbApi clients may have compiled-in code which is aware of the existing NdbOperation member-layout, and which will break when run against a new library version which returns NdbOperation objects with the new layout.

This could mean that existing NdbApi clients would require a recompile to work with the new version of the NdbApi, breaking binary compatibility.

How to repeat:
Look at physical layout of NdbOperation before and after 7.0.15.

Suggested fix:
Change NdbApi to use stack to pass the wider read mask around.

Inlineable members should not include physical object layout knowledge.

Api objects should use pImpl idiom for state storage.

Operation definition-only information should be decoupled from longer-term operation state.
[15 Jun 2010 14:18] Frazer Clement
Patch committed : 

 3557 Frazer Clement	2010-06-08
      Fix Abi incompatibility 
      Introduced by increased width of m_read_mask variable embedded in 
      NdbOperation class.
      
      m_read_mask is returned to old width, renamed to m_unused_read_mask.
      
      New, wider read_mask is passed on the stack rather than as a member 
      variable.

    modified:
      storage/ndb/include/ndbapi/NdbOperation.hpp
      storage/ndb/include/ndbapi/NdbScanOperation.hpp
      storage/ndb/src/ndbapi/NdbOperationDefine.cpp
      storage/ndb/src/ndbapi/NdbOperationExec.cpp
      storage/ndb/src/ndbapi/NdbScanOperation.cpp
      storage/ndb/src/ndbapi/NdbTransaction.cpp

http://lists.mysql.com/commits/110510
[15 Jun 2010 14:19] Frazer Clement
Pushed to 
7.0.15b
7.1.5
[15 Jun 2010 14:22] Frazer Clement
Also pushed to 7.1.4b
[2 Jul 2010 5:06] Jon Stephens
Documented bugfix in the NDB-7.0.15b and 7.1.4b changelogs as follows:

      The value of an internal constant used in the implementation of the
      NdbOperation and NdbScanOperation classes, causing MySQL Cluster NDB 7.0
      NDB API applications compiled against MySQL Cluster NDB 7.0.14 or earlier
      to fail when run with MySQL Cluster 7.0.15, and MySQL Cluster NDB 7.1 NDB
      API applications compiled against MySQL Cluster NDB 7.1.3 or earlier to
      break when used with MySQL Cluster 7.1.4.

Closed.