~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/user_locks/signal.cc

  • Committer: Brian Aker
  • Date: 2010-11-18 08:32:27 UTC
  • mto: (1939.1.1 quick)
  • mto: This revision was merged to the branch mainline in revision 1940.
  • Revision ID: brian@tangent.org-20101118083227-3evnnsgw5cwtuv7f
Add additional test for barriers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
{
32
32
  drizzled::String *res= args[0]->val_str(&value);
33
33
 
34
 
  if (not res)
35
 
  {
36
 
    null_value= true;
37
 
    return 0;
38
 
  }
39
 
  null_value= false;
40
 
 
41
 
  if (not res->length())
42
 
    return 0;
43
 
 
44
 
  Barrier::shared_ptr barrier= Barriers::getInstance().find(Key(getSession().getSecurityContext(), res->c_str()));
45
 
 
46
 
  if (barrier)
47
 
  {
48
 
    barrier->signal();
49
 
 
50
 
    return 1;
51
 
  }
52
 
 
 
34
  if (res and res->length())
 
35
  {
 
36
    Barrier::shared_ptr barrier= Barriers::getInstance().find(Key(getSession().getSecurityContext(), res->c_str()));
 
37
 
 
38
    if (barrier)
 
39
    {
 
40
      barrier->signal();
 
41
      null_value= false;
 
42
 
 
43
      return 1;
 
44
    }
 
45
  }
 
46
 
 
47
  my_error(drizzled::ER_USER_LOCKS_UNKNOWN_BARRIER, MYF(0));
53
48
  null_value= true;
54
49
 
55
50
  return 0;