~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/logging_query/logging_query.cc

  • Committer: Brian Aker
  • Date: 2009-11-18 06:11:12 UTC
  • mfrom: (1220.1.10 staging)
  • Revision ID: brian@gaz-20091118061112-tyf4qrfr5v7i946b
Monty + Brian Merge.

Show diffs side-by-side

added added

removed removed

Lines of Context:
278
278
    unsigned char qs[255];
279
279
  
280
280
    // to avoid trying to printf %s something that is potentially NULL
281
 
    const char *dbs= (session->db) ? session->db : "";
282
 
    int dbl= 0;
283
 
    if (dbs != NULL)
284
 
      dbl= session->db_length;
 
281
    const char *dbs= session->db.empty() ? "" : session->db.c_str();
285
282
  
286
283
    msgbuf_len=
287
284
      snprintf(msgbuf, MAX_MSG_LEN,
292
289
               session->thread_id,
293
290
               session->getQueryId(),
294
291
               // dont need to quote the db name, always CSV safe
295
 
               dbl, dbs,
 
292
               (int)session->db.length(), dbs,
296
293
               // do need to quote the query
297
294
               quotify((unsigned char *)session->getQueryString(),
298
295
                       session->getQueryLength(), qs, sizeof(qs)),
411
408
  NULL
412
409
};
413
410
 
414
 
drizzle_declare_plugin(logging_query)
 
411
drizzle_declare_plugin
415
412
{
416
413
  "logging_query",
417
414
  "0.2",