~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/logging_query/logging_query.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:
18
18
 */
19
19
 
20
20
#include <config.h>
 
21
#include <drizzled/plugin.h>
21
22
#include <drizzled/plugin/logging.h>
22
23
#include <drizzled/gettext.h>
23
24
#include <drizzled/session.h>
 
25
#include <drizzled/sql_parse.h>
24
26
#include PCRE_HEADER
25
27
#include <limits.h>
26
28
#include <sys/time.h>
71
73
  static const char hexit[]= { '0', '1', '2', '3', '4', '5', '6', '7',
72
74
                          '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
73
75
  string::const_iterator src_iter;
74
 
  
 
76
 
75
77
  for (src_iter= src.begin(); src_iter < src.end(); ++src_iter)
76
78
  {
77
79
    if (static_cast<unsigned char>(*src_iter) > 0x7f)
242
244
      return false;
243
245
 
244
246
    Session::QueryString query_string(session->getQueryString());
 
247
    if (query_string == NULL)
 
248
    {
 
249
      return false;
 
250
    }
 
251
 
245
252
    if (re)
246
253
    {
247
254
      int this_pcre_rc;
252
259
 
253
260
    // buffer to quotify the query
254
261
    string qs;
255
 
    
 
262
 
256
263
    // Since quotify() builds the quoted string incrementally, we can
257
264
    // avoid some reallocating if we reserve some space up front.
258
265
    qs.reserve(query_string->length());
259
 
    
 
266
 
260
267
    quotify(*query_string, qs);
261
 
    
 
268
 
262
269
    // to avoid trying to printf %s something that is potentially NULL
263
270
    util::string::const_shared_ptr schema(session->schema());
264
271
    const char *dbs= (schema and not schema->empty()) ? schema->c_str() : "";