~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/session.cc

  • Committer: Olaf van der Spek
  • Date: 2011-04-19 12:36:24 UTC
  • mto: This revision was merged to the branch mainline in revision 2287.
  • Revision ID: olafvdspek@gmail.com-20110419123624-61kkurltbo3247t7
Prune

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
#include <drizzled/identifier.h>
37
37
#include <drizzled/internal/iocache.h>
38
38
#include <drizzled/internal/thread_var.h>
39
 
#include <drizzled/internal_error_handler.h>
40
39
#include <drizzled/item/cache.h>
41
40
#include <drizzled/item/empty_string.h>
42
41
#include <drizzled/item/float.h>
169
168
  }
170
169
 
171
170
  Diagnostics_area diagnostics;
 
171
  memory::Root mem_root;
 
172
 
172
173
  /**
173
174
    The lex to hold the parsed tree of conventional (non-prepared) queries.
174
175
    Whereas for prepared and stored procedure statements we use an own lex
191
192
 
192
193
Session::Session(plugin::Client *client_arg, catalog::Instance::shared_ptr catalog_arg) :
193
194
  impl_(new impl_c(*this)),
194
 
  mem_root(&main_mem_root),
 
195
  mem_root(&impl_->mem_root),
195
196
  query(new std::string),
196
197
  scheduler(NULL),
197
198
  scheduler_arg(NULL),
249
250
    the destructor works OK in case of an error. The main_mem_root
250
251
    will be re-initialized in init_for_queries().
251
252
  */
252
 
  memory::init_sql_alloc(&main_mem_root, memory::ROOT_MIN_BLOCK_SIZE, 0);
 
253
  memory::init_sql_alloc(mem_root, memory::ROOT_MIN_BLOCK_SIZE, 0);
253
254
  cuted_fields= sent_row_count= row_count= 0L;
254
255
  // Must be reset to handle error with Session's created for init of mysqld
255
256
  lex().current_select= 0;
291
292
  lock_info.init(); /* safety: will be reset after start */
292
293
  thr_lock_owner_init(&main_lock_id, &lock_info);
293
294
 
294
 
  m_internal_handler= NULL;
295
 
 
296
295
  plugin::EventObserver::registerSessionEvents(*this);
297
296
}
298
297
 
368
367
  }
369
368
}
370
369
 
371
 
bool Session::handle_error(drizzled::error_t sql_errno, const char *message,
372
 
                           DRIZZLE_ERROR::enum_warning_level level)
373
 
{
374
 
  if (m_internal_handler)
375
 
  {
376
 
    return m_internal_handler->handle_error(sql_errno, message, level, this);
377
 
  }
378
 
 
379
 
  return false;
380
 
}
381
 
 
382
370
void Session::setAbort(bool arg)
383
371
{
384
372
  mysys_var->abort= arg;
467
455
  warn_root.free_root(MYF(0));
468
456
  mysys_var=0;                                  // Safety (shouldn't be needed)
469
457
 
470
 
  main_mem_root.free_root(MYF(0));
 
458
  impl_->mem_root.free_root(MYF(0));
471
459
  currentMemRoot().release();
472
460
  currentSession().release();
473
461