~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/session.cc

Merge Olaf: Refactor Includes

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
#include <plugin/myisam/myisam.h>
71
71
#include <drizzled/item/subselect.h>
72
72
#include <drizzled/statement.h>
 
73
#include <drizzled/sql_lex.h>
73
74
 
74
75
#include <algorithm>
75
76
#include <climits>
144
145
 
145
146
class Session::impl_c
146
147
{
 
148
public:
 
149
  /**
 
150
    The lex to hold the parsed tree of conventional (non-prepared) queries.
 
151
    Whereas for prepared and stored procedure statements we use an own lex
 
152
    instance for each new query, for conventional statements we reuse
 
153
    the same lex. (@see mysql_parse for details).
 
154
  */
 
155
  LEX lex;
147
156
};
148
157
 
149
158
Session::Session(plugin::Client *client_arg, catalog::Instance::shared_ptr catalog_arg) :
195
204
  m_lip(NULL),
196
205
  cached_table(0),
197
206
  arg_of_last_insert_id_function(false),
 
207
  impl_(new impl_c),
198
208
  _catalog(catalog_arg),
199
209
  transaction_message(NULL),
200
210
  statement_message(NULL),
259
269
  plugin::EventObserver::registerSessionEvents(*this);
260
270
}
261
271
 
 
272
const LEX& Session::lex() const
 
273
{
 
274
  return impl_->lex;
 
275
}
 
276
 
 
277
LEX& Session::lex()
 
278
{
 
279
  return impl_->lex;
 
280
}
 
281
 
 
282
enum_sql_command Session::getSqlCommand() const
 
283
{
 
284
  return lex().sql_command;
 
285
}
 
286
 
262
287
void statement::Statement::set_command(enum_sql_command v)
263
288
{
264
289
        session().lex().sql_command= v;