~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_parse.cc

  • Committer: Brian Aker
  • Date: 2008-10-03 17:17:25 UTC
  • mfrom: (383.6.7 pluglog)
  • Revision ID: brian@tangent.org-20081003171725-ijf4hf0zm87kaszw
Merging Mark's logging work.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
#include "sql_repl.h"
19
19
#include "rpl_filter.h"
20
20
#include "repl_failsafe.h"
 
21
#include "logging.h"
21
22
#include <drizzled/drizzled_error_messages.h>
22
23
 
23
24
/**
537
538
  /* TODO: set thd->lex->sql_command to SQLCOM_END here */
538
539
  pthread_mutex_unlock(&LOCK_thread_count);
539
540
 
 
541
  logging_pre_do(thd);
 
542
 
540
543
  thd->server_status&=
541
544
           ~(SERVER_QUERY_NO_INDEX_USED | SERVER_QUERY_NO_GOOD_INDEX_USED);
542
545
  switch (command) {
548
551
                        packet, packet_length, thd->charset());
549
552
    if (!mysql_change_db(thd, &tmp, false))
550
553
    {
 
554
      /* TODO remove general_log_write after pluggable logging works */
551
555
      general_log_write(thd, command, thd->db, thd->db_length);
552
556
      my_ok(thd);
553
557
    }
672
676
    char *packet_end= thd->query + thd->query_length;
673
677
    const char* end_of_stmt= NULL;
674
678
 
 
679
    /* TODO remove general_log_write after pluggable logging works */
675
680
    general_log_write(thd, command, thd->query, thd->query_length);
676
681
 
677
682
    mysql_parse(thd, thd->query, thd->query_length, &end_of_stmt);
921
926
  if (unlikely(thd->in_sub_stmt))
922
927
    return;                           // Don't set time for sub stmt
923
928
 
 
929
  logging_post_do(thd);
 
930
 
924
931
  /*
925
932
    Do not log administrative statements unless the appropriate option is
926
933
    set; do not log into slow log if reading from backup.
941
948
      thd_proc_info(thd, "logging slow query");
942
949
      thd->status_var.long_query_count++;
943
950
      slow_log_print(thd, thd->query, thd->query_length, end_utime_of_query);
 
951
      /* TODO remove slow_log_print after pluggable logging works*/
944
952
    }
945
953
  }
946
954
  return;