Skip to content

Mariadb version again #900

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .travis_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ if [[ -n ${DB-} && x$DB =~ ^xmysql80 ]]; then
sudo bash .travis_mysql80.sh
fi

# Install MariaDB client headers after Travis CI fix for MariaDB 10.2 broke earlier 10.x
if [[ -n ${DB-} && x$DB =~ ^xmariadb10.0 ]]; then
sudo apt-get install -y -o Dpkg::Options::='--force-confnew' libmariadbclient-dev
fi

# Install MariaDB client headers after Travis CI fix for MariaDB 10.2 broke earlier 10.x
if [[ -n ${DB-} && x$DB =~ ^xmariadb10.1 ]]; then
sudo apt-get install -y -o Dpkg::Options::='--force-confnew' libmariadbclient-dev
fi

# Install MariaDB 10.2 if DB=mariadb10.2
# NOTE this is a workaround until Travis CI merges a fix to its mariadb addon.
if [[ -n ${DB-} && x$DB =~ ^xmariadb10.2 ]]; then
Expand Down
8 changes: 5 additions & 3 deletions ext/mysql2/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ VALUE rb_hash_dup(VALUE other) {
* variable to use, but MYSQL_SERVER_VERSION gives the correct numbers when
* linking against the server itself
*/
#ifdef LIBMYSQL_VERSION
#if defined(MARIADB_CLIENT_VERSION_STR)
#define MYSQL_LINK_VERSION MARIADB_CLIENT_VERSION_STR
#elif defined(LIBMYSQL_VERSION)
#define MYSQL_LINK_VERSION LIBMYSQL_VERSION
#else
#define MYSQL_LINK_VERSION MYSQL_SERVER_VERSION
Expand Down Expand Up @@ -883,7 +885,7 @@ static VALUE _mysql_client_options(VALUE self, int opt, VALUE value) {
retval = &boolval;
break;

#if defined(MYSQL_SECURE_AUTH)
#ifdef MYSQL_SECURE_AUTH
case MYSQL_SECURE_AUTH:
boolval = (value == Qfalse ? 0 : 1);
retval = &boolval;
Expand Down Expand Up @@ -1315,7 +1317,7 @@ static VALUE set_ssl_options(VALUE self, VALUE key, VALUE cert, VALUE ca, VALUE

static VALUE set_secure_auth(VALUE self, VALUE value) {
/* This option was deprecated in MySQL 5.x and removed in MySQL 8.0 */
#if defined(MYSQL_SECURE_AUTH)
#ifdef MYSQL_SECURE_AUTH
return _mysql_client_options(self, MYSQL_SECURE_AUTH, value);
#else
return Qfalse;
Expand Down
2 changes: 0 additions & 2 deletions ext/mysql2/mysql2_ext.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@ void Init_mysql2(void);
#include <mysql_com.h>
#include <errmsg.h>
#include <mysqld_error.h>
#include <mysql_version.h>
#else
#include <mysql/mysql.h>
#include <mysql/mysql_com.h>
#include <mysql/errmsg.h>
#include <mysql/mysqld_error.h>
#include <mysql/mysql_version.h>
#endif

#ifdef HAVE_RUBY_ENCODING_H
Expand Down