List:Commits« Previous MessageNext Message »
From:msvensson Date:April 18 2006 10:56am
Subject:bk commit into 5.0 tree (msvensson:1.2164)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of msvensson. When msvensson does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2164 06/04/18 10:55:57 msvensson@neptunus.(none) +1 -0
  Merge 192.168.0.20:mysql/bug13310/my50-bug13310
  into  neptunus.(none):/home/msvensson/mysql/mysql-5.0

  sql/sql_parse.cc
    1.539 06/04/18 10:55:52 msvensson@neptunus.(none) +0 -0
    Auto merged

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	msvensson
# Host:	neptunus.(none)
# Root:	/home/msvensson/mysql/mysql-5.0/RESYNC

--- 1.538/sql/sql_parse.cc	2006-04-13 22:05:40 +02:00
+++ 1.539/sql/sql_parse.cc	2006-04-18 10:55:52 +02:00
@@ -992,6 +992,7 @@
 
   char *user= end;
   char *passwd= strend(user)+1;
+  uint user_len= passwd - user - 1;
   char *db= passwd;
   char db_buff[NAME_LEN+1];                     // buffer to store db in utf8
   char user_buff[USERNAME_LENGTH+1];		// buffer to store user in utf8
@@ -1017,10 +1018,18 @@
     db= db_buff;
   }
 
-  user_buff[copy_and_convert(user_buff, sizeof(user_buff)-1,
-                             system_charset_info, user, strlen(user),
-                             thd->charset(), &dummy_errors)]= '\0';
+  user_buff[user_len= copy_and_convert(user_buff, sizeof(user_buff)-1,
+                                       system_charset_info, user, user_len,
+                                       thd->charset(), &dummy_errors)]= '\0';
   user= user_buff;
+
+  /* If username starts and ends in "'", chop them off */
+  if (user_len > 1 && user[0] == '\'' && user[user_len - 1] == '\'')
+  {
+    user[user_len-1]= 0;
+    user++;
+    user_len-= 2;
+  }
 
   if (thd->main_security_ctx.user)
     x_free(thd->main_security_ctx.user);
Thread
bk commit into 5.0 tree (msvensson:1.2164)msvensson18 Apr