Skip to content

Commit b63d2e8

Browse files
authored
Correct MariaDB runtime library verison check (#1406)
The MariaDB C/C version used by mysql_get_client_info() version is different from the server version exposed as MARIADB_CLIENT_VERSION_STR. The correct C/C version will be MARIADB_PACKAGE_VERSION. Fixes #1391.
1 parent 441b104 commit b63d2e8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ext/mysql2/client.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,12 @@ static ID intern_brackets, intern_merge, intern_merge_bang, intern_new_with_args
4848
* compatibility with mysql-connector-c, where LIBMYSQL_VERSION is the correct
4949
* variable to use, but MYSQL_SERVER_VERSION gives the correct numbers when
5050
* linking against the server itself
51+
*
52+
* MariaDB exposes its client version independently to the server version as
53+
* MARIADB_PACKAGE_VERSION.
5154
*/
52-
#if defined(MARIADB_CLIENT_VERSION_STR)
53-
#define MYSQL_LINK_VERSION MARIADB_CLIENT_VERSION_STR
55+
#if defined(MARIADB_PACKAGE_VERSION)
56+
#define MYSQL_LINK_VERSION MARIADB_PACKAGE_VERSION
5457
#elif defined(LIBMYSQL_VERSION)
5558
#define MYSQL_LINK_VERSION LIBMYSQL_VERSION
5659
#else

0 commit comments

Comments
 (0)