~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/utility_functions/user.cc

  • Committer: Patrick Crews
  • Date: 2010-12-07 20:02:50 UTC
  • Revision ID: gleebix@gmail.com-20101207200250-6a27jgqalgw5bsb5
Added disabled.def file to disable drizzleslap due to Bug#684269.  Need to skip for tarball release this round

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, Inc.
 
4
 *  Copyright (C) 2008 Sun Microsystems
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
 
  identifier::User::const_shared_ptr user= getSession().user();
37
 
  assert(user);
38
 
  if (user->username().empty())
 
36
  Session *session= current_session;
 
37
  if (session->getSecurityContext().getUser().empty())
39
38
  {
40
39
    null_value= 1;
41
40
    return 0;
42
41
  }
43
42
  else
44
43
  {
45
 
    str->copy(user->username().c_str(), user->username().length(), system_charset_info);
 
44
    str->copy(session->getSecurityContext().getUser().c_str(), session->getSecurityContext().getUser().length(), system_charset_info);
46
45
  }
47
46
  return str;
48
47
}