Bug #105996 is_cluster_failure_code returns opposite result
Submitted: 28 Dec 2021 18:57 Modified: 18 Jan 2022 10:10
Reporter: Mikael Ronström Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:8.0.27 OS:Ubuntu (20.10)
Assigned to: MySQL Verification Team CPU Architecture:x86

[28 Dec 2021 18:57] Mikael Ronström
Description:
This is more or less a compiler bug but can be fixed with small change of code.

The function is_cluster_failure_code is declared in ha_ndbcluster.cc and linked into
the file ndb_global_schema_lock.cc.

In ha_ndbcluster.cc it is declared as bool is_cluster_failure_code(int err_code)
In ndb_global_schema_lock.cc it is declared as:
int is_cluster_failure_code(int err_code)

When using GCC 10.3.0 this creates the problem that the routine returns false but
this is turned into returning 1 which is interpreted as true, thus the code then takes a wrong
turn.

How to repeat:
ndb_share test case using error injection build, no problem with debug builds. Not sure
if issue also with production builds.

Suggested fix:
Fix extern declaration in ndb_global_schema_lock.cc
[29 Dec 2021 10:38] MySQL Verification Team
Hi Mikael, thanks for the report

happy holidays
Bogdan
[18 Jan 2022 10:10] Magnus Blåudd
Posted by developer:
 
Not relevant for MySQL Cluster