[MXS-4832] Add a way to detect that a client connected to MaxScale Created: 2023-10-26  Updated: 2024-01-16  Resolved: 2024-01-15

Status: Closed
Project: MariaDB MaxScale
Component/s: mariadbclient
Affects Version/s: None
Fix Version/s: 23.08.5

Type: Task Priority: Major
Reporter: markus makela Assignee: markus makela
Resolution: Fixed Votes: 0
Labels: 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.


Generated at Thu Feb 08 04:31:28 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.