Skip to content

Commit

Permalink
Backport MySQL 8.0.3 support from 0.4.10 to 0.3.21
Browse files Browse the repository at this point in the history
  • Loading branch information
felixbuenemann committed Apr 25, 2019
1 parent 329b63b commit 9589643
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ext/mysql2/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -794,10 +794,12 @@ static VALUE _mysql_client_options(VALUE self, int opt, VALUE value) {
retval = &boolval;
break;

#if defined(MYSQL_SECURE_AUTH)
case MYSQL_SECURE_AUTH:
boolval = (value == Qfalse ? 0 : 1);
retval = &boolval;
break;
#endif

case MYSQL_READ_DEFAULT_FILE:
charval = (const char *)StringValueCStr(value);
Expand Down Expand Up @@ -1182,7 +1184,12 @@ 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)
return _mysql_client_options(self, MYSQL_SECURE_AUTH, value);
#else
return Qfalse;
#endif
}

static VALUE set_read_default_file(VALUE self, VALUE value) {
Expand Down

0 comments on commit 9589643

Please sign in to comment.