Commit d60a0ce9 authored by Davi Arnaut's avatar Davi Arnaut

Backport a old cleanup patch.

Formatting cleanup: removing tabs and trailing spaces
to conform to MySQL Internals Coding Guidelines.
parent 80fc19ad
...@@ -3352,6 +3352,7 @@ START SLAVE; . Query: '%s'", expected_error, thd->query()); ...@@ -3352,6 +3352,7 @@ START SLAVE; . Query: '%s'", expected_error, thd->query());
actual_error= thd->is_error() ? thd->stmt_da->sql_errno() : 0; actual_error= thd->is_error() ? thd->stmt_da->sql_errno() : 0;
DBUG_PRINT("info",("expected_error: %d sql_errno: %d", DBUG_PRINT("info",("expected_error: %d sql_errno: %d",
expected_error, actual_error)); expected_error, actual_error));
if ((expected_error && expected_error != actual_error && if ((expected_error && expected_error != actual_error &&
!concurrency_error_code(expected_error)) && !concurrency_error_code(expected_error)) &&
!ignored_error_code(actual_error) && !ignored_error_code(actual_error) &&
...@@ -3435,7 +3436,8 @@ Default database: '%s'. Query: '%s'", ...@@ -3435,7 +3436,8 @@ Default database: '%s'. Query: '%s'",
*/ */
} /* End of if (db_ok(... */ } /* End of if (db_ok(... */
{/** {
/**
The following failure injecion works in cooperation with tests The following failure injecion works in cooperation with tests
setting @@global.debug= 'd,stop_slave_middle_group'. setting @@global.debug= 'd,stop_slave_middle_group'.
The sql thread receives the killed status and will proceed The sql thread receives the killed status and will proceed
...@@ -4793,9 +4795,7 @@ int Load_log_event::do_apply_event(NET* net, Relay_log_info const *rli, ...@@ -4793,9 +4795,7 @@ int Load_log_event::do_apply_event(NET* net, Relay_log_info const *rli,
thd->set_query(load_data_query, (uint) (end - load_data_query)); thd->set_query(load_data_query, (uint) (end - load_data_query));
if (sql_ex.opt_flags & REPLACE_FLAG) if (sql_ex.opt_flags & REPLACE_FLAG)
{
handle_dup= DUP_REPLACE; handle_dup= DUP_REPLACE;
}
else if (sql_ex.opt_flags & IGNORE_FLAG) else if (sql_ex.opt_flags & IGNORE_FLAG)
{ {
ignore= 1; ignore= 1;
...@@ -4854,9 +4854,7 @@ int Load_log_event::do_apply_event(NET* net, Relay_log_info const *rli, ...@@ -4854,9 +4854,7 @@ int Load_log_event::do_apply_event(NET* net, Relay_log_info const *rli,
{ {
// mysql_load will use thd->net to read the file // mysql_load will use thd->net to read the file
thd->net.vio = net->vio; thd->net.vio = net->vio;
/* // Make sure the client does not get confused about the packet sequence
Make sure the client does not get confused about the packet sequence
*/
thd->net.pkt_nr = net->pkt_nr; thd->net.pkt_nr = net->pkt_nr;
} }
/* /*
......
...@@ -1024,16 +1024,14 @@ subst_spvars(THD *thd, sp_instr *instr, LEX_STRING *query_str) ...@@ -1024,16 +1024,14 @@ subst_spvars(THD *thd, sp_instr *instr, LEX_STRING *query_str)
} }
/* /**
Return appropriate error about recursion limit reaching Return appropriate error about recursion limit reaching
SYNOPSIS @param thd Thread handle
sp_head::recursion_level_error()
thd Thread handle
NOTE @remark For functions and triggers we return error about
For functions and triggers we return error about prohibited recursion. prohibited recursion. For stored procedures we
For stored procedures we return about reaching recursion limit. return about reaching recursion limit.
*/ */
void sp_head::recursion_level_error(THD *thd) void sp_head::recursion_level_error(THD *thd)
...@@ -1217,7 +1215,7 @@ sp_head::execute(THD *thd) ...@@ -1217,7 +1215,7 @@ sp_head::execute(THD *thd)
do do
{ {
sp_instr *i; sp_instr *i;
uint hip; // Handler ip uint hip;
#if defined(ENABLED_PROFILING) #if defined(ENABLED_PROFILING)
/* /*
...@@ -1229,7 +1227,8 @@ sp_head::execute(THD *thd) ...@@ -1229,7 +1227,8 @@ sp_head::execute(THD *thd)
thd->profiling.start_new_query("continuing inside routine"); thd->profiling.start_new_query("continuing inside routine");
#endif #endif
i = get_instr(ip); // Returns NULL when we're done. /* get_instr returns NULL when we're done. */
i = get_instr(ip);
if (i == NULL) if (i == NULL)
{ {
#if defined(ENABLED_PROFILING) #if defined(ENABLED_PROFILING)
...@@ -1240,9 +1239,12 @@ sp_head::execute(THD *thd) ...@@ -1240,9 +1239,12 @@ sp_head::execute(THD *thd)
DBUG_PRINT("execute", ("Instruction %u", ip)); DBUG_PRINT("execute", ("Instruction %u", ip));
/* Don't change NOW() in FUNCTION or TRIGGER */ /*
Make current_time() et al work. But don't change NOW() in FUNCTION
or TRIGGER.
*/
if (!thd->in_sub_stmt) if (!thd->in_sub_stmt)
thd->set_time(); // Make current_time() et al work thd->set_time();
/* /*
We have to set thd->stmt_arena before executing the instruction We have to set thd->stmt_arena before executing the instruction
...@@ -1253,8 +1255,8 @@ sp_head::execute(THD *thd) ...@@ -1253,8 +1255,8 @@ sp_head::execute(THD *thd)
thd->stmt_arena= i; thd->stmt_arena= i;
/* /*
Will write this SP statement into binlog separately Will write this SP statement into binlog separately.
(TODO: consider changing the condition to "not inside event union") TODO: consider changing the condition to "not inside event union".
*/ */
if (thd->locked_tables_mode <= LTM_LOCK_TABLES) if (thd->locked_tables_mode <= LTM_LOCK_TABLES)
thd->user_var_events_alloc= thd->mem_root; thd->user_var_events_alloc= thd->mem_root;
...@@ -1880,9 +1882,9 @@ sp_head::execute_procedure(THD *thd, List<Item> *args) ...@@ -1880,9 +1882,9 @@ sp_head::execute_procedure(THD *thd, List<Item> *args)
save_spcont= octx= thd->spcont; save_spcont= octx= thd->spcont;
if (! octx) if (! octx)
{ // Create a temporary old context {
if (!(octx= new sp_rcontext(m_pcont, NULL, octx)) || /* Create a temporary old context. */
octx->init(thd)) if (!(octx= new sp_rcontext(m_pcont, NULL, octx)) || octx->init(thd))
{ {
delete octx; /* Delete octx if it was init() that failed. */ delete octx; /* Delete octx if it was init() that failed. */
DBUG_RETURN(TRUE); DBUG_RETURN(TRUE);
...@@ -2509,8 +2511,6 @@ sp_head::show_create_routine(THD *thd, int type) ...@@ -2509,8 +2511,6 @@ sp_head::show_create_routine(THD *thd, int type)
} }
/** /**
Add instruction to SP. Add instruction to SP.
...@@ -2894,8 +2894,7 @@ sp_instr_stmt::execute(THD *thd, uint *nextp) ...@@ -2894,8 +2894,7 @@ sp_instr_stmt::execute(THD *thd, uint *nextp)
if (unlikely((thd->variables.option_bits & OPTION_LOG_OFF)==0)) if (unlikely((thd->variables.option_bits & OPTION_LOG_OFF)==0))
general_log_write(thd, COM_QUERY, thd->query(), thd->query_length()); general_log_write(thd, COM_QUERY, thd->query(), thd->query_length());
if (query_cache_send_result_to_client(thd, if (query_cache_send_result_to_client(thd, thd->query(),
thd->query(),
thd->query_length()) <= 0) thd->query_length()) <= 0)
{ {
res= m_lex_keeper.reset_lex_and_exec_core(thd, nextp, FALSE, this); res= m_lex_keeper.reset_lex_and_exec_core(thd, nextp, FALSE, this);
......
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