List:Commits« Previous MessageNext Message »
From:Nirbhay Choubey Date:October 9 2012 5:25pm
Subject:bzr push into mysql-trunk branch (nirbhay.choubey:4691 to 4692) Bug#14554568
View as plain text  
 4692 Nirbhay Choubey	2012-10-09
      Bug#14554568: Post-fix

    modified:
      client/mysql.cc
      include/my_sys.h
      mysys/my_conio.c
 4691 Anitha Gopi	2012-10-09 [merge]
      Merged from mysql-5.6

    modified:
      mysql-test/t/disabled.def
=== modified file 'client/mysql.cc'
--- a/client/mysql.cc	2012-10-09 12:25:06 +0000
+++ b/client/mysql.cc	2012-10-09 17:24:22 +0000
@@ -2151,7 +2151,7 @@ static int read_and_execute(bool interac
 	fflush(OUTFILE);
 
 #if defined(__WIN__)
-      size_t mblen;
+      size_t nread;
       tee_fputs(prompt, stdout);
       if (!tmpbuf.is_alloced())
         tmpbuf.alloc(65535);
@@ -2160,8 +2160,8 @@ static int read_and_execute(bool interac
       line= my_win_console_readline(charset_info,
                                     (char *) tmpbuf.ptr(),
                                     tmpbuf.alloced_length(),
-                                    &mblen);
-      if (line && (mblen == 0))
+                                    &nread);
+      if (line && (nread == 0))
       {
         tee_puts("^C", stdout);
         continue;

=== modified file 'include/my_sys.h'
--- a/include/my_sys.h	2012-10-09 12:25:06 +0000
+++ b/include/my_sys.h	2012-10-09 17:24:22 +0000
@@ -949,7 +949,7 @@ void my_security_attr_free(SECURITY_ATTR
 /* implemented in my_conio.c */
 my_bool my_win_is_console(FILE *file);
 char *my_win_console_readline(const CHARSET_INFO *cs, char *mbbuf, size_t mbbufsize,
-                              size_t *mblen);
+                              size_t *nread);
 void my_win_console_write(const CHARSET_INFO *cs, const char *data, size_t datalen);
 void my_win_console_fputs(const CHARSET_INFO *cs, const char *data);
 void my_win_console_putc(const CHARSET_INFO *cs, int c);

=== modified file 'mysys/my_conio.c'
--- a/mysys/my_conio.c	2012-10-09 12:25:06 +0000
+++ b/mysys/my_conio.c	2012-10-09 17:24:22 +0000
@@ -66,19 +66,19 @@ my_win_is_console(FILE *file)
   @param cs          [IN]  Character string to convert to.
   @param mbbuf       [OUT] Write input data here.
   @param mbbufsize   [IN]  Number of bytes available in mbbuf.
-  @param mblen       [OUT] Length of the mbbuf.
+  @param nread       [OUT] Number of bytes read.
 
   @retval           Pointer to mbbuf, or NULL on I/0 error.
 */
 char *
 my_win_console_readline(const CHARSET_INFO *cs, char *mbbuf, size_t mbbufsize,
-                        size_t *mblen)
+                        size_t *nread)
 {
   uint dummy_errors;
   static wchar_t u16buf[MAX_CONSOLE_LINE_SIZE + 1];
-
+  size_t mblen= 0;
   DWORD console_mode;
-  *mblen= 0;
+  DWORD nchars;
 
   HANDLE console= GetStdHandle(STD_INPUT_HANDLE);
 
@@ -93,6 +93,8 @@ my_win_console_readline(const CHARSET_IN
     return NULL;
   }
 
+  *nread= nchars;
+
   /* Set length of string */
   if (nchars >= 2 && u16buf[nchars - 2] == L'\r')
     nchars-= 2;
@@ -108,12 +110,12 @@ my_win_console_readline(const CHARSET_IN
 
   /* Convert Unicode to session character set */
   if (nchars != 0)
-    *mblen= my_convert(mbbuf, mbbufsize - 1, cs,
-                       (const char *) u16buf, nchars * sizeof(wchar_t),
-                       &my_charset_utf16le_bin, &dummy_errors);
+    mblen= my_convert(mbbuf, mbbufsize - 1, cs,
+                      (const char *) u16buf, nchars * sizeof(wchar_t),
+                      &my_charset_utf16le_bin, &dummy_errors);
 
-  DBUG_ASSERT(*mblen < mbbufsize); /* Safety */
-  mbbuf[*mblen]= 0;
+  DBUG_ASSERT(mblen < mbbufsize); /* Safety */
+  mbbuf[mblen]= 0;
   return mbbuf;
 }
 

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (nirbhay.choubey:4691 to 4692) Bug#14554568Nirbhay Choubey9 Oct