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
8f9d5938
Commit
8f9d5938
authored
Jan 02, 2013
by
Venkatesh Duggirala
Browse files
Options
Browse Files
Download
Plain Diff
BUG#11753923-SQL THREAD CRASHES ON DISK FULL
Merging fix from mysql-5.1
parents
7a846307
c72f687f
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
6 deletions
+47
-6
include/my_sys.h
include/my_sys.h
+2
-0
mysys/errors.c
mysys/errors.c
+18
-6
mysys/my_error.c
mysys/my_error.c
+22
-0
mysys/my_write.c
mysys/my_write.c
+4
-0
sql/mysqld.cc
sql/mysqld.cc
+1
-0
No files found.
include/my_sys.h
View file @
8f9d5938
...
...
@@ -210,6 +210,7 @@ extern char curr_dir[]; /* Current directory for user */
extern
void
(
*
error_handler_hook
)(
uint
my_err
,
const
char
*
str
,
myf
MyFlags
);
extern
void
(
*
fatal_error_handler_hook
)(
uint
my_err
,
const
char
*
str
,
myf
MyFlags
);
extern
void
(
*
sql_print_warning_hook
)(
const
char
*
format
,...);
extern
uint
my_file_limit
;
extern
ulong
my_thread_stack_size
;
...
...
@@ -641,6 +642,7 @@ extern void my_printv_error(uint error, const char *format, myf MyFlags,
va_list
ap
);
extern
int
my_error_register
(
const
char
**
(
*
get_errmsgs
)
(),
int
first
,
int
last
);
extern
void
my_printf_warning
(
const
char
*
format
,
...);
extern
const
char
**
my_error_unregister
(
int
first
,
int
last
);
extern
void
my_message
(
uint
my_err
,
const
char
*
str
,
myf
MyFlags
);
extern
void
my_message_stderr
(
uint
my_err
,
const
char
*
str
,
myf
MyFlags
);
...
...
mysys/errors.c
View file @
8f9d5938
...
...
@@ -99,17 +99,29 @@ void init_glob_errs()
}
#endif
/*
We cannot call my_error/my_printf_error here in this function.
Those functions will set status variable in diagnostic area
and there is no provision to reset them back.
Here we are waiting for free space and will wait forever till
space is created. So just giving warning in the error file
should be enough.
*/
void
wait_for_free_space
(
const
char
*
filename
,
int
errors
)
{
if
(
errors
==
0
)
my_error
(
EE_DISK_FULL
,
MYF
(
ME_BELL
|
ME_NOREFRESH
),
filename
,
my_errno
,
MY_WAIT_FOR_USER_TO_FIX_PANIC
);
if
(
!
(
errors
%
MY_WAIT_GIVE_USER_A_MESSAGE
))
my_printf_error
(
EE_DISK_FULL
,
"Retry in %d secs. Message reprinted in %d secs"
,
MYF
(
ME_BELL
|
ME_NOREFRESH
),
{
my_printf_warning
(
EE
(
EE_DISK_FULL
),
filename
,
my_errno
,
MY_WAIT_FOR_USER_TO_FIX_PANIC
);
my_printf_warning
(
"Retry in %d secs. Message reprinted in %d secs"
,
MY_WAIT_FOR_USER_TO_FIX_PANIC
,
MY_WAIT_GIVE_USER_A_MESSAGE
*
MY_WAIT_FOR_USER_TO_FIX_PANIC
);
}
DBUG_EXECUTE_IF
(
"simulate_file_write_error_once"
,
{
(
void
)
sleep
(
1
);
return
;
});
(
void
)
sleep
(
MY_WAIT_FOR_USER_TO_FIX_PANIC
);
}
...
...
mysys/my_error.c
View file @
8f9d5938
...
...
@@ -148,6 +148,28 @@ void my_printv_error(uint error, const char *format, myf MyFlags, va_list ap)
DBUG_VOID_RETURN
;
}
/*
Warning as printf
SYNOPSIS
my_printf_warning()
format> Format string
...> variable list
*/
void
(
*
sql_print_warning_hook
)(
const
char
*
format
,...);
void
my_printf_warning
(
const
char
*
format
,
...)
{
va_list
args
;
char
wbuff
[
ERRMSGSIZE
];
DBUG_ENTER
(
"my_printf_warning"
);
DBUG_PRINT
(
"my"
,
(
"Format: %s"
,
format
));
va_start
(
args
,
format
);
(
void
)
my_vsnprintf
(
wbuff
,
sizeof
(
wbuff
),
format
,
args
);
va_end
(
args
);
(
*
sql_print_warning_hook
)(
wbuff
);
DBUG_VOID_RETURN
;
}
/*
Give message using error_handler_hook
...
...
mysys/my_write.c
View file @
8f9d5938
...
...
@@ -33,6 +33,8 @@ size_t my_write(File Filedes, const uchar *Buffer, size_t Count, myf MyFlags)
if
(
unlikely
(
!
Count
))
DBUG_RETURN
(
0
);
DBUG_EXECUTE_IF
(
"simulate_file_write_error_once"
,
{
DBUG_SET
(
"+d,simulate_file_write_error"
);});
for
(;;)
{
#ifdef _WIN32
...
...
@@ -65,6 +67,8 @@ size_t my_write(File Filedes, const uchar *Buffer, size_t Count, myf MyFlags)
{
wait_for_free_space
(
my_filename
(
Filedes
),
errors
);
errors
++
;
DBUG_EXECUTE_IF
(
"simulate_file_write_error_once"
,
{
DBUG_SET
(
"-d,simulate_file_write_error"
);});
continue
;
}
...
...
sql/mysqld.cc
View file @
8f9d5938
...
...
@@ -4507,6 +4507,7 @@ int mysqld_main(int argc, char **argv)
After this we can't quit by a simple unireg_abort
*/
error_handler_hook
=
my_message_sql
;
sql_print_warning_hook
=
sql_print_warning
;
start_signal_handler
();
// Creates pidfile
if
(
mysql_rm_tmp_tables
()
||
acl_init
(
opt_noacl
)
||
...
...
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