32
32
drizzled::String *res= args[0]->val_str(&value);
34
if (not res || not res->length())
36
my_error(drizzled::ER_USER_LOCKS_INVALID_NAME_BARRIER, MYF(0));
41
if (not res->length())
44
boost::tribool result= Barriers::getInstance().release(Key(getSession().getSecurityContext(), res->c_str()), getSession().getSessionId());
42
drizzled::identifier::User::const_shared_ptr user_identifier(getSession().user());
44
barriers::return_t result= Barriers::getInstance().release(Key(*user_identifier, res->c_str()), getSession().getSessionId());
48
Storable *list= static_cast<Storable *>(getSession().getProperty(property_key));
50
if (not list) // We should have been the owner if it was passed to us, this should never happen
49
case barriers::SUCCESS:
52
my_error(drizzled::ER_USER_LOCKS_NOT_OWNER_OF_BARRIER, MYF(0));
51
Storable *list= static_cast<Storable *>(getSession().getProperty(property_key));
53
if (not list) // We should have been the owner if it was passed to us, this should never happen
55
my_error(drizzled::ER_USER_LOCKS_NOT_OWNER_OF_BARRIER, MYF(0));
60
list->erase(Key(*user_identifier, res->c_str()));
57
list->erase(Key(getSession().getSecurityContext(), res->c_str()));
65
case barriers::NOT_FOUND:
66
my_error(drizzled::ER_USER_LOCKS_UNKNOWN_BARRIER, MYF(0));
69
case barriers::NOT_OWNED_BY:
63
70
my_error(drizzled::ER_USER_LOCKS_NOT_OWNER_OF_BARRIER, MYF(0));
67
my_error(drizzled::ER_USER_LOCKS_UNKNOWN_BARRIER, MYF(0));
75
76
} /* namespace barriers */