~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/user_locks/release_barrier.cc

  • Committer: Brian Aker
  • Date: 2010-11-17 23:04:33 UTC
  • mto: (1939.1.1 quick)
  • mto: This revision was merged to the branch mainline in revision 1940.
  • Revision ID: brian@tangent.org-20101117230433-owdh977ycs2ak31b
Fix errror messages and namespace.

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
  if (not res->length())
42
42
    return 0;
43
43
 
44
 
  boost::tribool result= Barriers::getInstance().release(Key(getSession().getSecurityContext(), res->c_str()));
 
44
  boost::tribool result= Barriers::getInstance().release(Key(getSession().getSecurityContext(), res->c_str()), getSession().getSessionId());
45
45
 
46
46
  if (result)
47
47
  {
48
48
    Storable *list= static_cast<Storable *>(getSession().getProperty(property_key));
49
 
    if (list) // We may have not been the owner of the barrier
50
 
      list->erase(Key(getSession().getSecurityContext(), res->c_str()));
 
49
    assert(list);
 
50
    if (not list) // We should have been the owner if it was passed to us, this should never happen
 
51
    {
 
52
      my_error(drizzled::ER_USER_LOCKS_NOT_OWNER_OF_BARRIER, MYF(0));
 
53
      null_value= true;
 
54
 
 
55
      return 0;
 
56
    }
 
57
    list->erase(Key(getSession().getSecurityContext(), res->c_str()));
51
58
 
52
59
    return 1;
53
60
  }
54
61
  else if (not result)
55
62
  {
 
63
    my_error(drizzled::ER_USER_LOCKS_NOT_OWNER_OF_BARRIER, MYF(0));
 
64
  }
 
65
  else
 
66
  {
56
67
    my_error(drizzled::ER_USER_LOCKS_UNKNOWN_BARRIER, MYF(0));
57
 
    return 0;
58
68
  }
59
69
 
60
70
  null_value= true;