Below is the list of changes that have just been committed into a local
5.0 repository of tnurnberg. When tnurnberg 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.2161 06/06/01 07:16:49 tnurnberg@stripped +1 -0
Bug#17926: mysql.exe crashes when ctrl-c is pressed in windows
stop main-thread from sig-handler thread when receiving Control-C in
Windows to prevent a race.
client/mysql.cc
1.206 06/06/01 07:16:41 tnurnberg@stripped +23 -0
stop main-thread from sig-handler thread when receiving Control-C in
Windows to prevent a race.
# 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: tnurnberg
# Host: salvation.intern.azundris.com
# Root: /home/mysql-5.0-maint-17926
--- 1.205/client/mysql.cc 2006-05-11 15:14:03 +02:00
+++ 1.206/client/mysql.cc 2006-06-01 07:16:41 +02:00
@@ -177,6 +177,10 @@
static uint opt_protocol=0;
static CHARSET_INFO *charset_info= &my_charset_latin1;
+#ifdef __WIN__
+HANDLE main_thread=0;
+#endif
+
#include "sslopt-vars.h"
const char *default_dbug_option="d:t:o,/tmp/mysql.trace";
@@ -347,6 +351,15 @@
char *emb_argv[4];
int emb_argc;
+#ifdef __WIN__
+
+ if (!DuplicateHandle(GetCurrentProcess(), GetCurrentThread(),
+ GetCurrentProcess(), &main_thread,
+ 0, FALSE, DUPLICATE_SAME_ACCESS))
+ put_info("couldn't get handle for main-thread?", INFO_INFO);
+
+#endif
+
/* Get --defaults-xxx args for mysql_server_init() */
emb_argc= get_defaults_options(argc, argv, &defaults, &extra_defaults,
&group_suffix)+1;
@@ -490,6 +503,16 @@
sig_handler mysql_end(int sig)
{
+#ifdef __WIN__
+ if (main_thread) {
+ if (sig == SIGINT) {
+ if(SuspendThread(main_thread) == -1)
+ put_info("couldn't stop main thread.", INFO_INFO);
+ }
+ CloseHandle(main_thread);
+ main_thread= 0;
+ }
+#endif
mysql_close(&mysql);
#ifdef HAVE_READLINE
if (!status.batch && !quick && !opt_html && !opt_xml &&
histfile)
| Thread |
|---|
| • bk commit into 5.0 tree (tnurnberg:1.2161) BUG#17926 | Tatjana A Nuernberg | 1 Jun |