~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/utility_functions/user.cc

  • Committer: Brian Aker
  • Date: 2011-02-14 05:47:07 UTC
  • mto: This revision was merged to the branch mainline in revision 2167.
  • Revision ID: brian@tangent.org-20110214054707-61nsqgg1g4w1zhx1
Merge in all changes for current_session, etc.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems
 
4
 *  Copyright (C) 2008 Sun Microsystems, Inc.
5
5
 *  Copyright (C) 2010 Stewart Smith
6
6
 *
7
7
 *  This program is free software; you can redistribute it and/or modify
33
33
String *User::val_str(String *str)
34
34
{
35
35
  assert(fixed == 1);
36
 
  Session *session= current_session;
37
 
  if (session->getSecurityContext().getUser().empty())
 
36
  identifier::User::const_shared_ptr user= getSession().user();
 
37
  assert(user);
 
38
  if (user->username().empty())
38
39
  {
39
40
    null_value= 1;
40
41
    return 0;
41
42
  }
42
43
  else
43
44
  {
44
 
    str->copy(session->getSecurityContext().getUser().c_str(), session->getSecurityContext().getUser().length(), system_charset_info);
 
45
    str->copy(user->username().c_str(), user->username().length(), system_charset_info);
45
46
  }
46
47
  return str;
47
48
}