~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzleslap.cc

  • Committer: Olaf van der Spek
  • Date: 2011-08-07 20:48:33 UTC
  • mto: This revision was merged to the branch mainline in revision 2396.
  • Revision ID: olafvdspek@gmail.com-20110807204833-ks4lp3mk26gslx7e
cppcheck

Show diffs side-by-side

added added

removed removed

Lines of Context:
309
309
    if ((ptr->getType() == UPDATE_TYPE_REQUIRES_PREFIX) ||
310
310
        (ptr->getType() == SELECT_TYPE_REQUIRES_PREFIX))
311
311
    {
312
 
      int length;
313
312
      uint32_t key_val;
314
313
      char buffer[HUGE_STRING_LENGTH];
315
314
 
324
323
      if (primary_keys.size())
325
324
      {
326
325
        key_val= (uint32_t)(random() % primary_keys.size());
327
 
        const char *key;
328
 
        key= primary_keys[key_val].c_str();
 
326
        const char *key= primary_keys[key_val].c_str();
329
327
 
330
328
        assert(key);
331
329
 
332
 
        length= snprintf(buffer, HUGE_STRING_LENGTH, "%.*s '%s'",
333
 
                         (int)ptr->getLength(), ptr->getString(), key);
 
330
        int length= snprintf(buffer, HUGE_STRING_LENGTH, "%.*s '%s'", (int)ptr->getLength(), ptr->getString(), key);
334
331
 
335
332
        if (run_query(con, &result, buffer, length))
336
333
        {
1262
1259
process_options(void)
1263
1260
{
1264
1261
  struct stat sbuf;
1265
 
  OptionString *sql_type;
1266
1262
  uint32_t sql_type_count= 0;
1267
1263
  ssize_t bytes_read= 0;
1268
1264
  
1405
1401
 
1406
1402
    query_statements.resize(query_statements_count);
1407
1403
 
1408
 
    sql_type= query_options;
 
1404
    OptionString* sql_type= query_options;
1409
1405
    do
1410
1406
    {
1411
1407
      if (sql_type->getString()[0] == 'r')