1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

- Renaming variables so that they don't shadow others (After this patch one can compile with -Wshadow and get much fewer warnings)

- Changed ER(ER_...) to ER_THD(thd, ER_...) when thd was known or if there was many calls to current_thd in the same function.
- Changed ER(ER_..) to ER_THD_OR_DEFAULT(current_thd, ER...) in some places where current_thd is not necessary defined.
- Removing calls to current_thd when we have access to thd

Part of this is optimization (not calling current_thd when not needed),
but part is bug fixing for error condition when current_thd is not defined
(For example on startup and end of mysqld)

Notable renames done as otherwise a lot of functions would have to be changed:
- In JOIN structure renamed:
   examined_rows -> join_examined_rows
   record_count -> join_record_count
- In Field, renamed new_field() to make_new_field()

Other things:
- Added DBUG_ASSERT(thd == tmp_thd) in Item_singlerow_subselect() just to be safe.
- Removed old 'tab' prefix in JOIN_TAB::save_explain_data() and use members directly
- Added 'thd' as argument to a few functions to avoid calling current_thd.
This commit is contained in:
Monty
2015-07-06 20:24:14 +03:00
parent 8d4d185a08
commit 7332af49e4
107 changed files with 1562 additions and 1290 deletions

View File

@@ -1786,7 +1786,7 @@ struct wait_for_commit
return wakeup_error;
}
}
void wakeup_subsequent_commits(int wakeup_error)
void wakeup_subsequent_commits(int wakeup_error_arg)
{
/*
Do the check inline, so only the wakeup case takes the cost of a function
@@ -1801,7 +1801,7 @@ struct wait_for_commit
prevent a waiter from arriving just after releasing the lock.
*/
if (subsequent_commits_list)
wakeup_subsequent_commits2(wakeup_error);
wakeup_subsequent_commits2(wakeup_error_arg);
}
void unregister_wait_for_prior_commit()
{
@@ -3377,7 +3377,7 @@ public:
{
int err= killed_errno();
if (err)
my_message(err, ER(err), MYF(0));
my_message(err, ER_THD(this, err), MYF(0));
}
/* return TRUE if we will abort query if we make a warning now */
inline bool really_abort_on_warning()
@@ -4617,9 +4617,10 @@ private:
public:
/* Number of rows in the union */
ha_rows send_records;
select_union_direct(THD *thd_arg, select_result *result,
SELECT_LEX *last_select_lex):
select_union(thd_arg), result(result), last_select_lex(last_select_lex),
select_union_direct(THD *thd_arg, select_result *result_arg,
SELECT_LEX *last_select_lex_arg):
select_union(thd_arg), result(result_arg),
last_select_lex(last_select_lex_arg),
done_send_result_set_metadata(false), done_initialize_tables(false),
limit_found_rows(0)
{ send_records= 0; }