~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/user_locks/get_lock.cc

  • Committer: Andrew Hutchings
  • Date: 2010-12-15 18:59:55 UTC
  • mto: This revision was merged to the branch mainline in revision 2006.
  • Revision ID: andrew@linuxjedi.co.uk-20101215185955-q12lkja8hdnpjqg7
Make the test look for drizzleadmin failure instead of success as this test is not possible to fix for success on our FreeBSD 8.0 box

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
  }
44
44
  null_value= false;
45
45
 
 
46
  std::cerr << "Trying to create " << res->c_str() << "\n";
 
47
 
46
48
  user_locks::Storable *list= static_cast<user_locks::Storable *>(getSession().getProperty("user_locks"));
47
49
  if (list) // To be compatible with MySQL, we will now release all other locks we might have.
48
50
    list->erase_all();
49
51
 
50
52
  bool result;
51
 
  drizzled::identifier::User::const_shared_ptr user_identifier(getSession().user());
52
53
  {
53
54
    boost::this_thread::restore_interruption dl(getSession().getThreadInterupt());
54
55
 
55
56
    try {
56
 
      result= user_locks::Locks::getInstance().lock(getSession().getSessionId(), Key(*user_identifier, res->c_str()), wait_time);
 
57
      result= user_locks::Locks::getInstance().lock(getSession().getSessionId(), Key(getSession().getSecurityContext(), res->c_str()), wait_time);
57
58
    }
58
59
    catch(boost::thread_interrupted const& error)
59
60
    {
64
65
    }
65
66
  }
66
67
 
 
68
  if (boost::indeterminate(result))
 
69
    null_value= true;
 
70
 
67
71
  if (result)
68
72
  {
69
73
    if (not list)
72
76
      getSession().setProperty("user_locks", list);
73
77
    }
74
78
 
75
 
    list->insert(Key(*user_identifier, res->c_str()));
 
79
    list->insert(Key(getSession().getSecurityContext(), res->c_str()));
76
80
 
77
81
    return 1;
78
82
  }