~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/session.h

  • 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:
35
35
#include <drizzled/handler.h>
36
36
#include <drizzled/current_session.h>
37
37
#include <drizzled/sql_error.h>
 
38
#include <string>
38
39
#include <bitset>
39
40
 
40
41
class Relay_log_info;
497
498
  @brief A set of Session members describing the current authenticated user.
498
499
*/
499
500
 
 
501
using namespace std;
500
502
class Security_context {
501
503
public:
502
 
  Security_context() {}                       /* Remove gcc warning */
 
504
  Security_context() {}
503
505
  /*
504
506
    host - host of the client
505
507
    user - user of the client, set to NULL until the user has been read from
507
509
    priv_user - The user privilege we are using. May be "" for anonymous user.
508
510
    ip - client IP
509
511
  */
510
 
  char *user;
511
 
  char *ip;
 
512
  string user;
 
513
  string ip;
512
514
 
513
 
  void init();
514
 
  void destroy();
515
515
  void skip_grants();
516
 
  inline char *priv_host_name()
 
516
  inline const char *priv_host_name()
517
517
  {
518
 
    return (ip ? ip : (char *)"%");
 
518
    return (ip.c_str() ? ip.c_str() : (char *)"%");
519
519
  }
520
520
};
521
521
 
880
880
    @see handle_slave_sql
881
881
  */
882
882
 
883
 
  Security_context main_security_ctx;
884
 
  Security_context *security_ctx;
 
883
  Security_context security_ctx;
885
884
 
886
885
  /*
887
886
    Points to info-string that we show in SHOW PROCESSLIST
1313
1312
    alloc_root.
1314
1313
  */
1315
1314
  void init_for_queries();
1316
 
  void change_user(void);
1317
1315
  void cleanup(void);
1318
1316
  void cleanup_after_query();
1319
1317
  bool store_globals();
2238
2236
void add_diff_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var,
2239
2237
                        STATUS_VAR *dec_var);
2240
2238
 
2241
 
void close_connection(Session *session, uint32_t errcode, bool lock);
2242
 
 
2243
2239
/* Some inline functions for more speed */
2244
2240
 
2245
2241
inline bool add_item_to_list(Session *session, Item *item)