MXS-2313: Use 64-bit integers to store rank
Although the default value is the maximum value of a signed 32-bit integer, the value is stored as a 64-bit integer. The integer type conversion functions return 64-bit values so storing it as one makes sense. Currently values higher than the default are allowed but the accepted range of input should be restricted in the future.
This commit is contained in:
@ -62,7 +62,7 @@ public:
|
||||
m_settings.persistmaxtime = persistmaxtime;
|
||||
}
|
||||
|
||||
void set_rank(int rank)
|
||||
void set_rank(int64_t rank)
|
||||
{
|
||||
m_settings.rank = rank;
|
||||
}
|
||||
@ -122,7 +122,7 @@ public:
|
||||
return m_settings.authenticator;
|
||||
}
|
||||
|
||||
int rank() const override
|
||||
int64_t rank() const override
|
||||
{
|
||||
return m_settings.rank;
|
||||
}
|
||||
@ -341,7 +341,7 @@ private:
|
||||
long persistpoolmax = 0; /**< Maximum size of persistent connections pool */
|
||||
long persistmaxtime = 0; /**< Maximum number of seconds connection can live */
|
||||
|
||||
int rank; /*< The ranking of this server, used to prioritize certain servers over others */
|
||||
int64_t rank; /*< The ranking of this server, used to prioritize certain servers over others */
|
||||
|
||||
/** Disk space thresholds. Can be queried from modules at any time so access must be protected
|
||||
* by mutex. */
|
||||
|
||||
Reference in New Issue
Block a user