List:Commits« Previous MessageNext Message »
From:Davi Arnaut Date:October 8 2010 12:57am
Subject:bzr push into mysql-trunk-merge branch (davi:3246 to 3247)
View as plain text  
 3247 Davi Arnaut	2010-10-07 [merge]
      Merge of mysql-5.5-bugteam into mysql-trunk-merge.

    modified:
      plugin/auth/dialog.c
      sql/sys_vars.h
 3246 Davi Arnaut	2010-10-07 [merge]
      Merge of mysql-5.5-bugteam into mysql-trunk-merge.

    modified:
      sql/sql_cache.cc
=== modified file 'plugin/auth/dialog.c'
--- a/plugin/auth/dialog.c	2010-10-04 12:54:41 +0000
+++ b/plugin/auth/dialog.c	2010-10-08 00:53:00 +0000
@@ -1,15 +1,15 @@
 /*  Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
-    
+
     This program is free software; you can redistribute it and/or
     modify it under the terms of the GNU General Public License as
     published by the Free Software Foundation; version 2 of the
     License.
-    
+
     This program is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
     GNU General Public License for more details.
-    
+
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
@@ -181,7 +181,7 @@ mysql_declare_plugin_end;
   To support all this variety, the dialog plugin has a callback function
   "authentication_dialog_ask". If the client has a function of this name
   dialog plugin will use it for communication with the user. Otherwise
-  a default gets() based implementation will be used.
+  a default fgets() based implementation will be used.
 */
 
 /**
@@ -208,12 +208,15 @@ static mysql_authentication_dialog_ask_t
 static char *builtin_ask(MYSQL *mysql __attribute__((unused)),
                          int type __attribute__((unused)),
                          const char *prompt,
-                         char *buf, int buf_len __attribute__((unused)))
+                         char *buf, int buf_len)
 {
+  char *ptr;
   fputs(prompt, stdout);
   fputc(' ', stdout);
-  if (gets(buf) == 0)
-    return 0;
+  if (fgets(buf, buf_len, stdin) == NULL)
+    return NULL;
+  if ((ptr= strchr(buf, '\n')))
+    *ptr= 0;
 
   return buf;
 }

=== modified file 'sql/sys_vars.h'
--- a/sql/sys_vars.h	2010-10-04 15:25:10 +0000
+++ b/sql/sys_vars.h	2010-10-08 00:56:03 +0000
@@ -458,12 +458,10 @@ class Sys_var_proxy_user: public sys_var
 public:
   Sys_var_proxy_user(const char *name_arg,
           const char *comment, enum charset_enum is_os_charset_arg)
-    : sys_var(&all_sys_vars, name_arg, comment, 
+    : sys_var(&all_sys_vars, name_arg, comment,
               sys_var::READONLY+sys_var::ONLY_SESSION, 0, -1,
-              NO_ARG, SHOW_CHAR, (intptr)NULL,
-              0, VARIABLE_NOT_IN_BINLOG,
-              0, 0,
-              0, 0, PARSE_NORMAL)
+              NO_ARG, SHOW_CHAR, 0, NULL, VARIABLE_NOT_IN_BINLOG,
+              NULL, NULL, 0, NULL, PARSE_NORMAL)
   {
     is_os_charset= is_os_charset_arg == IN_FS_CHARSET;
     option.var_type= GET_STR;


Attachment: [text/bzr-bundle] bzr/davi.arnaut@oracle.com-20101008005603-rm0v53q6ofogs0v9.bundle
Thread
bzr push into mysql-trunk-merge branch (davi:3246 to 3247) Davi Arnaut8 Oct