~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/show.cc

  • Committer: Eric Day
  • Date: 2009-03-24 04:59:05 UTC
  • mfrom: (962 drizzle)
  • mto: (968.1.1 lib-merge)
  • mto: This revision was merged to the branch mainline in revision 969.
  • Revision ID: eday@oddments.org-20090324045905-2ptqhz3ves0aa5ed
Merged trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
210
210
{
211
211
  Table *table= tables->table;
212
212
 
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))
215
215
    return(1);
216
216
 
217
217
  return(0);
1021
1021
template class I_List<thread_info>;
1022
1022
#endif
1023
1023
 
1024
 
void mysqld_list_processes(Session *session,const char *user, bool verbose)
 
1024
void mysqld_list_processes(Session *session,const char *user, bool)
1025
1025
{
1026
1026
  Item *field;
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;
1032
1030
 
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))
1046
1044
    return;
1048
1046
  pthread_mutex_lock(&LOCK_thread_count); // For unlink from list
1049
1047
  if (!session->killed)
1050
1048
  {
1051
 
    I_List_iterator<Session> it(threads);
 
1049
    I_List_iterator<Session> it(session_list);
1052
1050
    Session *tmp;
1053
1051
    while ((tmp=it++))
1054
1052
    {
1085
1083
        session_info->query=0;
1086
1084
        if (tmp->query)
1087
1085
        {
1088
 
          /*
 
1086
          /*
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
1092
1090
          */
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);
1095
1092
        }
1096
1093
        thread_infos.append(session_info);
1097
1094
      }
1141
1138
 
1142
1139
  if (!session->killed)
1143
1140
  {
1144
 
    I_List_iterator<Session> it(threads);
 
1141
    I_List_iterator<Session> it(session_list);
1145
1142
    Session* tmp;
1146
1143
 
1147
1144
    while ((tmp= it++))
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);
1476
1472
          break;
1477
1473
        case SHOW_LONGLONG_STATUS:
1500
1496
          end+= sprintf(buff,"%s", *(bool*) value ? "ON" : "OFF");
1501
1497
          break;
1502
1498
        case SHOW_INT:
 
1499
        case SHOW_INT_NOFLUSH: // the difference lies in refresh_status()
1503
1500
          end= int10_to_str((long) *(uint32_t*) value, buff, 10);
1504
1501
          break;
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
1566
1563
 
1567
 
  I_List_iterator<Session> it(threads);
 
1564
  I_List_iterator<Session> it(session_list);
1568
1565
  Session *tmp;
1569
1566
 
1570
1567
  /* Get global values as base */