~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_parse.cc

Merged in fix-headers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#include "logging.h"
21
21
#include <drizzled/error.h>
22
22
#include <drizzled/nested_join.h>
 
23
#include <drizzled/query_id.h>
23
24
 
24
25
/**
25
26
  @defgroup Runtime_Environment Runtime Environment
490
491
        COM_QUIT/COM_SHUTDOWN
491
492
*/
492
493
bool dispatch_command(enum enum_server_command command, Session *session,
493
 
                      char* packet, uint32_t packet_length)
 
494
                      char* packet, uint32_t packet_length)
494
495
{
495
496
  NET *net= &session->net;
496
497
  bool error= 0;
 
498
  Query_id &query_id= Query_id::get_query_id();
497
499
 
498
500
  session->command=command;
499
501
  session->lex->sql_command= SQLCOM_END; /* to avoid confusing VIEW detectors */
500
502
  session->set_time();
501
503
  pthread_mutex_lock(&LOCK_thread_count);
502
 
  session->query_id= global_query_id;
 
504
  session->query_id= query_id.value();
503
505
 
504
506
  switch( command ) {
505
507
  /* Ignore these statements. */
508
510
  /* Increase id and count all other statements. */
509
511
  default:
510
512
    statistic_increment(session->status_var.questions, &LOCK_status);
511
 
    next_query_id();
 
513
    query_id.next();
512
514
  }
513
515
 
514
516
  thread_running++;
677
679
        Count each statement from the client.
678
680
      */
679
681
      statistic_increment(session->status_var.questions, &LOCK_status);
680
 
      session->query_id= next_query_id();
 
682
      session->query_id= query_id.next();
681
683
      session->set_time(); /* Reset the query start time. */
682
684
      /* TODO: set session->lex->sql_command to SQLCOM_END here */
683
685
      pthread_mutex_unlock(&LOCK_thread_count);