Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
0bf94589
Commit
0bf94589
authored
Nov 27, 2002
by
miguel@hegel.br
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for shutdown on several instances servers started as standalone
parent
98b336af
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
12 deletions
+13
-12
sql/mysqld.cc
sql/mysqld.cc
+13
-12
No files found.
sql/mysqld.cc
View file @
0bf94589
...
@@ -383,7 +383,7 @@ enum db_type default_table_type=DB_TYPE_MYISAM;
...
@@ -383,7 +383,7 @@ enum db_type default_table_type=DB_TYPE_MYISAM;
#undef getpid
#undef getpid
#include <process.h>
#include <process.h>
HANDLE
hEventShutdown
;
HANDLE
hEventShutdown
;
static
char
*
event_name
;
static
char
shutdown_event_name
[
40
]
;
#include "nt_servc.h"
#include "nt_servc.h"
static
NTService
Service
;
// Service object for WinNT
static
NTService
Service
;
// Service object for WinNT
#endif
#endif
...
@@ -640,10 +640,6 @@ void kill_mysql(void)
...
@@ -640,10 +640,6 @@ void kill_mysql(void)
{
{
DBUG_PRINT
(
"error"
,(
"Got error: %ld from SetEvent"
,
GetLastError
()));
DBUG_PRINT
(
"error"
,(
"Got error: %ld from SetEvent"
,
GetLastError
()));
}
}
// or:
// HANDLE hEvent=OpenEvent(0, FALSE, "MySqlShutdown");
// SetEvent(hEventShutdown);
// CloseHandle(hEvent);
}
}
#elif defined(OS2)
#elif defined(OS2)
pthread_cond_signal
(
&
eventShutdown
);
// post semaphore
pthread_cond_signal
(
&
eventShutdown
);
// post semaphore
...
@@ -1993,7 +1989,7 @@ The server will not act as a slave.");
...
@@ -1993,7 +1989,7 @@ The server will not act as a slave.");
(
void
)
thr_setconcurrency
(
concurrency
);
// 10 by default
(
void
)
thr_setconcurrency
(
concurrency
);
// 10 by default
#ifdef __WIN__ //IRENA
#ifdef __WIN__ //IRENA
{
{
hEventShutdown
=
CreateEvent
(
0
,
FALSE
,
FALSE
,
"MySqlShutdown"
);
hEventShutdown
=
CreateEvent
(
0
,
FALSE
,
FALSE
,
shutdown_event_name
);
pthread_t
hThread
;
pthread_t
hThread
;
if
(
pthread_create
(
&
hThread
,
&
connection_attrib
,
handle_shutdown
,
0
))
if
(
pthread_create
(
&
hThread
,
&
connection_attrib
,
handle_shutdown
,
0
))
sql_print_error
(
"Warning: Can't create thread to handle shutdown requests"
);
sql_print_error
(
"Warning: Can't create thread to handle shutdown requests"
);
...
@@ -2182,6 +2178,14 @@ bool default_service_handling(char **argv,
...
@@ -2182,6 +2178,14 @@ bool default_service_handling(char **argv,
int
main
(
int
argc
,
char
**
argv
)
int
main
(
int
argc
,
char
**
argv
)
{
{
/* When several instances are running on the same machine, we
need to have an unique named hEventShudown through the
application PID e.g.: MySQLShutdown1890; MySQLShutdown2342
*/
int2str
((
int
)
GetCurrentProcessId
(),
strmov
(
shutdown_event_name
,
"MySQLShutdown"
),
10
);
if
(
Service
.
GetOS
())
/* true NT family */
if
(
Service
.
GetOS
())
/* true NT family */
{
{
char
file_path
[
FN_REFLEN
];
char
file_path
[
FN_REFLEN
];
...
@@ -2196,10 +2200,9 @@ int main(int argc, char **argv)
...
@@ -2196,10 +2200,9 @@ int main(int argc, char **argv)
if
(
Service
.
IsService
(
argv
[
1
]))
if
(
Service
.
IsService
(
argv
[
1
]))
{
{
/* start an optional service */
/* start an optional service */
event_name
=
argv
[
1
];
load_default_groups
[
0
]
=
argv
[
1
];
load_default_groups
[
0
]
=
argv
[
1
];
start_mode
=
1
;
start_mode
=
1
;
Service
.
Init
(
event_name
,
mysql_service
);
Service
.
Init
(
argv
[
1
]
,
mysql_service
);
return
0
;
return
0
;
}
}
}
}
...
@@ -2218,9 +2221,8 @@ int main(int argc, char **argv)
...
@@ -2218,9 +2221,8 @@ int main(int argc, char **argv)
use_opt_args
=
1
;
use_opt_args
=
1
;
opt_argc
=
argc
;
opt_argc
=
argc
;
opt_argv
=
argv
;
opt_argv
=
argv
;
event_name
=
argv
[
2
];
start_mode
=
1
;
start_mode
=
1
;
Service
.
Init
(
event_name
,
mysql_service
);
Service
.
Init
(
argv
[
2
]
,
mysql_service
);
return
0
;
return
0
;
}
}
}
}
...
@@ -2240,7 +2242,6 @@ int main(int argc, char **argv)
...
@@ -2240,7 +2242,6 @@ int main(int argc, char **argv)
{
{
/* start the default service */
/* start the default service */
start_mode
=
1
;
start_mode
=
1
;
event_name
=
"MySqlShutdown"
;
Service
.
Init
(
MYSQL_SERVICENAME
,
mysql_service
);
Service
.
Init
(
MYSQL_SERVICENAME
,
mysql_service
);
return
0
;
return
0
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment