Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Motivation
This would be useful for testing purposes. For example the MariaDB C/NodeJS needs it to determine which protocol features have been implemented.
It would also be useful for extracting the MaxScale version without access to the server where it is installed. However this might not always be desirable so we should consider whether we want to disable this.
Design
Parse SQL and replace @@maxscale_version with the version number.
An alternative approach would be to inject the MaxScale version number into the initial OK packet's system variable information as maxscale_version. This would avoid a roundtrip if the connectors would otherwise end up querying it.
Implementation
The final implementation was done by adding functionality into connection_metadata that injects the current version when one of the metadata values is maxscale=auto. By default the version string is sent in the metadata but it can be disabled by manually configuring the value of connection_metadata.