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
88961a28
Commit
88961a28
authored
May 04, 2019
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-17710 "unknown error" with FLUSH LOGS if log directory is not writeable
parent
15c79c41
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
16 deletions
+23
-16
mysql-test/main/flush_logs_not_windows.result
mysql-test/main/flush_logs_not_windows.result
+3
-0
mysql-test/main/flush_logs_not_windows.test
mysql-test/main/flush_logs_not_windows.test
+13
-0
sql/log.cc
sql/log.cc
+6
-6
sql/log.h
sql/log.h
+1
-0
sql/mysqld.cc
sql/mysqld.cc
+0
-3
sql/sql_reload.cc
sql/sql_reload.cc
+0
-7
No files found.
mysql-test/main/flush_logs_not_windows.result
0 → 100644
View file @
88961a28
flush logs;
ERROR HY000: Can't create file 'MYSQLTEST_VARDIR/log/mysqld.1.err' (errno: 13 "Permission denied")
flush logs;
mysql-test/main/flush_logs_not_windows.test
0 → 100644
View file @
88961a28
source
include
/
not_windows
.
inc
;
source
include
/
not_embedded
.
inc
;
#
# MDEV-17710 "unknown error" with FLUSH LOGS if log directory is not writeable
#
move_file
$MYSQLTEST_VARDIR
/
log
/
mysqld
.
1.
err
$MYSQLTEST_VARDIR
/
log
/
mysqld
.
1.
err
-
bak
;
system
chmod
u
-
w
$MYSQLTEST_VARDIR
/
log
;
replace_result
$MYSQLTEST_VARDIR
MYSQLTEST_VARDIR
;
error
ER_CANT_CREATE_FILE
;
flush
logs
;
system
chmod
u
+
w
$MYSQLTEST_VARDIR
/
log
;
move_file
$MYSQLTEST_VARDIR
/
log
/
mysqld
.
1.
err
-
bak
$MYSQLTEST_VARDIR
/
log
/
mysqld
.
1.
err
;
flush
logs
;
sql/log.cc
View file @
88961a28
...
...
@@ -8644,14 +8644,14 @@ void sql_perror(const char *message)
redirect stdout and stderr to a file. The streams are reopened
only for appending (writing at end of file).
*/
extern
"C"
my_bool
reopen_fstreams
(
const
char
*
filename
,
FILE
*
outstream
,
FILE
*
errstream
)
bool
reopen_fstreams
(
const
char
*
filename
,
FILE
*
outstream
,
FILE
*
errstream
)
{
if
(
outstream
&&
!
my_freopen
(
filename
,
"a"
,
outstream
))
return
TRUE
;
if
(
errstream
&&
!
my_freopen
(
filename
,
"a"
,
errstream
))
if
(
(
outstream
&&
!
my_freopen
(
filename
,
"a"
,
outstream
))
||
(
errstream
&&
!
my_freopen
(
filename
,
"a"
,
errstream
)))
{
my_error
(
ER_CANT_CREATE_FILE
,
MYF
(
0
),
filename
,
errno
);
return
TRUE
;
}
/* The error stream must be unbuffered. */
if
(
errstream
)
...
...
sql/log.h
View file @
88961a28
...
...
@@ -26,6 +26,7 @@ class Relay_log_info;
class
Format_description_log_event
;
bool
reopen_fstreams
(
const
char
*
filename
,
FILE
*
outstream
,
FILE
*
errstream
);
void
setup_log_handling
();
bool
trans_has_updated_trans_table
(
const
THD
*
thd
);
bool
stmt_has_updated_trans_table
(
const
THD
*
thd
);
...
...
sql/mysqld.cc
View file @
88961a28
...
...
@@ -209,9 +209,6 @@ typedef fp_except fp_except_t;
#define fcntl(X,Y,Z) 0
#endif
extern
"C"
my_bool
reopen_fstreams
(
const
char
*
filename
,
FILE
*
outstream
,
FILE
*
errstream
);
inline
void
setup_fpu
()
{
#if defined(__FreeBSD__) && defined(HAVE_IEEEFP_H) && !defined(HAVE_FEDISABLEEXCEPT)
...
...
sql/sql_reload.cc
View file @
88961a28
...
...
@@ -124,14 +124,7 @@ bool reload_acl_and_cache(THD *thd, unsigned long long options,
if
(
options
&
REFRESH_ERROR_LOG
)
if
(
unlikely
(
flush_error_log
()))
{
/*
When flush_error_log() failed, my_error() has not been called.
So, we have to do it here to keep the protocol.
*/
my_error
(
ER_UNKNOWN_ERROR
,
MYF
(
0
));
result
=
1
;
}
if
((
options
&
REFRESH_SLOW_LOG
)
&&
global_system_variables
.
sql_log_slow
)
logger
.
flush_slow_log
();
...
...
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