~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/log_event.cc

Merged in fix-headers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
#include <drizzled/gettext.h>
33
33
#include <libdrizzle/libdrizzle.h>
34
34
#include <drizzled/error.h>
 
35
#include <drizzled/query_id.h>
35
36
 
36
37
#define log_cs  &my_charset_utf8_general_ci
37
38
 
1650
1651
{
1651
1652
  LEX_STRING new_db;
1652
1653
  int expected_error,actual_error= 0;
 
1654
  Query_id &query_id= Query_id::get_query_id();
1653
1655
  /*
1654
1656
    Colleagues: please never free(session->catalog) in MySQL. This would
1655
1657
    lead to bugs as here session->catalog is a part of an alloced block,
1694
1696
    session->set_time((time_t)when);
1695
1697
    session->query_length= q_len_arg;
1696
1698
    session->query= (char*)query_arg;
1697
 
    pthread_mutex_lock(&LOCK_thread_count);
1698
 
    session->query_id = next_query_id();
1699
 
    pthread_mutex_unlock(&LOCK_thread_count);
 
1699
    session->query_id= query_id.next();
1700
1700
    session->variables.pseudo_thread_id= thread_id;             // for temp tables
1701
1701
 
1702
1702
    if (ignored_error_code((expected_error= error_code)) ||
2818
2818
                                   bool use_rli_only_for_errors)
2819
2819
{
2820
2820
  LEX_STRING new_db;
 
2821
  Query_id &query_id= Query_id::get_query_id();
2821
2822
  new_db.length= db_len;
2822
2823
  new_db.str= (char *) rpl_filter->get_rewrite_db(db, &new_db.length);
2823
2824
  session->set_db(new_db.str, new_db.length);
2870
2871
  if (rpl_filter->db_ok(session->db))
2871
2872
  {
2872
2873
    session->set_time((time_t)when);
2873
 
    pthread_mutex_lock(&LOCK_thread_count);
2874
 
    session->query_id = next_query_id();
2875
 
    pthread_mutex_unlock(&LOCK_thread_count);
 
2874
    session->query_id = query_id.next();
2876
2875
    /*
2877
2876
      Initing session->row_count is not necessary in theory as this variable has no
2878
2877
      influence in the case of the slave SQL thread (it is used to generate a
5728
5727
{
5729
5728
  RPL_TableList *table_list;
5730
5729
  char *db_mem, *tname_mem;
 
5730
  Query_id &query_id= Query_id::get_query_id();
5731
5731
  size_t dummy_len;
5732
5732
  void *memory;
5733
5733
  assert(rli->sql_session == session);
5734
5734
 
5735
5735
  /* Step the query id to mark what columns that are actually used. */
5736
 
  pthread_mutex_lock(&LOCK_thread_count);
5737
 
  session->query_id= next_query_id();
5738
 
  pthread_mutex_unlock(&LOCK_thread_count);
 
5736
  session->query_id= query_id.next();
5739
5737
 
5740
5738
  if (!(memory= my_multi_malloc(MYF(MY_WME),
5741
5739
                                &table_list, (uint) sizeof(RPL_TableList),