~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/execute.cc

  • Committer: patrick crews
  • Date: 2011-03-15 12:12:09 UTC
  • mfrom: (1099.4.216 drizzle)
  • Revision ID: gleebix@gmail.com-20110315121209-8g2tkf31w0rx9ter
Tags: 2011.03.12
Updated translations

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
{
56
56
  if (to_execute.isVariable())
57
57
  {
58
 
    user_var_entry *var= getSession()->getVariable(to_execute, false);
 
58
    user_var_entry *var= session().getVariable(to_execute, false);
59
59
 
60
60
    if (var && var->length && var->value && var->type == STRING_RESULT)
61
61
    {
75
75
bool statement::Execute::runStatement(plugin::NullClient *client, const std::string &arg)
76
76
{
77
77
  client->pushSQL(arg);
78
 
  if (not getSession()->executeStatement())
 
78
  if (not session().executeStatement())
79
79
    return true;
80
80
 
81
 
  if (getSession()->is_error())
 
81
  if (session().is_error())
82
82
    return true;
83
83
 
84
84
  return false;
90
90
  bool ret= execute_shell();
91
91
 
92
92
  // We have to restore ourselves at the top for delete() to work.
93
 
  getSession()->getLex()->statement= this;
 
93
  lex().statement= this;
94
94
 
95
95
  return ret;
96
96
}
115
115
 
116
116
  if (is_concurrent)
117
117
  {
118
 
    if (not getSession()->isConcurrentExecuteAllowed())
 
118
    if (not session().isConcurrentExecuteAllowed())
119
119
    {
120
120
      my_error(ER_WRONG_ARGUMENTS, MYF(0), "A Concurrent Execution Session can not launch another session.");
121
121
      return false;
122
122
    }
123
123
 
124
 
    drizzled::Execute executer(*getSession(), should_wait);
 
124
    drizzled::Execute executer(session(), should_wait);
125
125
    executer.run(to_execute.str, to_execute.length);
126
126
  }
127
127
  else // Non-concurrent run.
128
128
  {
129
129
    if (is_quiet)
130
130
    {
131
 
      plugin::Client *temp= getSession()->getClient();
 
131
      plugin::Client *temp= session().getClient();
132
132
      plugin::NullClient *null_client= new plugin::NullClient;
133
133
 
134
 
      getSession()->setClient(null_client);
 
134
      session().setClient(null_client);
135
135
      
136
136
      bool error_occured= false;
137
137
      bool is_savepoint= false;
138
138
      {
139
139
        std::string start_sql;
140
 
        if (getSession()->inTransaction())
 
140
        if (session().inTransaction())
141
141
        {
142
142
          // @todo Figure out something a bit more solid then this.
143
143
          start_sql.append("SAVEPOINT execute_internal_savepoint");
160
160
        Tokenizer tok(full_string, boost::escaped_list_separator<char>("\\", ";", "\""));
161
161
 
162
162
        for (Tokenizer::iterator iter= tok.begin();
163
 
             iter != tok.end() and getSession()->getKilled() != Session::KILL_CONNECTION;
 
163
             iter != tok.end() and session().getKilled() != Session::KILL_CONNECTION;
164
164
             ++iter)
165
165
        {
166
166
          if (runStatement(null_client, *iter))
202
202
        }
203
203
      }
204
204
 
205
 
      getSession()->setClient(temp);
206
 
      if (getSession()->is_error())
 
205
      session().setClient(temp);
 
206
      if (session().is_error())
207
207
      {
208
 
        getSession()->clear_error(true);
 
208
        session().clear_error(true);
209
209
      }
210
210
      else
211
211
      {
212
 
        getSession()->clearDiagnostics();
 
212
        session().clearDiagnostics();
213
213
      }
214
214
 
215
 
      getSession()->my_ok();
 
215
      session().my_ok();
216
216
 
217
217
      null_client->close();
218
218
      delete null_client;
219
219
    }
220
220
    else
221
221
    {
222
 
      parse(getSession(), to_execute.str, to_execute.length);
 
222
      parse(&session(), to_execute.str, to_execute.length);
223
223
    }
224
224
  }
225
225