211
211
Table *table= tables->table;
213
if (plugin_foreach_with_mask(session, show_plugins, DRIZZLE_ANY_PLUGIN,
214
~PLUGIN_IS_FREED, table))
213
if (plugin_foreach(session, show_plugins, DRIZZLE_ANY_PLUGIN,
214
table, ~PLUGIN_IS_FREED))
1021
1021
template class I_List<thread_info>;
1024
void mysqld_list_processes(Session *session,const char *user, bool verbose)
1024
void mysqld_list_processes(Session *session,const char *user, bool)
1027
1027
List<Item> field_list;
1028
1028
I_List<thread_info> thread_infos;
1029
ulong max_query_length= (verbose ? session->variables.max_allowed_packet :
1030
PROCESS_LIST_WIDTH);
1031
1029
Protocol *protocol= session->protocol;
1033
1031
field_list.push_back(new Item_int("Id", 0, MY_INT32_NUM_DECIMAL_DIGITS));
1034
1032
field_list.push_back(new Item_empty_string("User",16));
1035
1033
field_list.push_back(new Item_empty_string("Host",LIST_PROCESS_HOST_LEN));
1036
1034
field_list.push_back(field=new Item_empty_string("db",NAME_CHAR_LEN));
1037
field->maybe_null=1;
1035
field->maybe_null= true;
1038
1036
field_list.push_back(new Item_empty_string("Command",16));
1039
1037
field_list.push_back(new Item_return_int("Time",7, DRIZZLE_TYPE_LONG));
1040
1038
field_list.push_back(field=new Item_empty_string("State",30));
1041
field->maybe_null=1;
1042
field_list.push_back(field=new Item_empty_string("Info",max_query_length));
1043
field->maybe_null=1;
1039
field->maybe_null= true;
1040
field_list.push_back(field=new Item_empty_string("Info", PROCESS_LIST_WIDTH));
1041
field->maybe_null= true;
1044
1042
if (protocol->send_fields(&field_list,
1045
1043
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
1085
1083
session_info->query=0;
1086
1084
if (tmp->query)
1089
1087
query_length is always set to 0 when we set query = NULL; see
1090
1088
the comment in session.h why this prevents crashes in possible
1091
1089
races with query_length
1093
uint32_t length= cmin((uint32_t)max_query_length, tmp->query_length);
1094
session_info->query=(char*) session->strmake(tmp->query,length);
1091
session_info->query=(char*) session->strdup(tmp->process_list_info);
1096
1093
thread_infos.append(session_info);
1471
1468
value= ((char *) status_var + (ulong) value);
1472
1469
/* fall through */
1473
1470
case SHOW_LONG:
1474
case SHOW_LONG_NOFLUSH: // the difference lies in refresh_status()
1475
1471
end= int10_to_str(*(long*) value, buff, 10);
1477
1473
case SHOW_LONGLONG_STATUS:
1500
1496
end+= sprintf(buff,"%s", *(bool*) value ? "ON" : "OFF");
1499
case SHOW_INT_NOFLUSH: // the difference lies in refresh_status()
1503
1500
end= int10_to_str((long) *(uint32_t*) value, buff, 10);
1505
1502
case SHOW_HAVE:
1564
1561
/* Ensure that thread id not killed during loop */
1565
1562
pthread_mutex_lock(&LOCK_thread_count); // For unlink from list
1567
I_List_iterator<Session> it(threads);
1564
I_List_iterator<Session> it(session_list);
1570
1567
/* Get global values as base */