Commit d5915675 authored by unknown's avatar unknown
Browse files

Bug in windows where attr was not working. Removed.


client/mysqlslap.c:
  attr issue on windows
parent dcd672e2
Loading
Loading
Loading
Loading
+6 −13
Original line number Diff line number Diff line
@@ -1560,12 +1560,6 @@ run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit)
  con.limit= limit;

  pthread_t mainthread;            /* Thread descriptor */
  pthread_attr_t attr;          /* Thread attributes */

  pthread_attr_init(&attr);
  pthread_attr_setdetachstate(&attr,
                              PTHREAD_CREATE_DETACHED);


  pthread_mutex_lock(&counter_mutex);
  thread_counter= 0;
@@ -1576,7 +1570,7 @@ run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit)
  for (x= 0; x < concur; x++)
  {
    /* nowucreate the thread */
    if (pthread_create(&mainthread, &attr, run_task, 
    if (pthread_create(&mainthread, NULL, run_task, 
                       (void *)&con) != 0)
    {
      fprintf(stderr,"%s: Could not create thread\n",
@@ -1606,7 +1600,6 @@ run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit)
    pthread_cond_timedwait(&count_threshhold, &counter_mutex, &abstime);
  }
  pthread_mutex_unlock(&counter_mutex);
  pthread_attr_destroy(&attr);

  gettimeofday(&end_time, NULL);

@@ -1793,13 +1786,13 @@ parse_option(const char *origin, option_string **stmt, char delm)
      char *option_ptr;

      tmp->length= (size_t)(buffer_ptr - buffer);
      tmp->string= my_strndup(ptr, tmp->length, MYF(MY_FAE));
      tmp->string= my_strndup(ptr, (uint)tmp->length, MYF(MY_FAE));

      option_ptr= ptr + 1 + tmp->length;

      /* Move past the : and the first string */
      tmp->option_length= (size_t)(retstr - option_ptr);
      tmp->option= my_strndup(option_ptr, tmp->option_length,
      tmp->option= my_strndup(option_ptr, (uint)tmp->option_length,
                              MYF(MY_FAE));
    }
    else
@@ -1863,7 +1856,7 @@ parse_delimiter(const char *script, statement **stmt, char delm)
       tmp= tmp->next)
  {
    count++;
    tmp->string= my_strndup(ptr, (size_t)(retstr - ptr), MYF(MY_FAE));
    tmp->string= my_strndup(ptr, (uint)(retstr - ptr), MYF(MY_FAE));
    tmp->length= (size_t)(retstr - ptr);
    ptr+= retstr - ptr + 1;
    if (isspace(*ptr))
@@ -1873,7 +1866,7 @@ parse_delimiter(const char *script, statement **stmt, char delm)

  if (ptr != script+length)
  {
    tmp->string= my_strndup(ptr, (size_t)((script + length) - ptr), 
    tmp->string= my_strndup(ptr, (uint)((script + length) - ptr), 
                                       MYF(MY_FAE));
    tmp->length= (size_t)((script + length) - ptr);
    count++;
@@ -1942,7 +1935,7 @@ print_conclusions_csv(conclusions *con)
           con->users, /* Children used */
           con->avg_rows  /* Queries run */
          );
  my_write(csv_file, buffer, strlen(buffer), MYF(0));
  my_write(csv_file, buffer, (uint)strlen(buffer), MYF(0));
}

void