~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/execute.cc

  • Committer: Brian Aker
  • Date: 2011-02-22 06:12:02 UTC
  • mfrom: (2190.1.6 drizzle-build)
  • Revision ID: brian@tangent.org-20110222061202-k03czxykqy4x9hjs
List update, header fixes, multiple symbols, and David deletes some code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
21
 
#include "config.h"
 
21
#include <config.h>
22
22
 
23
 
#include "drizzled/session.h"
24
 
#include "drizzled/user_var_entry.h"
25
 
#include "drizzled/plugin/client/concurrent.h"
26
 
#include "drizzled/execute.h"
 
23
#include <drizzled/session.h>
 
24
#include <drizzled/user_var_entry.h>
 
25
#include <drizzled/plugin/client/concurrent.h>
 
26
#include <drizzled/catalog/local.h>
 
27
#include <drizzled/execute.h>
27
28
 
28
29
namespace drizzled
29
30
{
52
53
  {
53
54
    plugin::client::Concurrent *client= new plugin::client::Concurrent;
54
55
    client->pushSQL(execution_string);
55
 
    Session::shared_ptr new_session(new Session(client));
 
56
    Session::shared_ptr new_session= Session::make_shared(client, catalog::local());
56
57
 
57
58
    // We set the current schema.  @todo do the same with catalog
58
59
    util::string::const_shared_ptr schema(_session.schema());
64
65
    // Overwrite the context in the next session, with what we have in our
65
66
    // session. Eventually we will allow someone to change the effective
66
67
    // user.
67
 
    new_session->getSecurityContext()= _session.getSecurityContext();
 
68
    new_session->user()= _session.user();
68
69
 
69
70
    if (Session::schedule(new_session))
70
71
    {
84
85
  if (wait && thread && thread->joinable())
85
86
  {
86
87
    // We want to make sure that we can be killed
87
 
    boost::this_thread::restore_interruption dl(_session.getThreadInterupt());
88
 
    try {
 
88
    if (_session.getThread())
 
89
    {
 
90
      boost::this_thread::restore_interruption dl(_session.getThreadInterupt());
 
91
 
 
92
      try {
 
93
        thread->join();
 
94
      }
 
95
      catch(boost::thread_interrupted const&)
 
96
      {
 
97
        // Just surpress and return the error
 
98
        my_error(drizzled::ER_QUERY_INTERRUPTED, MYF(0));
 
99
        return;
 
100
      }
 
101
    }
 
102
    else
 
103
    {
89
104
      thread->join();
90
105
    }
91
 
    catch(boost::thread_interrupted const&)
92
 
    {
93
 
      // Just surpress and return the error
94
 
      my_error(drizzled::ER_QUERY_INTERRUPTED, MYF(0));
95
 
 
96
 
      return;
97
 
    }
98
106
  }
99
107
}
100
108