~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/show.cc

Merge in security refactor.

Show diffs side-by-side

added added

removed removed

Lines of Context:
708
708
  uint64_t thread_id;
709
709
  time_t start_time;
710
710
  uint32_t   command;
711
 
  string user, host, db, proc_info, state_info, query;
 
711
  string user;
 
712
  string host;
 
713
  string db;
 
714
  string proc_info;
 
715
  string state_info;
 
716
  string query;
712
717
  thread_info(uint64_t thread_id_arg,
713
718
              time_t start_time_arg,
714
719
              uint32_t command_arg,
724
729
  {}
725
730
};
726
731
 
727
 
void mysqld_list_processes(Session *session,const char *user, bool)
 
732
void mysqld_list_processes(Session *session, const char *user, bool)
728
733
{
729
734
  Item *field;
730
735
  List<Item> field_list;
751
756
    for(vector<Session*>::iterator it= getSessionList().begin(); it != getSessionList().end(); ++it)
752
757
    {
753
758
      tmp= *it;
754
 
      Security_context *tmp_sctx= &tmp->security_ctx;
 
759
      const SecurityContext *tmp_sctx= &tmp->getSecurityContext();
755
760
      internal::st_my_thread_var *mysys_var;
756
 
      if (tmp->client->isConnected() && (!user || (tmp_sctx->user.c_str() && !strcmp(tmp_sctx->user.c_str(), user))))
 
761
      if (tmp->client->isConnected() && (not user || (not tmp_sctx->getUser().compare(user))))
757
762
      {
758
763
 
759
764
        if ((mysys_var= tmp->mysys_var))
779
784
        thread_infos.push_back(thread_info(tmp->thread_id,
780
785
                                           tmp->start_time,
781
786
                                           tmp->command,
782
 
                                           tmp_sctx->user.empty()
 
787
                                           tmp_sctx->getUser().empty()
783
788
                                             ? string("unauthenticated user")
784
 
                                             : tmp_sctx->user,
785
 
                                           tmp_sctx->ip,
 
789
                                             : tmp_sctx->getUser(),
 
790
                                           tmp_sctx->getIp(),
786
791
                                           tmp->db,
787
792
                                           tmp_proc_info,
788
793
                                           tmp_state_info,