mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
Ugly merge! But I am not done yet - there are a number of things I need to fix
before I can push BitKeeper/etc/ignore: auto-union Makefile.am: Auto merged include/my_sys.h: Auto merged libmysqld/lib_sql.cc: Auto merged mysql-test/t/rpl_log.test: Auto merged mysys/mf_iocache.c: Auto merged mysys/mf_iocache2.c: Auto merged mysys/thr_mutex.c: Auto merged sql/item_func.cc: Auto merged sql/lex.h: Auto merged sql/mini_client.cc: Auto merged sql/mini_client.h: Auto merged sql/mysql_priv.h: Auto merged sql/repl_failsafe.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_show.cc: Auto merged sql/stacktrace.c: Auto merged sql/structs.h: Auto merged mysql-test/r/rpl000014.result: merge mysql-test/r/rpl000015.result: merge mysql-test/r/rpl000016.result: merge mysql-test/r/rpl_log.result: merge sql/log.cc: merge sql/log_event.cc: merge sql/log_event.h: merge sql/mysqld.cc: merge sql/slave.cc: merge sql/slave.h: merge sql/sql_class.h: merge sql/sql_parse.cc: merge sql/sql_repl.cc: merge sql/sql_yacc.yy: merge
This commit is contained in:
@ -1359,14 +1359,18 @@ mysql_execute_command(void)
|
||||
{
|
||||
if (check_access(thd, PROCESS_ACL, any_db))
|
||||
goto error;
|
||||
res = change_master(thd);
|
||||
LOCK_ACTIVE_MI;
|
||||
res = change_master(thd,active_mi);
|
||||
UNLOCK_ACTIVE_MI;
|
||||
break;
|
||||
}
|
||||
case SQLCOM_SHOW_SLAVE_STAT:
|
||||
{
|
||||
if (check_process_priv(thd))
|
||||
goto error;
|
||||
res = show_master_info(thd);
|
||||
LOCK_ACTIVE_MI;
|
||||
res = show_master_info(thd,active_mi);
|
||||
UNLOCK_ACTIVE_MI;
|
||||
break;
|
||||
}
|
||||
case SQLCOM_SHOW_MASTER_STAT:
|
||||
@ -1376,15 +1380,15 @@ mysql_execute_command(void)
|
||||
res = show_binlog_info(thd);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case SQLCOM_LOAD_MASTER_DATA: // sync with master
|
||||
if (check_process_priv(thd))
|
||||
goto error;
|
||||
res = load_master_data(thd);
|
||||
break;
|
||||
|
||||
|
||||
case SQLCOM_LOAD_MASTER_TABLE:
|
||||
|
||||
{
|
||||
if (!tables->db)
|
||||
tables->db=thd->db;
|
||||
if (check_access(thd,CREATE_ACL,tables->db,&tables->grant.privilege))
|
||||
@ -1404,12 +1408,16 @@ mysql_execute_command(void)
|
||||
net_printf(&thd->net,ER_WRONG_TABLE_NAME,tables->name);
|
||||
break;
|
||||
}
|
||||
|
||||
if (fetch_nx_table(thd, tables->db, tables->real_name, &glob_mi, 0))
|
||||
break; // fetch_nx_table did send the error to the client
|
||||
send_ok(&thd->net);
|
||||
LOCK_ACTIVE_MI;
|
||||
// fetch_master_table will send the error to the client on failure
|
||||
if (!fetch_master_table(thd, tables->db, tables->real_name,
|
||||
active_mi, 0))
|
||||
{
|
||||
send_ok(&thd->net);
|
||||
}
|
||||
UNLOCK_ACTIVE_MI;
|
||||
break;
|
||||
|
||||
}
|
||||
case SQLCOM_CREATE_TABLE:
|
||||
if (!tables->db)
|
||||
tables->db=thd->db;
|
||||
@ -1509,12 +1517,19 @@ mysql_execute_command(void)
|
||||
break;
|
||||
|
||||
case SQLCOM_SLAVE_START:
|
||||
start_slave(thd);
|
||||
{
|
||||
LOCK_ACTIVE_MI;
|
||||
start_slave(thd,active_mi,1 /* net report*/);
|
||||
UNLOCK_ACTIVE_MI;
|
||||
break;
|
||||
}
|
||||
case SQLCOM_SLAVE_STOP:
|
||||
stop_slave(thd);
|
||||
{
|
||||
LOCK_ACTIVE_MI;
|
||||
stop_slave(thd,active_mi,1/* net report*/);
|
||||
UNLOCK_ACTIVE_MI;
|
||||
break;
|
||||
|
||||
}
|
||||
case SQLCOM_ALTER_TABLE:
|
||||
#if defined(DONT_ALLOW_SHOW_COMMANDS)
|
||||
send_error(&thd->net,ER_NOT_ALLOWED_COMMAND); /* purecov: inspected */
|
||||
@ -3204,6 +3219,7 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables)
|
||||
bool result=0;
|
||||
|
||||
select_errors=0; /* Write if more errors */
|
||||
// TODO: figure out what's up with the commented out line below
|
||||
// mysql_log.flush(); // Flush log
|
||||
if (options & REFRESH_GRANT)
|
||||
{
|
||||
@ -3244,16 +3260,22 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables)
|
||||
if (options & REFRESH_THREADS)
|
||||
flush_thread_cache();
|
||||
if (options & REFRESH_MASTER)
|
||||
reset_master();
|
||||
if (options & REFRESH_SLAVE)
|
||||
reset_slave();
|
||||
if (reset_master(thd))
|
||||
result=1;
|
||||
#ifdef OPENSSL
|
||||
if (options & REFRESH_DES_KEY_FILE)
|
||||
{
|
||||
if (des_key_file)
|
||||
result=load_des_key_file(des_key_file);
|
||||
}
|
||||
if (options & REFRESH_DES_KEY_FILE)
|
||||
{
|
||||
if (des_key_file)
|
||||
result=load_des_key_file(des_key_file);
|
||||
}
|
||||
#endif
|
||||
if (options & REFRESH_SLAVE)
|
||||
{
|
||||
LOCK_ACTIVE_MI;
|
||||
if (reset_slave(active_mi))
|
||||
result=1;
|
||||
UNLOCK_ACTIVE_MI;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -3271,7 +3293,7 @@ void kill_one_thread(THD *thd, ulong id)
|
||||
if ((thd->master_access & PROCESS_ACL) ||
|
||||
!strcmp(thd->user,tmp->user))
|
||||
{
|
||||
tmp->prepare_to_die();
|
||||
tmp->awake(1 /*prepare to die*/);
|
||||
error=0;
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user