~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/logging_query/logging_query.cc

updating

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#include <drizzled/plugin/logging.h>
22
22
#include <drizzled/gettext.h>
23
23
#include <drizzled/session.h>
 
24
#include <drizzled/sql_parse.h>
24
25
#include PCRE_HEADER
25
26
#include <limits.h>
26
27
#include <sys/time.h>
71
72
  static const char hexit[]= { '0', '1', '2', '3', '4', '5', '6', '7',
72
73
                          '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
73
74
  string::const_iterator src_iter;
74
 
  
 
75
 
75
76
  for (src_iter= src.begin(); src_iter < src.end(); ++src_iter)
76
77
  {
77
78
    if (static_cast<unsigned char>(*src_iter) > 0x7f)
257
258
 
258
259
    // buffer to quotify the query
259
260
    string qs;
260
 
    
 
261
 
261
262
    // Since quotify() builds the quoted string incrementally, we can
262
263
    // avoid some reallocating if we reserve some space up front.
263
264
    qs.reserve(query_string->length());
264
 
    
 
265
 
265
266
    quotify(*query_string, qs);
266
 
    
 
267
 
267
268
    // to avoid trying to printf %s something that is potentially NULL
268
269
    util::string::const_shared_ptr schema(session->schema());
269
270
    const char *dbs= (schema and not schema->empty()) ? schema->c_str() : "";