~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/show.cc

Merged trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1158
1158
    Session *tmp;
1159
1159
    while ((tmp=it++))
1160
1160
    {
1161
 
      Security_context *tmp_sctx= tmp->security_ctx;
 
1161
      Security_context *tmp_sctx= &tmp->security_ctx;
1162
1162
      struct st_my_thread_var *mysys_var;
1163
 
      if ((tmp->vio_ok() || tmp->system_thread) && (!user || (tmp_sctx->user && !strcmp(tmp_sctx->user, user))))
 
1163
      if ((tmp->vio_ok() || tmp->system_thread) && (!user || (tmp_sctx->user.c_str() && !strcmp(tmp_sctx->user.c_str(), user))))
1164
1164
      {
1165
1165
        thread_info *session_info= new thread_info;
1166
1166
 
1167
1167
        session_info->thread_id=tmp->thread_id;
1168
 
        session_info->user= session->strdup(tmp_sctx->user ? tmp_sctx->user :
 
1168
        session_info->user= session->strdup(tmp_sctx->user.c_str() ? tmp_sctx->user.c_str() :
1169
1169
                                    (tmp->system_thread ?
1170
1170
                                     "system user" : "unauthenticated user"));
1171
 
        session_info->host= session->strdup(tmp_sctx->ip);
 
1171
        session_info->host= session->strdup(tmp_sctx->ip.c_str());
1172
1172
        if ((session_info->db=tmp->db))             // Safe test
1173
1173
          session_info->db=session->strdup(session_info->db);
1174
1174
        session_info->command=(int) tmp->command;
1249
1249
 
1250
1250
    while ((tmp= it++))
1251
1251
    {
1252
 
      Security_context *tmp_sctx= tmp->security_ctx;
 
1252
      Security_context *tmp_sctx= &tmp->security_ctx;
1253
1253
      struct st_my_thread_var *mysys_var;
1254
1254
      const char *val;
1255
1255
 
1260
1260
      /* ID */
1261
1261
      table->field[0]->store((int64_t) tmp->thread_id, true);
1262
1262
      /* USER */
1263
 
      val= tmp_sctx->user ? tmp_sctx->user :
 
1263
      val= tmp_sctx->user.c_str() ? tmp_sctx->user.c_str() :
1264
1264
            (tmp->system_thread ? "system user" : "unauthenticated user");
1265
1265
      table->field[1]->store(val, strlen(val), cs);
1266
1266
      /* HOST */
1267
 
      table->field[2]->store(tmp_sctx->ip, strlen(tmp_sctx->ip), cs);
 
1267
      table->field[2]->store(tmp_sctx->ip.c_str(), strlen(tmp_sctx->ip.c_str()), cs);
1268
1268
      /* DB */
1269
1269
      if (tmp->db)
1270
1270
      {