~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzleslap.cc

  • Committer: Brian Aker
  • Date: 2010-08-15 23:39:10 UTC
  • mto: (1711.1.17 build)
  • mto: This revision was merged to the branch mainline in revision 1713.
  • Revision ID: brian@tangent.org-20100815233910-tm19lvf0viwyi6fc
Remove global for size  around primary keys.

Show diffs side-by-side

added added

removed removed

Lines of Context:
121
121
pthread_cond_t timer_alarm_threshold;
122
122
 
123
123
std::vector < std::string > primary_keys;
124
 
/* This gets passed to malloc, so lets set it to an arch-dependant size */
125
 
size_t primary_keys_number_of;
126
124
 
127
125
static string host, 
128
126
  opt_password, 
2194
2192
  if (opt_only_print || (engine_stmt &&
2195
2193
                         strstr(engine_stmt->getString(), "blackhole")))
2196
2194
  {
2197
 
    primary_keys_number_of= 1;
2198
2195
    /* Yes, we strdup a const string to simplify the interface */
2199
2196
    primary_keys.push_back("796c4422-1d94-102a-9d6d-00e0812d");
2200
2197
  }
2213
2210
      fprintf(stderr, "More primary keys than than architecture supports\n");
2214
2211
      exit(1);
2215
2212
    }
 
2213
    size_t primary_keys_number_of;
2216
2214
    primary_keys_number_of= (size_t)num_rows_ret;
2217
2215
 
2218
2216
    /* So why check this? Blackhole :) */
2593
2591
        Just in case someone runs this under an experimental engine we don't
2594
2592
        want a crash so the if() is placed here.
2595
2593
      */
2596
 
      assert(primary_keys_number_of);
2597
 
      if (primary_keys_number_of)
 
2594
      assert(primary_keys.size());
 
2595
      if (primary_keys.size())
2598
2596
      {
2599
 
        key_val= (unsigned int)(random() % primary_keys_number_of);
 
2597
        key_val= (unsigned int)(random() % primary_keys.size());
2600
2598
        const char *key;
2601
2599
        key= primary_keys[key_val].c_str();
2602
2600