~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/user_locks/wait_until.cc

  • Committer: Brian Aker
  • Date: 2010-11-26 22:40:33 UTC
  • mto: This revision was merged to the branch mainline in revision 1958.
  • Revision ID: brian@tangent.org-20101126224033-yt9a3o82w2rhaihp
Adding select for update test with flush locks engaged.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
21
 
#include <config.h>
22
 
#include <plugin/user_locks/module.h>
23
 
#include <plugin/user_locks/barrier_storage.h>
 
21
#include "config.h"
 
22
#include "plugin/user_locks/module.h"
 
23
#include "plugin/user_locks/barrier_storage.h"
24
24
 
25
25
#include <string>
26
26
 
34
34
 
35
35
  if (res and res->length() and wait_until)
36
36
  {
37
 
    Barrier::shared_ptr barrier= Barriers::getInstance().find(Key(*getSession().user(), res->c_str()));
 
37
    Barrier::shared_ptr barrier= Barriers::getInstance().find(Key(getSession().getSecurityContext(), res->c_str()));
38
38
 
39
39
    if (barrier and barrier->getOwner() == getSession().getSessionId())
40
40
    {
60
60
      return 1;
61
61
    }
62
62
  }
63
 
  else if (not res || not res->length())
64
 
  {
65
 
    my_error(drizzled::ER_USER_LOCKS_INVALID_NAME_BARRIER, MYF(0));
66
 
    return 0;
67
 
  }
68
63
 
69
64
  my_error(drizzled::ER_USER_LOCKS_UNKNOWN_BARRIER, MYF(0));
70
65
  null_value= false;