wsrep_start_replication wsrep->connect rcode matching

Bug #1290526 reported by Raghavendra D Prabhu on 2014-03-10
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL patches by Codership
High
Unassigned
5.5
High
Unassigned
Percona XtraDB Cluster moved to https://jira.percona.com/projects/PXC
Status tracked in 5.6
5.5
Fix Released
High
Alexey Kopytov
5.6
Fix Released
High
Alexey Kopytov

Bug Description

/tmp/bld/sql/wsrep_mysqld.cc:776:26: warning: comparison of constant -94 with expression of type 'wsrep_status_t' (aka 'wsrep_status') is always false [-Wtautological-constant-out-of-range-compare]
    if (-ESOCKTNOSUPPORT == rcode)

wsrep->connect() doesn't return anything else other than in wsrep_status_t, so that is always false.

Yan Zhang (yan.zhang) wrote :

I think we can put rcode to errno inside wsrep->connect, since return type wsrep_status_t could only presents few status.

And change wsrep-mysql code as

=== modified file 'sql/wsrep_mysqld.cc'
--- sql/wsrep_mysqld.cc 2014-05-04 07:12:59 +0000
+++ sql/wsrep_mysqld.cc 2014-05-13 08:53:08 +0000
@@ -810,19 +810,8 @@
                               wsrep_sst_donor,
                               bootstrap)))
   {
- if (-ESOCKTNOSUPPORT == rcode)
- {
- DBUG_PRINT("wsrep",("unrecognized cluster address: '%s', rcode: %d",
- wsrep_cluster_address, rcode));
- WSREP_ERROR("unrecognized cluster address: '%s', rcode: %d",
- wsrep_cluster_address, rcode);
- }
- else
- {
- DBUG_PRINT("wsrep",("wsrep->connect() failed: %d", rcode));
- WSREP_ERROR("wsrep::connect() failed: %d", rcode);
- }
-
+ DBUG_PRINT("wsrep",("wsrep->connect(%s) failed: %m", wsrep_cluster_address));
+ WSREP_ERROR("wsrep->connect(%s) failed: %m", wsrep_cluster_address);
     return false;
   }
   else

tags: added: lowhang

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PXC-336

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers