Commit 3ad6b7ab authored by Karen Langford's avatar Karen Langford

Patch to fix SS #12698716 : Java/ConnectorJ regression problem

parent 844fa544
...@@ -22,6 +22,7 @@ ...@@ -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) ...@@ -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) ...@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment