MXS-1249: Prepare for storing version in server structure

The behaviour of the query classifier needs to be different
depending on the actual version of the server. There is already
a human readable string, but for programmatic use it needs to
be in a format that can easily be parsed.
This commit is contained in:
Johan Wikman
2017-06-16 13:22:33 +03:00
parent 4a298b4024
commit 0d784da0ee
2 changed files with 38 additions and 0 deletions

View File

@ -63,6 +63,16 @@ typedef struct
int n_persistent; /**< Current persistent pool */
} SERVER_STATS;
/**
* The server version.
*/
typedef struct server_version
{
uint32_t major;
uint32_t minor;
uint32_t patch;
} SERVER_VERSION;
/**
* The SERVER structure defines a backend server. Each server has a name
* or IP address for the server, a port that the server listens on and
@ -91,6 +101,7 @@ typedef struct server
struct server *next; /**< Next server */
struct server *nextdb; /**< Next server in list attached to a service */
char version_string[MAX_SERVER_VERSION_LEN]; /**< Server version string, i.e. MySQL server version */
SERVER_VERSION version; /**< Server version information */
long node_id; /**< Node id, server_id for M/S or local_index for Galera */
int rlag; /**< Replication Lag for Master / Slave replication */
unsigned long node_ts; /**< Last timestamp set from M/S monitor module */
@ -311,6 +322,7 @@ extern void server_update_address(SERVER *server, const char *address);
extern void server_update_port(SERVER *server, unsigned short port);
extern unsigned int server_map_status(const char *str);
extern void server_set_version_string(SERVER* server, const char* string);
extern void server_set_version(SERVER* server, const char* string, uint32_t major, uint32_t minor, uint32_t patch);
extern void server_set_status(SERVER *server, int bit);
extern void server_clear_status(SERVER *server, int bit);