Bug #28423 cluster -> storage engine error code mapping problem
Submitted: 14 May 2007 18:59 Modified: 15 Sep 2007 13:08
Reporter: Hartmut Holzgraefe Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:5.0, 5.1 OS:Any
Assigned to: Guangbao Ni CPU Architecture:Any

[14 May 2007 18:59] Hartmut Holzgraefe
Description:
Shouldn't the entries

  { 630, HA_ERR_FOUND_DUPP_KEY, 0 },
  { 893, HA_ERR_FOUND_DUPP_KEY, 0 },

in the 5.0 sql/ha_ndbcluster.cc error code mapping
array have their show_warnings flag set, too,
like the other cases of multiple ndb errors mapping 
to the same handler error? So that one can use
SHOW WARNINGS on receiving such an error to check
what really happened (630 or 893)?

In 5.1 we have the same problem, although implemented
in a different way, here the HA_ERR_FOUND_DUPP_KEY
case should be removed from the 

  case HA_ERR_NO_SUCH_TABLE:
  case HA_ERR_KEY_NOT_FOUND:
  case HA_ERR_FOUND_DUPP_KEY:
    return error;

in the ndb_to_mysql_error() function in ha_ndbcluster.cc?

How to repeat:
see the code snippets above

Suggested fix:
make HA_ERR_FOUND_DUPP_KEY error cases throw warning like the other ambiguous engine error codes that may be caused by multiple cluster error codes
[25 Jul 2007 1:38] 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/31519

ChangeSet@1.2512, 2007-07-25 09:32:28+08:00, gni@dev3-221.dev.cn.tlan +1 -0
  BUG#28423 cluster to storage engine error code mapping problem
[26 Jul 2007 4:59] Stewart Smith
looks ok.

check with 5.1 merging though.
[8 Aug 2007 12:02] Guangbao Ni
push into mysql-5.0-ndb-bj and mysql-5.1-new-ndb-bj
[14 Sep 2007 16:25] Bugs System
Pushed into 5.0.50
[14 Sep 2007 16:26] Bugs System
Pushed into 5.1.23-beta
[15 Sep 2007 13:08] 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 in 5.0.50 and 5.1.23 changelogs.
[21 Sep 2007 8:38] Jon Stephens
Also documented fix in mysql-5.1.22-ndb-6.2.6 changelog.