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

Merge branch '3.1' into 3.3

This commit is contained in:
Georg Richter
2023-04-05 09:28:40 +02:00
2 changed files with 12 additions and 4 deletions

View File

@@ -120,8 +120,8 @@ extern const char *mariadb_client_errors[]; /* Error messages */
#endif #endif
#define IS_MYSQL_ERROR(code) ((code) > CR_MIN_ERROR && (code) < CR_MYSQL_LAST_ERROR) #define IS_MYSQL_ERROR(code) ((code) > CR_MIN_ERROR && (code) <= CR_MYSQL_LAST_ERROR)
#define IS_MARIADB_ERROR(code) ((code) > CER_MIN_ERROR && (code) < CR_MARIADB_LAST_ERROR) #define IS_MARIADB_ERROR(code) ((code) > CER_MIN_ERROR && (code) <= CR_MARIADB_LAST_ERROR)
#define ER(code) IS_MYSQL_ERROR((code)) ? client_errors[(code) - CR_MIN_ERROR] : \ #define ER(code) IS_MYSQL_ERROR((code)) ? client_errors[(code) - CR_MIN_ERROR] : \
IS_MARIADB_ERROR((code)) ? mariadb_client_errors[(code) - CER_MIN_ERROR] : \ IS_MARIADB_ERROR((code)) ? mariadb_client_errors[(code) - CER_MIN_ERROR] : \

View File

@@ -200,8 +200,6 @@ error:
return res; return res;
} }
static int send_client_reply_packet(MCPVIO_EXT *mpvio, static int send_client_reply_packet(MCPVIO_EXT *mpvio,
const uchar *data, int data_len) const uchar *data, int data_len)
{ {
@@ -237,6 +235,16 @@ static int send_client_reply_packet(MCPVIO_EXT *mpvio,
to unset CLIENT_CONNECT_WITH_DB flag */ to unset CLIENT_CONNECT_WITH_DB flag */
mysql->client_flag&= ~CLIENT_CONNECT_WITH_DB; mysql->client_flag&= ~CLIENT_CONNECT_WITH_DB;
/* CONC-635: For connections via named pipe or shared memory the server
indicates the capability for secure connections (TLS), but
doesn't support it. */
if ((mysql->server_capabilities & CLIENT_SSL) &&
(mysql->net.pvio->type == PVIO_TYPE_NAMEDPIPE ||
mysql->net.pvio->type == PVIO_TYPE_SHAREDMEM))
{
mysql->server_capabilities &= ~(CLIENT_SSL);
}
/* if server doesn't support SSL and verification of server certificate /* if server doesn't support SSL and verification of server certificate
was set to mandatory, we need to return an error */ was set to mandatory, we need to return an error */
if (mysql->options.use_ssl && !(mysql->server_capabilities & CLIENT_SSL)) if (mysql->options.use_ssl && !(mysql->server_capabilities & CLIENT_SSL))