~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/truncate.cc

  • Committer: Olaf van der Spek
  • Date: 2011-04-05 12:26:58 UTC
  • mto: (2278.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 2272.
  • Revision ID: olafvdspek@gmail.com-20110405122658-xxrvmobwwwwf3oct
Refactor Open_tables_state

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
#include <drizzled/show.h>
23
23
#include <drizzled/session.h>
24
24
#include <drizzled/statement/truncate.h>
 
25
#include <drizzled/sql_lex.h>
25
26
 
26
 
namespace drizzled
27
 
{
 
27
namespace drizzled {
28
28
 
29
29
bool statement::Truncate::execute()
30
30
{
31
 
  TableList *first_table= (TableList *) getSession()->getLex()->select_lex.table_list.first;
 
31
  TableList *first_table= (TableList *) lex().select_lex.table_list.first;
32
32
 
33
 
  if (getSession()->inTransaction())
 
33
  if (session().inTransaction())
34
34
  {
35
35
    my_error(ER_TRANSACTIONAL_DDL_NOT_SUPPORTED, MYF(0));
36
36
    return true;
37
37
  }
38
38
 
39
 
  return truncate(*getSession(), first_table);
 
39
  return truncate(session(), first_table);
40
40
}
41
41
 
42
42
} /* namespace drizzled */