~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/show.cc

  • Committer: Brian Aker
  • Date: 2009-03-23 19:29:45 UTC
  • mfrom: (961.1.5 drizzle)
  • Revision ID: brian@tangent.org-20090323192945-zgn78aau5lapv33a
Tags: 2009.03.962
Merge in Brian's work on processlist locks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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;
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
      }