mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge with mariadb 5.5: bzr merge lp:maria/5.5 --rtag:mariadb-5.5.32
This commit is contained in:
@ -2215,10 +2215,10 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
|
||||
thd_info->host= thd->strdup(tmp_sctx->host_or_ip[0] ?
|
||||
tmp_sctx->host_or_ip :
|
||||
tmp_sctx->host ? tmp_sctx->host : "");
|
||||
if ((thd_info->db=tmp->db)) // Safe test
|
||||
thd_info->db=thd->strdup(thd_info->db);
|
||||
thd_info->command=(int) tmp->command;
|
||||
mysql_mutex_lock(&tmp->LOCK_thd_data);
|
||||
if ((thd_info->db= tmp->db)) // Safe test
|
||||
thd_info->db= thd->strdup(thd_info->db);
|
||||
if ((mysys_var= tmp->mysys_var))
|
||||
mysql_mutex_lock(&mysys_var->mutex);
|
||||
thd_info->proc_info= (char*) (tmp->killed >= KILL_QUERY ?
|
||||
@ -2300,6 +2300,8 @@ int fill_schema_processlist(THD* thd, TABLE_LIST* tables, COND* cond)
|
||||
my_hrtime_t unow= my_hrtime();
|
||||
DBUG_ENTER("fill_schema_processlist");
|
||||
|
||||
DEBUG_SYNC(thd,"fill_schema_processlist_after_unow");
|
||||
|
||||
user= thd->security_ctx->master_access & PROCESS_ACL ?
|
||||
NullS : thd->security_ctx->priv_user;
|
||||
|
||||
@ -2358,9 +2360,8 @@ int fill_schema_processlist(THD* thd, TABLE_LIST* tables, COND* cond)
|
||||
table->field[4]->store(command_name[tmp->command].str,
|
||||
command_name[tmp->command].length, cs);
|
||||
/* MYSQL_TIME */
|
||||
const ulonglong utime= (tmp->start_time ?
|
||||
(unow.val - tmp->start_time * HRTIME_RESOLUTION -
|
||||
tmp->start_time_sec_part) : 0);
|
||||
ulonglong start_utime= tmp->start_time * HRTIME_RESOLUTION + tmp->start_time_sec_part;
|
||||
ulonglong utime= start_utime < unow.val ? unow.val - start_utime : 0;
|
||||
table->field[5]->store(utime / HRTIME_RESOLUTION, TRUE);
|
||||
/* STATE */
|
||||
if ((val= thread_state_info(tmp)))
|
||||
@ -2549,12 +2550,11 @@ void remove_status_vars(SHOW_VAR *list)
|
||||
{
|
||||
mysql_mutex_lock(&LOCK_status);
|
||||
SHOW_VAR *all= dynamic_element(&all_status_vars, 0, SHOW_VAR *);
|
||||
int a= 0, b= all_status_vars.elements, c= (a+b)/2;
|
||||
|
||||
for (; list->name; list++)
|
||||
{
|
||||
int res= 0;
|
||||
for (a= 0, b= all_status_vars.elements; b-a > 1; c= (a+b)/2)
|
||||
int res= 0, a= 0, b= all_status_vars.elements, c= (a+b)/2;
|
||||
for (; b-a > 0; c= (a+b)/2)
|
||||
{
|
||||
res= show_var_cmp(list, all+c);
|
||||
if (res < 0)
|
||||
@ -2727,6 +2727,14 @@ static bool show_status_array(THD *thd, const char *wild,
|
||||
{
|
||||
if (!(pos= *(char**) value))
|
||||
pos= "";
|
||||
|
||||
DBUG_EXECUTE_IF("alter_server_version_str",
|
||||
if (!my_strcasecmp(system_charset_info,
|
||||
variables->name,
|
||||
"version")) {
|
||||
pos= "some-other-version";
|
||||
});
|
||||
|
||||
end= strend(pos);
|
||||
break;
|
||||
}
|
||||
@ -3136,7 +3144,7 @@ bool schema_table_store_record(THD *thd, TABLE *table)
|
||||
{
|
||||
TMP_TABLE_PARAM *param= table->pos_in_table_list->schema_table_param;
|
||||
if (create_internal_tmp_table_from_heap(thd, table, param->start_recinfo,
|
||||
¶m->recinfo, error, 0))
|
||||
¶m->recinfo, error, 0, NULL))
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -5377,7 +5385,7 @@ bool store_schema_params(THD *thd, TABLE *table, TABLE *proc_table,
|
||||
CHARSET_INFO *cs= system_charset_info;
|
||||
char params_buff[MAX_FIELD_WIDTH], returns_buff[MAX_FIELD_WIDTH],
|
||||
sp_db_buff[NAME_LEN], sp_name_buff[NAME_LEN], path[FN_REFLEN],
|
||||
definer_buff[USERNAME_LENGTH + HOSTNAME_LENGTH + 1];
|
||||
definer_buff[DEFINER_LENGTH + 1];
|
||||
String params(params_buff, sizeof(params_buff), cs);
|
||||
String returns(returns_buff, sizeof(returns_buff), cs);
|
||||
String sp_db(sp_db_buff, sizeof(sp_db_buff), cs);
|
||||
@ -5521,7 +5529,7 @@ bool store_schema_proc(THD *thd, TABLE *table, TABLE *proc_table,
|
||||
LEX *lex= thd->lex;
|
||||
CHARSET_INFO *cs= system_charset_info;
|
||||
char sp_db_buff[SAFE_NAME_LEN + 1], sp_name_buff[NAME_LEN + 1],
|
||||
definer_buff[USERNAME_LENGTH + HOSTNAME_LENGTH + 2],
|
||||
definer_buff[DEFINER_LENGTH + 1],
|
||||
returns_buff[MAX_FIELD_WIDTH];
|
||||
|
||||
String sp_db(sp_db_buff, sizeof(sp_db_buff), cs);
|
||||
@ -8084,7 +8092,7 @@ ST_FIELD_INFO events_fields_info[]=
|
||||
SKIP_OPEN_TABLE},
|
||||
{"EVENT_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Name",
|
||||
SKIP_OPEN_TABLE},
|
||||
{"DEFINER", 77, MYSQL_TYPE_STRING, 0, 0, "Definer", SKIP_OPEN_TABLE},
|
||||
{"DEFINER", DEFINER_CHAR_LENGTH, MYSQL_TYPE_STRING, 0, 0, "Definer", SKIP_OPEN_TABLE},
|
||||
{"TIME_ZONE", 64, MYSQL_TYPE_STRING, 0, 0, "Time zone", SKIP_OPEN_TABLE},
|
||||
{"EVENT_BODY", 8, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
|
||||
{"EVENT_DEFINITION", 65535, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
|
||||
@ -8161,7 +8169,7 @@ ST_FIELD_INFO proc_fields_info[]=
|
||||
{"SQL_MODE", 32*256, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
|
||||
{"ROUTINE_COMMENT", 65535, MYSQL_TYPE_STRING, 0, 0, "Comment",
|
||||
SKIP_OPEN_TABLE},
|
||||
{"DEFINER", 77, MYSQL_TYPE_STRING, 0, 0, "Definer", SKIP_OPEN_TABLE},
|
||||
{"DEFINER", DEFINER_CHAR_LENGTH, MYSQL_TYPE_STRING, 0, 0, "Definer", SKIP_OPEN_TABLE},
|
||||
{"CHARACTER_SET_CLIENT", MY_CS_NAME_SIZE, MYSQL_TYPE_STRING, 0, 0,
|
||||
"character_set_client", SKIP_OPEN_TABLE},
|
||||
{"COLLATION_CONNECTION", MY_CS_NAME_SIZE, MYSQL_TYPE_STRING, 0, 0,
|
||||
@ -8206,7 +8214,7 @@ ST_FIELD_INFO view_fields_info[]=
|
||||
{"VIEW_DEFINITION", 65535, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FRM_ONLY},
|
||||
{"CHECK_OPTION", 8, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FRM_ONLY},
|
||||
{"IS_UPDATABLE", 3, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE},
|
||||
{"DEFINER", 77, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FRM_ONLY},
|
||||
{"DEFINER", DEFINER_CHAR_LENGTH, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FRM_ONLY},
|
||||
{"SECURITY_TYPE", 7, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FRM_ONLY},
|
||||
{"CHARACTER_SET_CLIENT", MY_CS_NAME_SIZE, MYSQL_TYPE_STRING, 0, 0, 0,
|
||||
OPEN_FRM_ONLY},
|
||||
@ -8351,7 +8359,7 @@ ST_FIELD_INFO triggers_fields_info[]=
|
||||
{"ACTION_REFERENCE_NEW_ROW", 3, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FRM_ONLY},
|
||||
{"CREATED", 0, MYSQL_TYPE_DATETIME, 0, 1, "Created", OPEN_FRM_ONLY},
|
||||
{"SQL_MODE", 32*256, MYSQL_TYPE_STRING, 0, 0, "sql_mode", OPEN_FRM_ONLY},
|
||||
{"DEFINER", 77, MYSQL_TYPE_STRING, 0, 0, "Definer", OPEN_FRM_ONLY},
|
||||
{"DEFINER", DEFINER_CHAR_LENGTH, MYSQL_TYPE_STRING, 0, 0, "Definer", OPEN_FRM_ONLY},
|
||||
{"CHARACTER_SET_CLIENT", MY_CS_NAME_SIZE, MYSQL_TYPE_STRING, 0, 0,
|
||||
"character_set_client", OPEN_FRM_ONLY},
|
||||
{"COLLATION_CONNECTION", MY_CS_NAME_SIZE, MYSQL_TYPE_STRING, 0, 0,
|
||||
|
Reference in New Issue
Block a user