MXS-1249: Add function for getting the "version" of a service
The behaviour of the query classifier needs to change depending on the version of the servers of a service. With this function "some" version of the service can be obtained.
This commit is contained in:
@ -355,4 +355,29 @@ static inline uint64_t service_get_capabilities(const SERVICE *service)
|
||||
return service->capabilities;
|
||||
}
|
||||
|
||||
typedef enum service_version_which_t
|
||||
{
|
||||
SERVICE_VERSION_ANY, /*< Any version of the servers of a service. */
|
||||
SERVICE_VERSION_MIN, /*< The minimum version. */
|
||||
SERVICE_VERSION_MAX, /*< The maximum version. */
|
||||
} service_version_which_t;
|
||||
|
||||
/**
|
||||
* Return the version of the service. The returned version can be
|
||||
*
|
||||
* - the version of any (in practice the first) server associated
|
||||
* with the service,
|
||||
* - the smallest version of any of the servers associated with
|
||||
* the service, or
|
||||
* - the largest version of any of the servers associated with
|
||||
* the service.
|
||||
*
|
||||
* @param service The service.
|
||||
* @param which Which version.
|
||||
* @param version On output contains the version of the service.
|
||||
*/
|
||||
void service_get_version(const SERVICE *service,
|
||||
service_version_which_t which,
|
||||
SERVER_VERSION* version);
|
||||
|
||||
MXS_END_DECLS
|
||||
|
Reference in New Issue
Block a user