~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_parse.cc

  • Committer: Mark Atwood
  • Date: 2011-11-14 07:30:41 UTC
  • Revision ID: me@mark.atwood.name-20111114073041-mo2hgg8ouseo2kpu
releaseĀ 2011.11.29

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#include <drizzled/abort_exception.h>
22
22
#include <drizzled/error.h>
23
23
#include <drizzled/nested_join.h>
 
24
#include <drizzled/query_id.h>
24
25
#include <drizzled/transaction_services.h>
25
26
#include <drizzled/sql_parse.h>
26
27
#include <drizzled/data_home.h>
87
88
extern size_t my_thread_stack_size;
88
89
extern const charset_info_st *character_set_filesystem;
89
90
 
90
 
static atomic<uint64_t> g_query_id;
91
 
 
92
91
namespace
93
92
{
94
93
  static const std::string command_name[]=
193
192
                      const char* packet, uint32_t packet_length)
194
193
{
195
194
  bool error= false;
 
195
  Query_id& query_id= Query_id::get_query_id();
196
196
 
197
197
  DRIZZLE_COMMAND_START(session->thread_id, command);
198
198
 
199
199
  session->command= command;
200
200
  session->lex().sql_command= SQLCOM_END; /* to avoid confusing VIEW detectors */
201
201
  session->times.set_time();
202
 
  session->setQueryId(g_query_id.increment());
 
202
  session->setQueryId(query_id.value());
203
203
 
204
204
  if (command != COM_PING)
205
205
  {
206
206
    // Increase id and count all other statements
207
207
    session->status_var.questions++;
 
208
    query_id.next();
208
209
  }
209
210
 
210
211
  /* @todo set session->lex().sql_command to SQLCOM_END here */