mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Patch to fix SS #12698716 : Java/ConnectorJ regression problem
This commit is contained in:
@ -22,6 +22,7 @@
|
|||||||
/** Size of the header fields of an authentication packet. */
|
/** Size of the header fields of an authentication packet. */
|
||||||
#define AUTH_PACKET_HEADER_SIZE_PROTO_41 32
|
#define AUTH_PACKET_HEADER_SIZE_PROTO_41 32
|
||||||
#define AUTH_PACKET_HEADER_SIZE_PROTO_40 5
|
#define AUTH_PACKET_HEADER_SIZE_PROTO_40 5
|
||||||
|
#define AUTH_PACKET_HEADER_SIZE_CONNJ_SSL 4
|
||||||
|
|
||||||
#ifdef __WIN__
|
#ifdef __WIN__
|
||||||
extern void win_install_sigabrt_handler();
|
extern void win_install_sigabrt_handler();
|
||||||
@ -955,6 +956,23 @@ static int check_connection(THD *thd)
|
|||||||
|
|
||||||
thd->client_capabilities= uint2korr(end);
|
thd->client_capabilities= uint2korr(end);
|
||||||
|
|
||||||
|
/*
|
||||||
|
JConnector only sends client capabilities (4 bytes) before starting SSL
|
||||||
|
negotiation so we don't have char_set and other information for client in
|
||||||
|
packet read. In that case, skip reading those information. The below code
|
||||||
|
is patch for this.
|
||||||
|
*/
|
||||||
|
if(bytes_remaining_in_packet == AUTH_PACKET_HEADER_SIZE_CONNJ_SSL &&
|
||||||
|
thd->client_capabilities & CLIENT_SSL)
|
||||||
|
{
|
||||||
|
thd->client_capabilities= uint4korr(end);
|
||||||
|
thd->max_client_packet_length= 0xfffff;
|
||||||
|
charset_code= default_charset_info->number;
|
||||||
|
end+= AUTH_PACKET_HEADER_SIZE_CONNJ_SSL;
|
||||||
|
bytes_remaining_in_packet-= AUTH_PACKET_HEADER_SIZE_CONNJ_SSL;
|
||||||
|
goto skip_to_ssl;
|
||||||
|
}
|
||||||
|
|
||||||
if (thd->client_capabilities & CLIENT_PROTOCOL_41)
|
if (thd->client_capabilities & CLIENT_PROTOCOL_41)
|
||||||
packet_has_required_size= bytes_remaining_in_packet >=
|
packet_has_required_size= bytes_remaining_in_packet >=
|
||||||
AUTH_PACKET_HEADER_SIZE_PROTO_41;
|
AUTH_PACKET_HEADER_SIZE_PROTO_41;
|
||||||
@ -989,6 +1007,8 @@ static int check_connection(THD *thd)
|
|||||||
charset_code= default_charset_info->number;
|
charset_code= default_charset_info->number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
skip_to_ssl:
|
||||||
|
|
||||||
DBUG_PRINT("info", ("client_character_set: %u", charset_code));
|
DBUG_PRINT("info", ("client_character_set: %u", charset_code));
|
||||||
if (thd_init_client_charset(thd, charset_code))
|
if (thd_init_client_charset(thd, charset_code))
|
||||||
goto error;
|
goto error;
|
||||||
|
Reference in New Issue
Block a user