1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-08-07 02:42:49 +03:00

Fix for CONC-104: mysql_options doesn't support MYSQL_SECURE_AUTH option

This commit is contained in:
georg@skysql.com
2014-09-15 15:47:17 +02:00
parent fc5859154e
commit 6cd41756de
3 changed files with 13 additions and 2 deletions

View File

@@ -66,6 +66,7 @@ extern const char *client_errors[]; /* Error messages */
#define CR_PARAMS_NOT_BOUND 2031 #define CR_PARAMS_NOT_BOUND 2031
#define CR_INVALID_PARAMETER_NO 2034 #define CR_INVALID_PARAMETER_NO 2034
#define CR_UNSUPPORTED_PARAM_TYPE 2036 #define CR_UNSUPPORTED_PARAM_TYPE 2036
#define CR_SECURE_AUTH 2049
#define CR_NO_DATA 2051 #define CR_NO_DATA 2051
#define CR_NO_STMT_METADATA 2052 #define CR_NO_STMT_METADATA 2052
#define CR_NOT_IMPLEMENTED 2054 #define CR_NOT_IMPLEMENTED 2054

View File

@@ -129,7 +129,7 @@ const char *client_errors[]=
/* 2046 */ "", /* 2046 */ "",
/* 2047 */ "", /* 2047 */ "",
/* 2048 */ "", /* 2048 */ "",
/* 2049 */ "", /* 2049 */ "Connection with old authentication protocol refused.",
/* 2050 */ "", /* 2050 */ "",
/* 2051 */ "", /* 2051 */ "",
/* 2052 */ "Prepared statement contains no metadata", /* 2052 */ "Prepared statement contains no metadata",

View File

@@ -1866,7 +1866,15 @@ MYSQL *mthd_my_real_connect(MYSQL *mysql, const char *host, const char *user,
scramble_plugin= native_password_plugin_name; scramble_plugin= native_password_plugin_name;
} }
} else } else
{
mysql->server_capabilities&= ~CLIENT_SECURE_CONNECTION; mysql->server_capabilities&= ~CLIENT_SECURE_CONNECTION;
if (mysql->options.secure_auth)
{
SET_CLIENT_ERROR(mysql, CR_SECURE_AUTH, unknown_sqlstate, 0);
goto error;
}
}
/* Set character set */ /* Set character set */
if (mysql->options.charset_name) if (mysql->options.charset_name)
@@ -3076,7 +3084,9 @@ mysql_optionsv(MYSQL *mysql,enum mysql_option option, ...)
} }
} }
break; break;
case MYSQL_SECURE_AUTH:
mysql->options.secure_auth= *(my_bool *)arg1;
break;
default: default:
va_end(ap); va_end(ap);
DBUG_RETURN(-1); DBUG_RETURN(-1);