~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/user_locks/get_locks.cc

  • Committer: Brian Aker
  • Date: 2010-10-15 00:59:36 UTC
  • mfrom: (1849 staging)
  • mto: This revision was merged to the branch mainline in revision 1853.
  • Revision ID: brian@tangent.org-20101015005936-znhvkz8khs4fhlyv
Merge with trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
    }
41
41
    else
42
42
    {
43
 
      my_error(drizzled::ER_USER_LOCKS_INVALID_NAME_LOCK, MYF(0));
44
 
      return 0;
45
 
    }
46
 
  }
47
 
 
48
 
  boost::tribool result;
49
 
  {
50
 
    boost::this_thread::restore_interruption dl(getSession().getThreadInterupt());
51
 
 
52
 
    try {
53
 
      result= user_locks::Locks::getInstance().lock(getSession().getSessionId(), list_of_locks);
54
 
    }
55
 
    catch(boost::thread_interrupted const& error)
56
 
    {
57
 
      my_error(drizzled::ER_QUERY_INTERRUPTED, MYF(0));
58
43
      null_value= true;
59
 
 
60
44
      return 0;
61
45
    }
62
46
  }
63
47
 
 
48
  null_value= false;
 
49
 
 
50
 
 
51
  boost::tribool result= user_locks::Locks::getInstance().lock(getSession().getSessionId(), list_of_locks);
 
52
 
64
53
  if (boost::indeterminate(result))
65
54
    null_value= true;
66
55
 
67
56
  if (result)
68
57
  {
69
 
    user_locks::Storable *list= static_cast<user_locks::Storable *>(getSession().getProperty("user_locks"));
 
58
    user_locks::Storable *list= dynamic_cast<user_locks::Storable *>(getSession().getProperty("user_locks"));
70
59
    if (not list)
71
60
    {
72
61
      list= new user_locks::Storable(getSession().getSessionId());
79
68
      list->insert(*iter);
80
69
    }
81
70
 
82
 
    null_value= false;
83
 
 
84
71
    return 1;
85
72
  }
86
73