summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <monty@narttu.mysql.fi>2003-03-10 11:23:11 +0200
committerunknown <monty@narttu.mysql.fi>2003-03-10 11:23:11 +0200
commitea826f215fb926ef085711d8a43d90b9769068fc (patch)
treecad18525329dcc58c78c301be53d369ae5667806 /sql
parentaa0f5c8e15d75820b2e93c16a529c44a2525b792 (diff)
parent68ae365395c78eba74b4db66fb0989e76d221d0d (diff)
downloadmariadb-git-ea826f215fb926ef085711d8a43d90b9769068fc.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-3.23
into narttu.mysql.fi:/my/mysql-3.23
Diffstat (limited to 'sql')
-rw-r--r--sql/ha_myisam.cc42
-rw-r--r--sql/slave.cc34
2 files changed, 39 insertions, 37 deletions
diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc
index 31a8d3c7109..1349e28b546 100644
--- a/sql/ha_myisam.cc
+++ b/sql/ha_myisam.cc
@@ -419,38 +419,38 @@ int ha_myisam::backup(THD* thd, HA_CHECK_OPT *check_opt)
const char* errmsg = "";
if (!fn_format(dst_path, table_name, backup_dir, reg_ext, 4 + 64))
- {
- errmsg = "Failed in fn_format() for .frm file: errno = %d";
- error = HA_ADMIN_INVALID;
- goto err;
- }
+ {
+ errmsg = "Failed in fn_format() for .frm file (errno: %d)";
+ error = HA_ADMIN_INVALID;
+ goto err;
+ }
if (my_copy(fn_format(src_path, table->path,"", reg_ext, 4),
- dst_path,
- MYF(MY_WME | MY_HOLD_ORIGINAL_MODES )))
+ dst_path,
+ MYF(MY_WME | MY_HOLD_ORIGINAL_MODES | MY_DONT_OVERWRITE_FILE)))
{
error = HA_ADMIN_FAILED;
- errmsg = "Failed copying .frm file: errno = %d";
+ errmsg = "Failed copying .frm file (errno: %d)";
goto err;
}
if (!fn_format(dst_path, table_name, backup_dir, MI_NAME_DEXT, 4 + 64))
- {
- errmsg = "Failed in fn_format() for .MYD file: errno = %d";
- error = HA_ADMIN_INVALID;
- goto err;
- }
+ {
+ errmsg = "Failed in fn_format() for .MYD file (errno: %d)";
+ error = HA_ADMIN_INVALID;
+ goto err;
+ }
if (my_copy(fn_format(src_path, table->path,"", MI_NAME_DEXT, 4),
dst_path,
- MYF(MY_WME | MY_HOLD_ORIGINAL_MODES )) )
- {
- errmsg = "Failed copying .MYD file: errno = %d";
- error= HA_ADMIN_FAILED;
- goto err;
- }
+ MYF(MY_WME | MY_HOLD_ORIGINAL_MODES | MY_DONT_OVERWRITE_FILE)))
+ {
+ errmsg = "Failed copying .MYD file (errno: %d)";
+ error= HA_ADMIN_FAILED;
+ goto err;
+ }
return HA_ADMIN_OK;
- err:
+err:
{
MI_CHECK param;
myisamchk_init(&param);
@@ -459,7 +459,7 @@ int ha_myisam::backup(THD* thd, HA_CHECK_OPT *check_opt)
param.db_name = table->table_cache_key;
param.table_name = table->table_name;
param.testflag = 0;
- mi_check_print_error(&param,errmsg, errno );
+ mi_check_print_error(&param, errmsg, my_errno);
return error;
}
}
diff --git a/sql/slave.cc b/sql/slave.cc
index a1972dc5a5d..358a908e0cc 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -1270,6 +1270,17 @@ This may also be a network problem, or just a bug in the master or slave code.\
pthread_handler_decl(handle_slave,arg __attribute__((unused)))
{
+ // needs to call my_thread_init(), otherwise we get a coredump in DBUG_ stuff
+ my_thread_init();
+ if (!server_id)
+ {
+ pthread_cond_broadcast(&COND_slave_start);
+ sql_print_error("Server id not set, will not start slave");
+ my_thread_end();
+ pthread_exit((void*)1);
+ }
+ DBUG_ENTER("handle_slave");
+
#ifndef DBUG_OFF
slave_begin:
#endif
@@ -1278,20 +1289,14 @@ pthread_handler_decl(handle_slave,arg __attribute__((unused)))
char llbuff[22];
pthread_mutex_lock(&LOCK_slave);
- if (!server_id)
+
+ if (slave_running)
{
pthread_cond_broadcast(&COND_slave_start);
pthread_mutex_unlock(&LOCK_slave);
- sql_print_error("Server id not set, will not start slave");
- pthread_exit((void*)1);
+ my_thread_end();
+ pthread_exit((void*)1); // safety just in case
}
-
- if(slave_running)
- {
- pthread_cond_broadcast(&COND_slave_start);
- pthread_mutex_unlock(&LOCK_slave);
- pthread_exit((void*)1); // safety just in case
- }
slave_running = 1;
abort_slave = 0;
#ifndef DBUG_OFF
@@ -1304,11 +1309,8 @@ pthread_handler_decl(handle_slave,arg __attribute__((unused)))
bool retried_once = 0;
ulonglong last_failed_pos = 0;
- // needs to call my_thread_init(), otherwise we get a coredump in DBUG_ stuff
- my_thread_init();
slave_thd = thd = new THD; // note that contructor of THD uses DBUG_ !
thd->set_time();
- DBUG_ENTER("handle_slave");
pthread_detach_this_thread();
if (init_slave_thread(thd) || init_master_info(&glob_mi))
@@ -1518,18 +1520,18 @@ position %s",
abort_slave = 0;
save_temporary_tables = thd->temporary_tables;
thd->temporary_tables = 0; // remove tempation from destructor to close them
- pthread_cond_broadcast(&COND_slave_stopped); // tell the world we are done
- pthread_mutex_unlock(&LOCK_slave);
net_end(&thd->net); // destructor will not free it, because we are weird
slave_thd = 0;
(void) pthread_mutex_lock(&LOCK_thread_count);
delete thd;
(void) pthread_mutex_unlock(&LOCK_thread_count);
- my_thread_end();
+ pthread_mutex_unlock(&LOCK_slave);
+ pthread_cond_broadcast(&COND_slave_stopped); // tell the world we are done
#ifndef DBUG_OFF
if(abort_slave_event_count && !events_till_abort)
goto slave_begin;
#endif
+ my_thread_end();
pthread_exit(0);
DBUG_RETURN(0); // Can't return anything here
}