List:Commits« Previous MessageNext Message »
From:Vamsikrishna Bhagi Date:March 7 2013 3:30pm
Subject:bzr push into mysql-5.6 branch (vamsikrishna.bhagi:4874 to 4875) Bug#15965409
View as plain text  
 4875 Vamsikrishna Bhagi	2013-03-07
      Bug#15965409 NEW CLIENT CAN CONFUSE OLD SERVER WITH INITIAL
                   RESPONSE PACKET
      
      Problem: The client program above version 5.6.4 uses
               lenenc string(implemented in WL#6134) for
               authentication data. But the servers of older
               versions can read only the strings of pattern in
               which the first byte represents the length of the
               string, followed by the actual data. Due to the
               mismatch, a new client can unnecessarily cause an
               old server to misinterpret the authentication
               data.
      
      Solution: At the stage where data is sent to the server,
                server's capability of reading lenenc strings is
                checked. If it is not supported, the data is sent
                in the format supported by older versions, i.e the
                first byte representing the length of the string
                followed by the actual string.

    modified:
      sql-common/client.c
 4874 Thayumanavar	2013-03-07
      BUG#16448639 - INNODB STORAGE ENGINE SHOULD REPORT 
                     LOCKS(ROW AND TABLE) TO THREAD POOL.
      PROBLEM:
      The Innodb storage engine should report row locks and
      table locks to the thread pool plugin.
      The call to notify the thread pool plugin existed in
      mysql-5.5. The bug results in occasional performance
      drops on sysbench runs.
      FIX:
      Reintroduce this callbacks to notify the thread pool
      as in mysql-5.5 and in addition the patch also identifies
      between row and tables locks and report to thread pool
      which is used for stats.(based on inputs from sunny 
      on #innodb.)

    modified:
      storage/innobase/lock/lock0wait.cc
=== modified file 'sql-common/client.c'
--- a/sql-common/client.c	2013-02-12 10:38:59 +0000
+++ b/sql-common/client.c	2013-03-07 15:18:06 +0000
@@ -2410,6 +2410,24 @@ char *write_length_encoded_string4(char
   return (char*)(to + src_len);
 }
 
+
+/*
+  Write 1 byte of string length header information to dest and
+  copy src_len bytes from src to dest.
+*/
+char *write_string(char *dest, char *dest_end, char *src, char *src_end)
+{
+  size_t src_len= (size_t)(src_end - src);
+  uchar *to= NULL;
+  if (src_len >= 251)
+    return NULL;
+  *dest=(uchar) src_len;
+  to= (uchar*) dest+1;
+  if ((char*)(to + src_len) >= dest_end)
+    return NULL;
+  memcpy(to, src, src_len);
+  return (char*)(to + src_len);
+}
 /**
   sends a COM_CHANGE_USER command with a caller provided payload
 
@@ -2672,9 +2690,22 @@ static int send_client_reply_packet(MCPV
   {
     if (mysql->server_capabilities & CLIENT_SECURE_CONNECTION)
     {
-      end= write_length_encoded_string4(end, (char *)(buff + buff_size),
-                                       (char *) data,
-                                       (char *)(data + data_len));
+      /* 
+        Since the older versions of server do not have
+        CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA capability,
+        a check is performed on this before sending auth data.
+        If lenenc support is not available, the data is sent
+        in the format of first byte representing the length of
+        the string followed by the actual string.
+      */
+      if (mysql->server_capabilities & CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA)
+        end= write_length_encoded_string4(end, (char *)(buff + buff_size),
+                                         (char *) data,
+                                         (char *)(data + data_len));
+      else
+        end= write_string(end, (char *)(buff + buff_size),
+                         (char *) data,
+                         (char *)(data + data_len));
       if (end == NULL)
         goto error;
     }

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.6 branch (vamsikrishna.bhagi:4874 to 4875) Bug#15965409Vamsikrishna Bhagi3 Apr