~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/user_locks/create_barrier.cc

Modernize our call to the parser, no more casting required.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
 
41
41
  barriers::Storable *list= static_cast<barriers::Storable *>(getSession().getProperty(barriers::property_key));
42
42
 
43
 
  boost::tribool result;
 
43
  bool result;
44
44
 
 
45
  drizzled::identifier::User::const_shared_ptr user_identifier(getSession().user());
45
46
  if (arg_count == 2)
46
47
  {
47
48
    int64_t wait_for;
48
49
    wait_for= args[1]->val_int();
49
50
 
50
 
    result= Barriers::getInstance().create(Key(getSession().getSecurityContext(), res->c_str()), getSession().getSessionId(), wait_for);
 
51
    result= Barriers::getInstance().create(Key(*user_identifier, res->c_str()), getSession().getSessionId(), wait_for);
51
52
  }
52
53
  else
53
54
  {
54
 
    result= Barriers::getInstance().create(Key(getSession().getSecurityContext(), res->c_str()), getSession().getSessionId());
 
55
    result= Barriers::getInstance().create(Key(*user_identifier, res->c_str()), getSession().getSessionId());
55
56
  }
56
57
 
57
58
 
58
 
  if (boost::indeterminate(result))
59
 
    null_value= true;
60
 
 
61
59
  if (result)
62
60
  {
63
61
    if (not list)
66
64
      getSession().setProperty(barriers::property_key, list);
67
65
    }
68
66
 
69
 
    list->insert(Key(getSession().getSecurityContext(), res->c_str()));
 
67
    list->insert(Key(*user_identifier, res->c_str()));
70
68
 
71
69
    return 1;
72
70
  }