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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
f7ab14d7
Commit
f7ab14d7
authored
Dec 28, 2012
by
Venkatesh Duggirala
Browse files
Options
Browse Files
Download
Plain Diff
BUG#14726272- BACKPORT FIX FOR BUG 11746142 TO 5.5 AND 5.1
Merging fix from mysql-5.1
parents
519daab6
ec70b93e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
8 deletions
+40
-8
sql/mysqld.cc
sql/mysqld.cc
+40
-8
No files found.
sql/mysqld.cc
View file @
f7ab14d7
...
...
@@ -993,6 +993,7 @@ static void clean_up(bool print_message);
static
int
test_if_case_insensitive
(
const
char
*
dir_name
);
#ifndef EMBEDDED_LIBRARY
static
bool
pid_file_created
=
false
;
static
void
usage
(
void
);
static
void
start_signal_handler
(
void
);
static
void
close_server_sock
();
...
...
@@ -1001,6 +1002,7 @@ static void wait_for_signal_thread_to_end(void);
static
void
create_pid_file
();
static
void
mysqld_exit
(
int
exit_code
)
__attribute__
((
noreturn
));
#endif
static
void
delete_pid_file
(
myf
flags
);
static
void
end_ssl
();
...
...
@@ -1515,10 +1517,8 @@ void clean_up(bool print_message)
debug_sync_end
();
#endif
/* defined(ENABLED_DEBUG_SYNC) */
#if !defined(EMBEDDED_LIBRARY)
if
(
!
opt_bootstrap
)
mysql_file_delete
(
key_file_pid
,
pidfile_name
,
MYF
(
0
));
// This may not always exist
#endif
delete_pid_file
(
MYF
(
0
));
if
(
print_message
&&
my_default_lc_messages
&&
server_start_time
)
sql_print_information
(
ER_DEFAULT
(
ER_SHUTDOWN_COMPLETE
),
my_progname
);
cleanup_errmsgs
();
...
...
@@ -4517,9 +4517,7 @@ int mysqld_main(int argc, char **argv)
(
void
)
pthread_kill
(
signal_thread
,
MYSQL_KILL_SIGNAL
);
if
(
!
opt_bootstrap
)
mysql_file_delete
(
key_file_pid
,
pidfile_name
,
MYF
(
MY_WME
));
// Not needed anymore
delete_pid_file
(
MYF
(
MY_WME
));
if
(
unix_sock
!=
INVALID_SOCKET
)
unlink
(
mysqld_unix_port
);
...
...
@@ -7676,13 +7674,14 @@ static void create_pid_file()
if
((
file
=
mysql_file_create
(
key_file_pid
,
pidfile_name
,
0664
,
O_WRONLY
|
O_TRUNC
,
MYF
(
MY_WME
)))
>=
0
)
{
char
buff
[
2
1
],
*
end
;
char
buff
[
MAX_BIGINT_WIDTH
+
1
],
*
end
;
end
=
int10_to_str
((
long
)
getpid
(),
buff
,
10
);
*
end
++=
'\n'
;
if
(
!
mysql_file_write
(
file
,
(
uchar
*
)
buff
,
(
uint
)
(
end
-
buff
),
MYF
(
MY_WME
|
MY_NABP
)))
{
mysql_file_close
(
file
,
MYF
(
0
));
pid_file_created
=
true
;
return
;
}
mysql_file_close
(
file
,
MYF
(
0
));
...
...
@@ -7692,6 +7691,39 @@ static void create_pid_file()
}
#endif
/* EMBEDDED_LIBRARY */
/**
Remove the process' pid file.
@param flags file operation flags
*/
static
void
delete_pid_file
(
myf
flags
)
{
#ifndef EMBEDDED_LIBRARY
File
file
;
if
(
opt_bootstrap
||
!
pid_file_created
||
!
(
file
=
mysql_file_open
(
key_file_pid
,
pidfile_name
,
O_RDONLY
,
flags
)))
return
;
/* Make sure that the pid file was created by the same process. */
uchar
buff
[
MAX_BIGINT_WIDTH
+
1
];
size_t
error
=
mysql_file_read
(
file
,
buff
,
sizeof
(
buff
),
flags
);
mysql_file_close
(
file
,
flags
);
buff
[
sizeof
(
buff
)
-
1
]
=
'\0'
;
if
(
error
!=
MY_FILE_ERROR
&&
atol
((
char
*
)
buff
)
==
(
long
)
getpid
())
{
mysql_file_delete
(
key_file_pid
,
pidfile_name
,
flags
);
pid_file_created
=
false
;
}
#endif
/* EMBEDDED_LIBRARY */
return
;
}
/** Clear most status variables. */
void
refresh_status
(
THD
*
thd
)
{
...
...
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