~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/user_locks/create_barrier.cc

  • Committer: Lee Bieber
  • Date: 2010-12-15 16:23:36 UTC
  • mfrom: (1995.1.2 build)
  • Revision ID: kalebral@gmail.com-20101215162336-juntyt4gw4vgohg4
Merge Andrew - fix bug 628912: Crash / segfault in drizzled::Item_func::arguments (this=0x35) at ./drizzled/function/func.h
Merge Andrew - 663919: next query after KILL QUERY will error

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