34
35
namespace statement
37
Execute::Execute(Session *in_session, drizzled::execute_string_t to_execute_arg, bool is_quiet_arg) :
38
Execute::Execute(Session *in_session,
39
drizzled::execute_string_t to_execute_arg,
41
bool is_concurrent_arg) :
38
42
Statement(in_session),
39
43
is_quiet(is_quiet_arg),
44
is_concurrent(is_concurrent_arg),
40
45
to_execute(to_execute_arg)
82
plugin::Client *temp= getSession()->getClient();
83
plugin::Client *null_client= plugin::Listen::getNullClient();
85
getSession()->setClient(null_client);
87
mysql_parse(getSession(), to_execute.str, to_execute.length);
89
getSession()->setClient(temp);
90
if (getSession()->is_error())
92
getSession()->clear_error(true);
93
getSession()->my_ok();
88
if (getSession()->isConcurrentExecuteAllowed())
90
plugin::NullClient *null_client= new plugin::NullClient;
91
null_client->pushSQL(std::string(to_execute.str, to_execute.length));
92
Session *new_session= new Session(null_client);
94
new_session->setConcurrentExecute(false);
96
// Overwrite the context in the next session, with what we have in our
97
// session. Eventually we will allow someone to change the effective
99
new_session->getSecurityContext()= getSession()->getSecurityContext();
101
if (new_session->schedule())
102
Session::unlink(new_session);
106
my_error(ER_WRONG_ARGUMENTS, MYF(0), "A Concurrent Execution Session can not launch another session.");
100
mysql_parse(getSession(), to_execute.str, to_execute.length);
114
plugin::Client *temp= getSession()->getClient();
115
plugin::Client *null_client= plugin::Listen::getNullClient();
117
getSession()->setClient(null_client);
119
mysql_parse(getSession(), to_execute.str, to_execute.length);
121
getSession()->setClient(temp);
122
if (getSession()->is_error())
124
getSession()->clear_error(true);
125
getSession()->my_ok();
127
null_client->close();
132
mysql_parse(getSession(), to_execute.str, to_execute.length);