1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Merge 5.1-bugteam -> 5.1-bug-42496

This commit is contained in:
Dmitry Shulga
2010-07-23 18:15:56 +07:00
299 changed files with 9856 additions and 2453 deletions

View File

@ -736,6 +736,9 @@ THD::THD()
thr_lock_owner_init(&main_lock_id, &lock_info);
m_internal_handler= NULL;
current_user_used= FALSE;
memset(&invoker_user, 0, sizeof(invoker_user));
memset(&invoker_host, 0, sizeof(invoker_host));
}
@ -1060,6 +1063,9 @@ void add_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var)
while (to != end)
*(to++)+= *(from++);
to_var->bytes_received+= from_var->bytes_received;
to_var->bytes_sent+= from_var->bytes_sent;
}
/*
@ -1085,6 +1091,9 @@ void add_diff_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var,
while (to != end)
*(to++)+= *(from++) - *(dec++);
to_var->bytes_received+= from_var->bytes_received - dec_var->bytes_received;;
to_var->bytes_sent+= from_var->bytes_sent - dec_var->bytes_sent;
}
@ -1236,6 +1245,7 @@ void THD::cleanup_after_query()
where= THD::DEFAULT_WHERE;
/* reset table map for multi-table update */
table_map_for_update= 0;
clean_current_user_used();
}
@ -3267,6 +3277,22 @@ void THD::set_query(char *query_arg, uint32 query_length_arg)
pthread_mutex_unlock(&LOCK_thd_data);
}
void THD::get_definer(LEX_USER *definer)
{
set_current_user_used();
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
if (slave_thread && has_invoker())
{
definer->user = invoker_user;
definer->host= invoker_host;
definer->password.str= NULL;
definer->password.length= 0;
}
else
#endif
get_default_definer(this, definer);
}
/**
Mark transaction to rollback and mark error as fatal to a sub-statement.