Bug #35548 NDB broken multi_range_read implementation in 6.0
Submitted: 25 Mar 13:01 Modified: 2 Jul 20:36
Reporter: Kristian Nielsen
Status: Closed
Category:Server: Cluster Severity:S1 (Critical)
Version:6.0 OS:Any
Assigned to: Tomas Ulin Target Version:6.0
Triage: D2 (Serious)

[25 Mar 13:01] Kristian Nielsen
Description:
In mysql-6.0, there is a new multi_range_read interface.

In this interface, the storage engine must return an opaque pointer to the upper
layer with each row returned. This pointer is associated with the range that gave
rise to the row.

In the NDB implementation, for unsorted scans, rows may be returned in random
order, ie. rows from different ranges may be intermixed. That is fine, but the
returned opaque pointer must still be the one from the correct range to which the
returned row belongs, and NDB fails in this respect.

How to repeat:
No testcase known, but the problem is apparent from the source.

Suggested fix:
Will commit patch
[25 Mar 13:03] Kristian Nielsen
Bug not present prior to mysql-6.0, the bug is in new code introduced in 6.0.
[25 Mar 13:14] 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/44380

ChangeSet@1.2551, 2008-03-25 13:12:28+01:00, knielsen@ymer.(none) +1 -0
  BUG#35548: NDB broken multi_range_read implementation in 6.0
  
  For MRR unordered scans, rows are returned in random order, and custom
  pointer returned to upper layer was not correctly associated with the
  range that each row originated from.
  
  Fixed by storing custom pointers at the start of the MRR buffer in a
  fixed-format array allowing random access to the correct pointer.
[25 Mar 13: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/44383

ChangeSet@1.2551, 2008-03-25 13:50:18+01:00, knielsen@ymer.(none) +1 -0
  BUG#35548: NDB broken multi_range_read implementation in 6.0
  
  For MRR unordered scans, rows are returned in random order, and custom
  pointer returned to upper layer was not correctly associated with the
  range that each row originated from.
  
  Fixed by storing custom pointers at the start of the MRR buffer in a
  fixed-format array allowing random access to the correct pointer.
[25 Mar 16:08] Kristian Nielsen
Pushed to mysql-6.0-ndb.
[31 May 12:45] Jon Stephens
Tomas, can you (or somebody) have a look at this and tell what if anything I need to do
about it? Thanks!
[2 Jul 20:36] Jon Stephens
Closed per comment from Tomas above.