~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/session.cc

  • Committer: Brian Aker
  • Date: 2008-12-16 06:33:48 UTC
  • Revision ID: brian@tangent.org-20081216063348-fe9j7ys729o9eb32
Refactor out char* strdup for string class in user.

Show diffs side-by-side

added added

removed removed

Lines of Context:
499
499
  init_sql_alloc(&main_mem_root, ALLOC_ROOT_MIN_BLOCK_SIZE, 0);
500
500
  thread_stack= 0;
501
501
  catalog= (char*)"std"; // the only catalog we have for now
502
 
  main_security_ctx.init();
503
 
  security_ctx= &main_security_ctx;
504
502
  some_tables_deleted=no_errors=password= 0;
505
503
  query_start_used= 0;
506
504
  count_cuted_fields= CHECK_FIELD_IGNORE;
768
766
  ha_close_connection(this);
769
767
  plugin_sessionvar_cleanup(this);
770
768
 
771
 
  main_security_ctx.destroy();
772
769
  if (db)
773
770
  {
774
771
    free(db);
2176
2173
  memset(&status_var, 0, sizeof(status_var));
2177
2174
}
2178
2175
 
2179
 
 
2180
 
void Security_context::init()
2181
 
{
2182
 
  user= ip= 0;
2183
 
}
2184
 
 
2185
 
 
2186
 
void Security_context::destroy()
2187
 
{
2188
 
  // If not pointer to constant
2189
 
  if (user)
2190
 
  {
2191
 
    free(user);
2192
 
    user= NULL;
2193
 
  }
2194
 
  if (ip)
2195
 
  {
2196
 
    free(ip);
2197
 
    ip= NULL;
2198
 
  }
2199
 
}
2200
 
 
2201
 
 
2202
2176
void Security_context::skip_grants()
2203
2177
{
2204
2178
  /* privileges for the user are unknown everything is allowed */