List:Commits« Previous MessageNext Message »
From:Vladislav Vaintroub Date:April 11 2010 4:59pm
Subject:bzr commit into mysql-next-mr-bugfixing branch (vvaintroub:3144)
Bug#52494 WL#5331
View as plain text  
#At file:///H:/bzr/bf/ based on revid:alik@stripped

 3144 Vladislav Vaintroub	2010-04-11
      Bug#52494, WL#5331 : Support Unicode for command line
      Windows client.
      
      This patch allows to use Unicode when working with mysql
      client in interactive mode. 
      
      Best results can be achieved if console is using TrueType
      font (Lucida Console/Consolas). Raster fonts are only 
      capable of showing 256 characters.
     @ client/mysql.cc
        Change default encoding of mysql command line client to UTF8.
        Use low-level console IO (Unicode) instead of printf/fprintf.
        Translate command line parameters to user charset.
     @ client/mysqltest.cc
        Correct my_popen() implementation  used in mysqltest.
        Command line is given in UTF8, which means on Windows
        we have to translate it to wide string and use _wpopen()
        so it works correctly.
     @ include/my_sys.h
        Remove unused function.
     @ mysys/CMakeLists.txt
        Remove my_conio.c, my_cgets is no more used.
     @ mysys/Makefile.am
        Remove my_conio.c, my_cgets() is no more used.
     @ mysys/my_conio.c
        Remove my_conio.c, my_cgets is no more used.

    removed:
      mysys/my_conio.c
    modified:
      client/mysql.cc
      client/mysqltest.cc
      include/my_sys.h
      mysys/CMakeLists.txt
      mysys/Makefile.am
=== modified file 'client/mysql.cc'
--- a/client/mysql.cc	2010-03-03 19:22:02 +0000
+++ b/client/mysql.cc	2010-04-11 16:59:47 +0000
@@ -156,7 +156,7 @@ static char * opt_mysql_unix_port=0;
 static int connect_flag=CLIENT_INTERACTIVE;
 static char *current_host,*current_db,*current_user=0,*opt_password=0,
             *current_prompt=0, *delimiter_str= 0,
-            *default_charset= (char*) MYSQL_AUTODETECT_CHARSET_NAME,
+            *default_charset= IF_WIN((char *) "utf8", (char*) MYSQL_AUTODETECT_CHARSET_NAME),
             *opt_init_command= 0;
 static char *histfile;
 static char *histfile_tmp;
@@ -198,6 +198,15 @@ static CHARSET_INFO *charset_info= &my_c
 
 const char *default_dbug_option="d:t:o,/tmp/mysql.trace";
 
+#ifdef _WIN32
+static bool   win_is_console(FILE *file);
+static char*  win_console_readline();
+static void   win_console_fputs(const char *data);
+static void   win_console_putc(int c);
+static void   win_console_vfprintf(const char *fmt, va_list args);
+static char** win_translate_command_line_args();
+#endif
+
 void tee_fprintf(FILE *file, const char *fmt, ...);
 void tee_fputs(const char *s, FILE *file);
 void tee_puts(const char *s, FILE *file);
@@ -1120,6 +1129,10 @@ int main(int argc,char *argv[])
       close(stdout_fileno_copy);             /* Clean up dup(). */
   }
 
+#ifdef _WIN32
+  argv = win_translate_command_line_args();
+#endif
+
   if (load_defaults("my",load_default_groups,&argc,&argv))
   {
     my_end(0);
@@ -1896,26 +1909,7 @@ static int read_and_execute(bool interac
           *p = '\0';
       }
 #else
-      if (!tmpbuf.is_alloced())
-        tmpbuf.alloc(65535);
-      tmpbuf.length(0);
-      buffer.length(0);
-      size_t clen;
-      do
-      {
-	line= my_cgets((char*)tmpbuf.ptr(), tmpbuf.alloced_length()-1, &clen);
-        buffer.append(line, clen);
-        /* 
-           if we got buffer fully filled than there is a chance that
-           something else is still in console input buffer
-        */
-      } while (tmpbuf.alloced_length() <= clen);
-      /* 
-        An empty line is returned from my_cgets when there's error reading :
-        Ctrl-c for example
-      */
-      if (line)
-        line= buffer.c_ptr();
+    line= win_console_readline();
 #endif /* __NETWARE__ */
 #else
       if (opt_outfile)
@@ -4642,13 +4636,21 @@ static void remove_cntrl(String &buffer)
 }
 
 
