Below is the list of changes that have just been committed into a local
5.1 repository of dli. When dli 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@stripped, 2006-09-26 11:14:58+08:00, dli@stripped +6 -0
fixed for BUG#15021, if EMFILE error occured while purging binary logs, stop purging
logs and report error message to user.
mysys/my_open.c@stripped, 2006-09-26 11:14:55+08:00, dli@stripped +10 -2
report EMFILE error when opening file.
sql/log.cc@stripped, 2006-09-26 11:14:55+08:00, dli@stripped +12 -0
report EMFILE error when purging logs, and stop purge logs when EMFILE error occurs.
sql/log.h@stripped, 2006-09-26 11:14:55+08:00, dli@stripped +2 -0
added LOG_INFO_EMFILE error number.
sql/share/errmsg.txt@stripped, 2006-09-26 11:14:55+08:00, dli@stripped +2 -0
added EMFILE error message for purging binary logs.
sql/sql_repl.cc@stripped, 2006-09-26 11:14:55+08:00, dli@stripped +1 -0
added the EMFILE error message.
sql/table.cc@stripped, 2006-09-26 11:14:55+08:00, dli@stripped +11 -0
report EMFILE error.
# 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: dli
# Host: dev3-76.dev.cn.tlan
# Root: /home/dli/mysql/mysql-5.1/mysql-5.1-bug-15021
--- 1.29/mysys/my_open.c 2006-09-26 11:15:06 +08:00
+++ 1.30/mysys/my_open.c 2006-09-26 11:15:06 +08:00
@@ -167,9 +167,17 @@
else
my_errno=errno;
DBUG_PRINT("error",("Got error %d on open",my_errno));
- if (MyFlags & (MY_FFNF | MY_FAE | MY_WME))
- my_error(error_message_number, MYF(ME_BELL+ME_WAITTANG),
+ if (MyFlags & (MY_FFNF | MY_FAE | MY_WME)) {
+ if (my_errno == EMFILE) {
+ DBUG_PRINT("error",("print err: %d",EE_OUT_OF_FILERESOURCES));
+ my_error(EE_OUT_OF_FILERESOURCES, MYF(ME_BELL+ME_WAITTANG),
FileName, my_errno);
+ } else {
+ DBUG_PRINT("error",("print err: %d",error_message_number));
+ my_error(error_message_number, MYF(ME_BELL+ME_WAITTANG),
+ FileName, my_errno);
+ }
+ }
return(fd);
}
--- 1.223/sql/log.cc 2006-09-26 11:15:06 +08:00
+++ 1.224/sql/log.cc 2006-09-26 11:15:06 +08:00
@@ -2680,6 +2680,7 @@
ulonglong *decrease_log_space)
{
int error;
+ int ret = 0;
bool exit_loop= 0;
LOG_INFO log_info;
DBUG_ENTER("purge_logs");
@@ -2724,6 +2725,14 @@
*decrease_log_space-= file_size;
ha_binlog_index_purge_file(current_thd, log_info.log_file_name);
+ if (current_thd->query_error) {
+ DBUG_PRINT("info",("query error: %d", current_thd->query_error));
+ if (my_errno == EMFILE) {
+ DBUG_PRINT("info",("my_errno: %d, set ret = LOG_INFO_EMFILE", my_errno));
+ ret = LOG_INFO_EMFILE;
+ break;
+ }
+ }
if (find_next_log(&log_info, 0) || exit_loop)
break;
@@ -2734,6 +2743,9 @@
the log index file after restart - otherwise, this should be safe
*/
error= update_log_index(&log_info, need_update_threads);
+ if (error == 0) {
+ error = ret;
+ }
err:
if (need_mutex)
--- 1.241/sql/table.cc 2006-09-26 11:15:06 +08:00
+++ 1.242/sql/table.cc 2006-09-26 11:15:06 +08:00
@@ -1551,6 +1551,17 @@
error= 1;
my_errno= ENOENT;
}
+ else if (ha_err == EMFILE)
+ {
+ /*
+ Too many files opened, use same error message as if the .frm
+ file can't open
+ */
+ DBUG_PRINT("error", ("open file: %s failed, too many files opened (errno: %d)",
+ share->normalized_path.str, ha_err));
+ error= 1;
+ my_errno= EMFILE;
+ }
else
{
outparam->file->print_error(ha_err, MYF(0));
--- 1.119/sql/share/errmsg.txt 2006-09-26 11:15:06 +08:00
+++ 1.120/sql/share/errmsg.txt 2006-09-26 11:15:06 +08:00
@@ -5954,3 +5954,5 @@
eng "One can use only CSV and MyISAM engines for the log tables"
ER_CANT_DROP_LOG_TABLE
eng "Cannot drop log table if log is enabled"
+ER_BINLOG_PURGE_EMFILE
+ eng "Too many files opened, please execute the command again"
--- 1.13/sql/log.h 2006-09-26 11:15:06 +08:00
+++ 1.14/sql/log.h 2006-09-26 11:15:06 +08:00
@@ -114,6 +114,8 @@
#define LOG_INFO_MEM -6
#define LOG_INFO_FATAL -7
#define LOG_INFO_IN_USE -8
+#define LOG_INFO_EMFILE -9
+
/* bitmap to SQL_LOG::close() */
#define LOG_CLOSE_INDEX 1
--- 1.154/sql/sql_repl.cc 2006-09-26 11:15:06 +08:00
+++ 1.155/sql/sql_repl.cc 2006-09-26 11:15:06 +08:00
@@ -239,6 +239,7 @@
case LOG_INFO_MEM: errmsg= ER_OUT_OF_RESOURCES; break;
case LOG_INFO_FATAL: errmsg= ER_BINLOG_PURGE_FATAL_ERR; break;
case LOG_INFO_IN_USE: errmsg= ER_LOG_IN_USE; break;
+ case LOG_INFO_EMFILE: errmsg= ER_BINLOG_PURGE_EMFILE; break;
default: errmsg= ER_LOG_PURGE_UNKNOWN_ERR; break;
}
| Thread |
|---|
| • bk commit into 5.1 tree (dli:1.2289) BUG#15021 | David Li | 26 Sep |