Add CheckMySQL module for MySQL, MariaDB and Percona servers - #1397
Conversation
New cross-platform check module built on MariaDB Connector/C (LGPL), which speaks the native protocol to the whole MySQL family: - check_mysql: connectivity/health with version, flavor (mysql/mariadb/ percona), uptime (time-unit thresholds) and connection-pool keywords. Connection failures are UNKNOWN with the driver's error message. - check_mysql_query: arbitrary SQL with result columns registered as filter keywords (CheckWMI-style), per-row matching and perf data via perf-syntax. The module is optional: it builds when the connector is found (FindMariaDB, libmariadb-dev or -DMARIADB_ROOT_DIR) and is skipped with a clear reason otherwise. Only mysql_session.cpp touches the connector; the checks consume an injectable session factory, so the unit tests run without libmariadb. Notable behaviour: TCP is forced unless socket= is given (the connector silently turns host=localhost into a socket connection), and plugin-dir= supports MySQL 8's caching_sha2_password auth plugin from non-default locations. Verified live against MariaDB 11 and MySQL 8.4; the integration suite starts a MariaDB testcontainer and skips itself without docker or without the module built. MSI entries are present but commented until the connector is part of the Windows build dependencies. Assisted-by: Claude Code:claude-fable-5 Signed-off-by: Michael Medin <michael@medin.name>
|
Thanks for this other useful addition. |
Signed-off-by: Michael Medin <michael@medin.name>
Signed-off-by: Michael Medin <michael@medin.name>
The Windows builds failed while compiling MariaDB Connector/C: schannel.c could not find SCH_CREDENTIALS / TLS_PARAMETERS and both schannel.c and ma_schannel.c could not find SP_PROT_TLS1_3_CLIENT. CMake picked the wrong SDK for the connector: the log shows "Selecting Windows SDK version 8.1 to target Windows 6.2.9200". The runner has the Windows 8.1 SDK installed for the legacy XP/cryptopp build path and reports itself as 6.2, so that is what CMake defaults to - and the 8.1 headers predate the Schannel TLS 1.3 credential structures the connector now uses. Pass CMAKE_SYSTEM_VERSION=10.0 when configuring the connector so CMake selects the newest installed Windows 10 SDK. Only the SDK changes; the toolset stays whatever the caller asked for (v141 on x86/x64, v143 on arm64). Assisted-by: Claude Code Signed-off-by: Michael Medin <michael@medin.name>
The previous attempt did not take: unquoted, PowerShell splits
-DCMAKE_SYSTEM_VERSION=10.0 into "-DCMAKE_SYSTEM_VERSION=10" plus a stray
".0" positional. CMake took the truncated value ("Ignoring extra path
from command line: .0", "TLS library/version: Schannel 10"), did not
recognise it as a Windows 10 SDK request and fell back to 8.1 again, so
the Schannel sources failed exactly as before.
Quote the argument, and assert on the WindowsTargetPlatformVersion CMake
wrote into the generated project afterwards, so any future fallback to
the 8.1 SDK fails with one clear line instead of forty compiler errors.
Assisted-by: Claude Code
Signed-off-by: Michael Medin <michael@medin.name>
Signed-off-by: Michael Medin <michael@medin.name>
New cross-platform check module built on MariaDB Connector/C (LGPL), which speaks the native protocol to the whole MySQL family:
The module is optional: it builds when the connector is found (FindMariaDB, libmariadb-dev or -DMARIADB_ROOT_DIR) and is skipped with a clear reason otherwise. Only mysql_session.cpp touches the connector; the checks consume an injectable session factory, so the unit tests run without libmariadb.
Notable behaviour: TCP is forced unless socket= is given (the connector silently turns host=localhost into a socket connection), and plugin-dir= supports MySQL 8's caching_sha2_password auth plugin from non-default locations. Verified live against MariaDB 11 and MySQL 8.4; the integration suite starts a MariaDB testcontainer and skips itself without docker or without the module built. MSI entries are present but commented until the connector is part of the Windows build dependencies.
Assisted-by: Claude Code:claude-fable-5