Skip to content
This repository was archived by the owner on Mar 26, 2024. It is now read-only.

Commit f7763ed

Browse files
AlexeyDemidovjacksonrayhamilton
authored andcommitted
fix build with MariaDB 10.2 headers
From: brianmario#1014
1 parent 329b63b commit f7763ed

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

ext/mysql2/client.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ static VALUE rb_hash_dup(VALUE other) {
5454
* variable to use, but MYSQL_SERVER_VERSION gives the correct numbers when
5555
* linking against the server itself
5656
*/
57-
#ifdef LIBMYSQL_VERSION
57+
#if defined(MARIADB_CLIENT_VERSION_STR)
58+
#define MYSQL_LINK_VERSION MARIADB_CLIENT_VERSION_STR
59+
#elif defined(LIBMYSQL_VERSION)
5860
#define MYSQL_LINK_VERSION LIBMYSQL_VERSION
5961
#else
6062
#define MYSQL_LINK_VERSION MYSQL_SERVER_VERSION
@@ -1297,6 +1299,10 @@ void init_mysql2_client() {
12971299
#ifdef CLIENT_LONG_PASSWORD
12981300
rb_const_set(cMysql2Client, rb_intern("LONG_PASSWORD"),
12991301
LONG2NUM(CLIENT_LONG_PASSWORD));
1302+
#else
1303+
/* HACK because MariaDB 10.2 no longer defines this constant,
1304+
* but we're using it in our default connection flags. */
1305+
rb_const_set(cMysql2Client, rb_intern("LONG_PASSWORD"), INT2NUM(0));
13001306
#endif
13011307

13021308
#ifdef CLIENT_FOUND_ROWS

ext/mysql2/mysql2_ext.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,10 @@ typedef unsigned int uint;
1515

1616
#ifdef HAVE_MYSQL_H
1717
#include <mysql.h>
18-
#include <mysql_com.h>
1918
#include <errmsg.h>
2019
#include <mysqld_error.h>
2120
#else
2221
#include <mysql/mysql.h>
23-
#include <mysql/mysql_com.h>
2422
#include <mysql/errmsg.h>
2523
#include <mysql/mysqld_error.h>
2624
#endif

0 commit comments

Comments
 (0)