31
31
drizzled::String *res= args[0]->val_str(&value);
33
if (not res || not res->length())
35
my_error(drizzled::ER_USER_LOCKS_INVALID_NAME_LOCK, MYF(0));
40
drizzled::identifier::User::const_shared_ptr user_identifier(getSession().user());
40
if (not res->length())
41
43
drizzled::session_id_t id= getSession().getSessionId();
42
locks::return_t result;
44
boost::this_thread::restore_interruption dl(getSession().getThreadInterupt());
46
result= user_locks::Locks::getInstance().release(Key(*user_identifier, res->c_str()), id);
48
catch(boost::thread_interrupted const& error)
50
my_error(drizzled::ER_QUERY_INTERRUPTED, MYF(0));
60
user_locks::Storable *list= static_cast<user_locks::Storable *>(getSession().getProperty("user_locks"));
62
if (list) // Just in case we ever blow the assert
63
list->erase(Key(*user_identifier, res->c_str()));
67
case locks::NOT_FOUND:
70
case locks::NOT_OWNED_BY:
71
my_error(drizzled::ER_USER_LOCKS_NOT_OWNER_OF_LOCK, MYF(0));
44
boost::tribool result= user_locks::Locks::getInstance().release(Key(getSession().getSecurityContext(), res->c_str()), id);
48
user_locks::Storable *list= static_cast<user_locks::Storable *>(getSession().getProperty("user_locks"));
50
if (list) // Just in case we ever blow the assert
51
list->erase(Key(getSession().getSecurityContext(), res->c_str()));
76
65
} /* namespace user_locks */