+
 void tee_fprintf(FILE *file, const char *fmt, ...)
 {
   va_list args;
 
   NETWARE_YIELD;
   va_start(args, fmt);
+#if _WIN32
+  if(win_is_console(file))
+    win_console_vfprintf(fmt, args);
+  else
+    vfprintf(file, fmt, args);
+#else
   (void) vfprintf(file, fmt, args);
+#endif
   va_end(args);
 
   if (opt_outfile)
@@ -4662,8 +4664,15 @@ void tee_fprintf(FILE *file, const char 
 
 void tee_fputs(const char *s, FILE *file)
 {
+#ifdef _WIN32
+  if(win_is_console(file))
+    win_console_fputs(s);
+  else
+    fputs(s,file);
+#else
   NETWARE_YIELD;
   fputs(s, file);
+#endif
   if (opt_outfile)
     fputs(s, OUTFILE);
 }
@@ -4672,18 +4681,20 @@ void tee_fputs(const char *s, FILE *file
 void tee_puts(const char *s, FILE *file)
 {
   NETWARE_YIELD;
-  fputs(s, file);
-  fputc('\n', file);
-  if (opt_outfile)
-  {
-    fputs(s, OUTFILE);
-    fputc('\n', OUTFILE);
-  }
+  tee_fputs(s, file);
+  tee_putc('\n', file);
 }
 
 void tee_putc(int c, FILE *file)
 {
+#if _WIN32
+  if(win_is_console(file))
+    win_console_putc(c);
+  else
+    putc(c, file);
+#else
   putc(c, file);
+#endif
   if (opt_outfile)
     putc(c, OUTFILE);
 }
@@ -4975,3 +4986,290 @@ void sql_element_free(void *ptr)
   my_free(ptr,MYF(0));
 }
 #endif /* EMBEDDED_LIBRARY */
+
+
+/* Windows console handling, mostly i18n routines */
+
+#ifdef _WIN32
+
+/* Maximum line length on Windows console */
+#define MAX_CONSOLE_LINE_SIZE 65535
+
+/*
+  Determine if a file is a windows console
+*/
+static bool win_is_console(FILE *file)
+{
+  DWORD mode;
+  if (GetConsoleMode((HANDLE)_get_osfhandle(_fileno(file)), &mode))
+    return true;
+  return false;
+}
+
+/*
+  Helper function to translate Windows wchars (UTF16 little endian) 
+  to client charset. Used for Unicode console IO
+*/
+static void my_u16stombs(wchar_t *from, char *to, uint to_length)
+{
+  int cnvres;
+  my_wc_t wc;
+  uchar *to_end= (uchar*) to + to_length - 1;
+  my_charset_conv_wc_mb wc_mb= charset_info->cset->wc_mb;
+
+  while(1)
+  {
+    wc= *from;
+    from++;
+    if(wc == 0)
+      break;
+outp:
+    if ((cnvres= (*wc_mb)(charset_info, wc, (uchar*) to, to_end)) > 0)
+      to+= cnvres;
+    else if (cnvres == MY_CS_ILUNI && wc != '?')
+    {
+      wc= '?';
+      goto outp;
+    }
+    else
+      break;
+  }
+  *to= '\0';
+}
+
+/*
+  Helper function to translate client charset to Windows wchars (UTF16 little 
+  endian). Used for console IO.
+*/
+static void my_mbstou16s(const uchar * from, wchar_t *to, uint to_chars)
+{
+  const uchar *from_end = from + strlen((const char*)from);
+  wchar_t *to_end = to + to_chars;
+  int cnvres;
+  my_charset_conv_mb_wc mb_wc = charset_info->cset->mb_wc;
+  while (1)
+  {
+    my_wc_t wc;
+    if ((cnvres= (*mb_wc)(charset_info, &wc, from, from_end)) > 0)
+    {
+      if (!wc)
+        break;
+      from+= cnvres;
+    }
+    else if (cnvres == MY_CS_ILSEQ)
+    {
+      wc= (ulong) (uchar) *from;
+      from+=1;
+    }
+    else
+      break;
+    if (to >= to_end -1)
+      break;
+    *to++= (wchar_t)wc;
+  }
+  *to = 0;
+}
+
+/*
+  Read line from Windows console. Translates Unicode input to client charset.
+*/
+char *win_console_readline()
+{
+  static wchar_t u16buf[MAX_CONSOLE_LINE_SIZE+1];
+  static char mbbuf[MAX_CONSOLE_LINE_SIZE*2+2];
+
+  HANDLE console = GetStdHandle(STD_INPUT_HANDLE);
+  wchar_t wch;
+  DWORD chars_read;
+  size_t pos= 0;
+  DWORD console_mode;
+
+  GetConsoleMode(console, &console_mode);
+  SetConsoleMode(console, 
+    ENABLE_LINE_INPUT | ENABLE_PROCESSED_INPUT | ENABLE_ECHO_INPUT);
+  for(;;)
+  {
+    BOOL ok = ReadConsoleW(console, &wch, 1, &chars_read, NULL);
+    if(!ok || chars_read == 0)
+    {
+      SetConsoleMode(console, console_mode);
+      return NULL;
+    }
+    if (wch == L'\r')
+      continue;
+    if (pos == MAX_CONSOLE_LINE_SIZE || wch == L'\n')
+      break;
+    u16buf[pos++]= wch;
+  }
+  SetConsoleMode(console, console_mode);
+  u16buf[pos]= 0;
+  my_u16stombs(u16buf, mbbuf, sizeof(mbbuf));
+  return mbbuf;
+}
+
+
+/*
+  Write a string in client charset to console. Converts string from client
+  charset to Unicode prior to output.
+*/
+static void win_console_fputs_intern(const char *data)
+{
+  static wchar_t u16buf[MAX_CONSOLE_LINE_SIZE+1];
+  my_mbstou16s((const uchar*)data, u16buf, MAX_CONSOLE_LINE_SIZE+1);
+  size_t nchars = wcslen(u16buf);
+  DWORD nwritten;
+  WriteConsoleW(GetStdHandle(STD_OUTPUT_HANDLE),u16buf, (DWORD)nchars, &nwritten, 
+      NULL);
+}
+
+
+/*
+  Buffer used by Windows-specific console putc(). Since putc() works with bytes
+  and not with characters, we need to buffer it until at least full characters 
+  is available to avoid invalid/partial output.
+*/
+static char putc_buffer[2*MAX_CONSOLE_LINE_SIZE+1];
+static int putc_buflen;
+
+/* Flushes console output buffer */
+static void flush_putc_buffer()
+{
+  if(putc_buflen)
+  {
+    putc_buffer[putc_buflen]=0;
+    win_console_fputs_intern(putc_buffer);
+    putc_buflen = 0;
+  }
+}
+
+
+/*
+  Write a byte to console. Buffers output until either end of line is found
+  or buffer gets full.
+*/
+void win_console_putc(int c)
+{
+  putc_buffer[putc_buflen++] = (char) c;
+  if(c == '\n' || putc_buflen == sizeof(putc_buffer)-1)
+  {
+    flush_putc_buffer();
+  }
+}
+
+
+/*
+  Write a string (in client charset) to console output.
+*/
+static void win_console_fputs(const char *data)
+{
+  flush_putc_buffer();
+  win_console_fputs_intern(data);
+}
+
+/*
+  Handle formatted output on the windows console.
+*/
+static void win_console_vfprintf(const char *fmt, va_list args)
+{
+  static char buff[MAX_CONSOLE_LINE_SIZE+1];
+  vsnprintf(buff, sizeof(buff)-1, fmt, args);
+  win_console_fputs(buff);
+}
+
+#include <shellapi.h>
+
+/* 
+  Argument array for mysql process, translated to client encoding.
+*/
+static char **translated_argv;
+
+/*
+  Helper function to free tranlated command line args at exit().
+*/
+static void win_free_translated_command_line_args()
+{
+    if(!translated_argv)
+      return;
+
+    for(int i=0;;i++)
+    {
+      if(!translated_argv[i])
+        break;
+      delete translated_argv[i];
+    }
+    delete translated_argv;
+}
+
+
+/* 
+  Translate command line parameters to client encoding (UTF8 by default)
+*/
+char **win_translate_command_line_args()
+{
+  wchar_t *command_line = GetCommandLineW();
+  int num_args;
+  wchar_t **wargs = CommandLineToArgvW(command_line,&num_args);
+  int csname[256]={0};
+
+  /*
+   Check for client encoding. Analyze command line for --charset=<charset> 
+   for --charset charset
+  */
+  for(int i= 0; i < num_args; i++)
+  {
+    wchar_t *wcsname= 0;
+    
+    if(wcsncmp(wargs[i], L"--charset=",10) == 0)
+    {
+      wcsname= wargs[i]+10;
+    }
+    else if(wcscmp(wargs[i], L"--charset") == 0 && i < num_args -1)
+    {
+      wcsname= wargs[i+1];
+      i++;
+    }
+    if (wcsname)
+    {
+      /*
+        Convert charset name from UTF16=>latin1. Conversion is safe since 
+        charset names are ASCII
+      */
+      for(int j=0; wcsname[j] != 0 && j < sizeof(csname)-1 ; j++)
+      {
+        csname[j]= (char) wcsname[j];
+      }
+    }
+  }
+
+  /* Try to load client charset */
+  charset_info= 0;
+
+  if(csname[0])
+    charset_info = get_charset_by_csname((const char *)csname,MY_CS_PRIMARY,
+      MYF(MY_WME));
+
+  if(!charset_info)
+    charset_info = get_charset_by_csname(default_charset,MY_CS_PRIMARY,
+      MYF(MY_WME));
+
+  /*
+    Allocate new command line array and convert command line args to client 
+    encoding.
+  */
+  translated_argv = new char *[num_args+1];
+  memset(translated_argv, 0, sizeof(char*)*(num_args+1));
+  for(int i=0; i < num_args; i++)
+  {
+    size_t len = wcslen(wargs[i])*2 + 1;
+    translated_argv[i] = new char[len];
+    my_u16stombs(wargs[i], translated_argv[i], len);
+  }
+
+  /* Cleanup on exit */
+  atexit(win_free_translated_command_line_args);
+
+  LocalFree((HLOCAL)wargs);
+  return translated_argv;
+}
+
+#endif

=== modified file 'client/mysqltest.cc'
--- a/client/mysqltest.cc	2010-02-24 13:52:27 +0000
+++ b/client/mysqltest.cc	2010-04-11 16:59:47 +0000
@@ -2589,10 +2589,28 @@ void free_tmp_sh_file()
 
 FILE* my_popen(DYNAMIC_STRING *ds_cmd, const char *mode)
 {
-#if defined __WIN__ && defined USE_CYGWIN
-  /* Dump the command into a sh script file and execute with popen */
-  str_to_file(tmp_sh_name, ds_cmd->str, ds_cmd->length);
-  return popen(tmp_sh_cmd, mode);
+#if defined _WIN32
+  /*
+    Test files are encoded in UTF8. If command line parameters contain non-ASCII
+    characters, to correctly start program  we need to use the "wide" version of
+    popen,  and to translate parameters to wide strings. For simplicity, assume
+    that  command line is limited to 4KB (like in cmd.exe) and that mode at most
+    10 characters.
+  */
+
+  wchar_t wcmd[4096];
+  wchar_t wmode[10];
+  const char *cmd= ds_cmd->str;
+  BOOL ok;
+
+  ok= MultiByteToWideChar(CP_UTF8, 0, cmd, strlen(cmd) + 1, wcmd,
+    ARRAYSIZE(wcmd) -1);
+  DBUG_ASSERT(ok);
+
+  ok= MultiByteToWideChar(CP_UTF8, 0, mode, strlen(mode)+1, wmode,
+    ARRAYSIZE(wmode) -1);
+  DBUG_ASSERT(ok);
+  return _wpopen(wcmd, wmode);
 #else
   return popen(ds_cmd->str, mode);
 #endif

=== modified file 'include/my_sys.h'
--- a/include/my_sys.h	2010-03-01 00:06:27 +0000
+++ b/include/my_sys.h	2010-04-11 16:59:47 +0000
@@ -1015,8 +1015,6 @@ int my_security_attr_create(SECURITY_ATT
 
 void my_security_attr_free(SECURITY_ATTRIBUTES *sa);
 
-/* implemented in my_conio.c */
-char* my_cgets(char *string, size_t clen, size_t* plen);
 
 #endif
 #ifdef __NETWARE__

=== modified file 'mysys/CMakeLists.txt'
--- a/mysys/CMakeLists.txt	2010-02-22 19:55:27 +0000
+++ b/mysys/CMakeLists.txt	2010-04-11 16:59:47 +0000
@@ -39,7 +39,7 @@ SET(MYSYS_SOURCES  array.c charset-def.c
 				my_rdtsc.c)
 
 IF (WIN32)
- SET (MYSYS_SOURCES ${MYSYS_SOURCES} my_winthread.c my_wincond.c my_winerr.c my_winfile.c my_windac.c my_conio.c)
+ SET (MYSYS_SOURCES ${MYSYS_SOURCES} my_winthread.c my_wincond.c my_winerr.c my_winfile.c my_windac.c)
 ENDIF()
 
 IF(NOT HAVE_CXX_NEW)

=== modified file 'mysys/Makefile.am'
--- a/mysys/Makefile.am	2009-11-24 23:36:31 +0000
+++ b/mysys/Makefile.am	2010-04-11 16:59:47 +0000
@@ -67,7 +67,7 @@ endif
 EXTRA_DIST =		thr_alarm.c thr_lock.c my_pthread.c my_thr_init.c \
 			thr_mutex.c thr_rwlock.c \
 			CMakeLists.txt mf_soundex.c \
-			my_conio.c my_wincond.c my_winthread.c my_winerr.c \
+			my_wincond.c my_winthread.c my_winerr.c \
 			my_winfile.c \
 			my_timer_cycles.il
 libmysys_a_LIBADD =	@THREAD_LOBJECTS@

=== removed file 'mysys/my_conio.c'
--- a/mysys/my_conio.c	2009-02-13 16:41:47 +0000
+++ b/mysys/my_conio.c	1970-01-01 00:00:00 +0000
@@ -1,222 +0,0 @@
-/* Copyright (C) 2000 MySQL AB
-
-   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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
-
-
-#include "mysys_priv.h"
-
-#ifdef __WIN__
-
-static HANDLE my_coninpfh= 0;     /* console input */
-
-/*
-  functions my_pthread_auto_mutex_lock & my_pthread_auto_mutex_free
-  are experimental at this moment, they are intended to bring
-  ability of protecting code sections without necessity to explicitly
-  initialize synchronization object in one of threads
-
-  if found useful they are to be exported in mysys
-*/
-
-
-/*
-  int my_pthread_auto_mutex_lock(HANDLE* ph, const char* name, 
-                                 int id, int time)
-  NOTES
-    creates a mutex with given name and tries to lock it time msec.
-    mutex name is appended with id to allow system wide or process wide
-    locks. Handle to created mutex returned in ph argument.
-
-  RETURN
-    0	              thread owns mutex
-    <>0	            error
-*/
-
-static
-int my_pthread_auto_mutex_lock(HANDLE* ph, const char* name, int id, int time)
-{
-  int res;
-  char tname[FN_REFLEN];
-  
-  sprintf(tname, "%s-%08X", name, id);
-  
-  *ph= CreateMutex(NULL, FALSE, tname);
-  if (*ph == NULL)
-    return GetLastError();
-
-  res= WaitForSingleObject(*ph, time);
-  
-  if (res == WAIT_TIMEOUT)
-    return ERROR_SEM_TIMEOUT;
-
-  if (res == WAIT_FAILED)
-    return GetLastError();
-
-  return 0;
-}
-
-/*
-  int my_pthread_auto_mutex_free(HANDLE* ph)
-
-  NOTES
-    releases a mutex.
-
-  RETURN
-    0	              thread released mutex
-    <>0	            error
-
-*/
-static
-int my_pthread_auto_mutex_free(HANDLE* ph)
-{
-  if (*ph)
-  {
-    ReleaseMutex(*ph);
-    CloseHandle(*ph);
-    *ph= NULL;
-  }
-
-  return 0;
-}
-
-
-#define pthread_auto_mutex_decl(name)                           \
-  HANDLE __h##name= NULL;
-
-#define pthread_auto_mutex_lock(name, proc, time)               \
-  my_pthread_auto_mutex_lock(&__h##name, #name, (proc), (time))
-
-#define pthread_auto_mutex_free(name)                           \
-  my_pthread_auto_mutex_free(&__h##name)
-
-
-/*
-  char* my_cgets()
-
-  NOTES
-    Replaces _cgets from libc to support input of more than 255 chars.
-    Reads from the console via ReadConsole into buffer which 
-    should be at least clen characters.
-    Actual length of string returned in plen.
-
-  WARNING
-    my_cgets() does NOT check the pushback character buffer (i.e., _chbuf).
-    Thus, my_cgets() will not return any character that is pushed back by 
-    the _ungetch() call.
-
-  RETURN
-    string pointer	ok
-    NULL	          Error
-
-*/
-
-char* my_cgets(char *buffer, size_t clen, size_t* plen)
-{
-  ULONG state;
-  char *result;
-  DWORD plen_res;
-  CONSOLE_SCREEN_BUFFER_INFO csbi;
-  
-  pthread_auto_mutex_decl(my_conio_cs);
- 
-  /* lock the console for the current process*/
-  if (pthread_auto_mutex_lock(my_conio_cs, GetCurrentProcessId(), INFINITE))
-  {
-    /* can not lock console */
-    pthread_auto_mutex_free(my_conio_cs);  
-    return NULL;
-  }
-
-  /* init console input */
-  if (my_coninpfh == 0)
-  {
-    /* same handle will be used until process termination */
-    my_coninpfh= CreateFile("CONIN$", GENERIC_READ | GENERIC_WRITE,
-                            FILE_SHARE_READ | FILE_SHARE_WRITE,
-                            NULL, OPEN_EXISTING, 0, NULL);
-  }
-
-  if (my_coninpfh == INVALID_HANDLE_VALUE) 
-  {
-    /* unlock the console */
-    pthread_auto_mutex_free(my_conio_cs);  
-    return(NULL);
-  }
-
-  GetConsoleMode((HANDLE)my_coninpfh, &state);
-  SetConsoleMode((HANDLE)my_coninpfh, ENABLE_LINE_INPUT | 
-                 ENABLE_PROCESSED_INPUT | ENABLE_ECHO_INPUT);
-
-  GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi);
-
-  /* 
-    there is no known way to determine allowed buffer size for input
-    though it is known it should not be more than 64K               
-    so we cut 64K and try first size of screen buffer               
-    if it is still to large we cut half of it and try again         
-    later we may want to cycle from min(clen, 65535) to allowed size
-    with small decrement to determine exact allowed buffer           
-  */
-  clen= min(clen, 65535);
-  do
-  {
-    clen= min(clen, (size_t) csbi.dwSize.X*csbi.dwSize.Y);
-    if (!ReadConsole((HANDLE)my_coninpfh, (LPVOID)buffer, (DWORD) clen - 1, &plen_res,
-                     NULL))
-    {
-      result= NULL;
-      clen>>= 1;
-    }
-    else
-    {
-      result= buffer;
-      break;
-    }
-  }
-  while (GetLastError() == ERROR_NOT_ENOUGH_MEMORY);
-  *plen= plen_res;
-
-  /* We go here on error reading the string (Ctrl-C for example) */
-  if (!*plen)
-    result= NULL;                              /* purecov: inspected */
-
-  if (result != NULL)
-  {
-    if (*plen > 1 && buffer[*plen - 2] == '\r')
-    {
-      *plen= *plen - 2;
-    }
-    else 
-    {
-      if (*plen > 0 && buffer[*plen - 1] == '\r')
-      {
-        char tmp[3];
-        int  tmplen= sizeof(tmp);
-
-        *plen= *plen - 1;
-        /* read /n left in the buffer */
-        ReadConsole((HANDLE)my_coninpfh, (LPVOID)tmp, tmplen, &tmplen, NULL);
-      }
-    }
-    buffer[*plen]= '\0';
-  }
-
-  SetConsoleMode((HANDLE)my_coninpfh, state);
-  /* unlock the console */
-  pthread_auto_mutex_free(my_conio_cs);  
-
-  return result;
-}
-
-#endif /* __WIN__ */


Attachment: [text/bzr-bundle] bzr/vvaintroub@mysql.com-20100411165947-7vbyqz3m2q9hyrn3.bundle
Thread
bzr commit into mysql-next-mr-bugfixing branch (vvaintroub:3144)Bug#52494 WL#5331Vladislav Vaintroub11 Apr