Commit 38d8b788 authored by Sachin's avatar Sachin

Cleanup 2

parent 9fc2c269
......@@ -2191,7 +2191,6 @@ bool MDL_lock::check_if_conflicting_replication_locks(MDL_context *ctx)
if (!rgi_slave->gtid_sub_id)
return 0;
return 0;
while ((conflicting_ticket= it++))
{
if (conflicting_ticket->get_ctx() != ctx)
......
......@@ -1942,7 +1942,7 @@ static void mysqld_exit(int exit_code)
#ifdef SAFEMALLOC
sf_report_leaked_memory(0);
#endif
//DBUG_SLOW_ASSERT(global_status_var.global_memory_used == 0);
DBUG_SLOW_ASSERT(global_status_var.global_memory_used == 0);
}
cleanup_tls();
DBUG_LEAVE;
......@@ -3343,7 +3343,7 @@ SHOW_VAR com_status_vars[]= {
{"check", STMT_STATUS(SQLCOM_CHECK)},
{"checksum", STMT_STATUS(SQLCOM_CHECKSUM)},
{"commit", STMT_STATUS(SQLCOM_COMMIT)},
{"commit_previous", STMT_STATUS(SQLCOM_COMMIT_PREVIOUS)},
{"commit_alter", STMT_STATUS(SQLCOM_COMMIT_ALTER)},
{"compound_sql", STMT_STATUS(SQLCOM_COMPOUND)},
{"create_db", STMT_STATUS(SQLCOM_CREATE_DB)},
{"create_event", STMT_STATUS(SQLCOM_CREATE_EVENT)},
......@@ -3416,7 +3416,7 @@ SHOW_VAR com_status_vars[]= {
{"revoke_role", STMT_STATUS(SQLCOM_REVOKE_ROLE)},
{"rollback", STMT_STATUS(SQLCOM_ROLLBACK)},
{"rollback_to_savepoint",STMT_STATUS(SQLCOM_ROLLBACK_TO_SAVEPOINT)},
{"rollback_previous", STMT_STATUS(SQLCOM_ROLLBACK_PREVIOUS)},
{"rollback_alter", STMT_STATUS(SQLCOM_ROLLBACK_ALTER)},
{"savepoint", STMT_STATUS(SQLCOM_SAVEPOINT)},
{"select", STMT_STATUS(SQLCOM_SELECT)},
{"set_option", STMT_STATUS(SQLCOM_SET_OPTION)},
......
......@@ -85,6 +85,10 @@ Master_info::Master_info(LEX_CSTRING *connection_name_arg,
mysql_mutex_init(key_master_info_data_lock, &data_lock, MY_MUTEX_INIT_FAST);
mysql_mutex_init(key_master_info_start_stop_lock, &start_stop_lock,
MY_MUTEX_INIT_SLOW);
/*
start_alter_lock will protect individual start_alter_info while
start_alter_list_lock is for list insertion and deletion operations
*/
mysql_mutex_init(key_master_info_start_alter_lock, &start_alter_lock,
MY_MUTEX_INIT_FAST);
mysql_mutex_init(key_master_info_start_alter_list_lock, &start_alter_list_lock,
......
......@@ -368,9 +368,10 @@ struct start_alter_info
/*
0 prepared and not error from commit and rollback
>0 error expected in commit/rollback
TODO maybe used later ?
*/
uint error;
//Seq no of Commit/Rollback
//Seq no of Commit/Rollback (thread id)
uint64 seq_no;
enum start_alter_state state;
};
......
......@@ -109,7 +109,7 @@ enum enum_sql_command {
SQLCOM_SHOW_STATUS_PACKAGE_BODY,
SQLCOM_SHOW_PACKAGE_BODY_CODE,
SQLCOM_BACKUP, SQLCOM_BACKUP_LOCK,
SQLCOM_START_ALTER_TABLE, SQLCOM_COMMIT_PREVIOUS, SQLCOM_ROLLBACK_PREVIOUS,
SQLCOM_START_ALTER_TABLE, SQLCOM_COMMIT_ALTER, SQLCOM_ROLLBACK_ALTER,
/*
When a command is added here, be sure it's also added in mysqld.cc
......
......@@ -5704,7 +5704,7 @@ mysql_execute_command(THD *thd)
thd->transaction.start_alter= false;
break;
}
case SQLCOM_COMMIT_PREVIOUS:
case SQLCOM_COMMIT_ALTER:
{
DBUG_ASSERT(thd->rgi_slave);
Master_info *mi= thd->rgi_slave->rli->mi;
......@@ -5803,7 +5803,7 @@ mysql_execute_command(THD *thd)
my_ok(thd);
break;
}
case SQLCOM_ROLLBACK_PREVIOUS:
case SQLCOM_ROLLBACK_ALTER:
{
DBUG_ASSERT(thd->rgi_slave);
Master_info *mi= thd->rgi_slave->rli->mi;
......
......@@ -18002,14 +18002,14 @@ commit:
| COMMIT_SYM alter
{
LEX *lex=Lex;
lex->sql_command= SQLCOM_COMMIT_PREVIOUS;
lex->sql_command= SQLCOM_COMMIT_ALTER;
if (thd->variables.pseudo_thread_id)
lex->previous_commit_id= thd->variables.pseudo_thread_id;
}
| COMMIT_SYM ulonglong_num alter
{
LEX *lex=Lex;
lex->sql_command= SQLCOM_COMMIT_PREVIOUS;
lex->sql_command= SQLCOM_COMMIT_ALTER;
lex->previous_commit_id= $2;
}
;
......@@ -18039,14 +18039,14 @@ rollback:
| ROLLBACK_SYM alter_table
{
LEX *lex=Lex;
lex->sql_command= SQLCOM_ROLLBACK_PREVIOUS;
lex->sql_command= SQLCOM_ROLLBACK_ALTER;
if (thd->variables.pseudo_thread_id)
lex->previous_commit_id= thd->variables.pseudo_thread_id;
}
| ROLLBACK_SYM ulonglong_num alter_table
{
LEX *lex=Lex;
lex->sql_command= SQLCOM_ROLLBACK_PREVIOUS;
lex->sql_command= SQLCOM_ROLLBACK_ALTER;
lex->previous_commit_id= $2;
}
;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment