Commit 94bf0163 authored by Sergey Petrunya's avatar Sergey Petrunya

sql_select.cc: work compiler warnings

my_apc-t.cc: make it compile on Windows.
parent 84fd4e25
...@@ -15804,12 +15804,11 @@ do_select(JOIN *join,List<Item> *fields,TABLE *table,Procedure *procedure) ...@@ -15804,12 +15804,11 @@ do_select(JOIN *join,List<Item> *fields,TABLE *table,Procedure *procedure)
{ {
DBUG_ASSERT(join->table_count); DBUG_ASSERT(join->table_count);
THD *thd= join->thd;
DBUG_EXECUTE_IF("show_explain_probe_do_select", DBUG_EXECUTE_IF("show_explain_probe_do_select",
if (dbug_user_var_equals_int(thd, if (dbug_user_var_equals_int(join->thd,
"show_explain_probe_select_id", "show_explain_probe_select_id",
join->select_lex->select_number)) join->select_lex->select_number))
dbug_serve_apcs(thd, 1); dbug_serve_apcs(join->thd, 1);
); );
if (join->outer_ref_cond && !join->outer_ref_cond->val_int()) if (join->outer_ref_cond && !join->outer_ref_cond->val_int())
......
...@@ -53,7 +53,7 @@ mysql_mutex_t target_mutex; ...@@ -53,7 +53,7 @@ mysql_mutex_t target_mutex;
int int_rand(int size) int int_rand(int size)
{ {
return round (((double)rand() / RAND_MAX) * size); return (int) (0.5 + ((double)rand() / RAND_MAX) * size);
} }
/* /*
...@@ -71,12 +71,12 @@ void *test_apc_service_thread(void *ptr) ...@@ -71,12 +71,12 @@ void *test_apc_service_thread(void *ptr)
while (!service_should_exit) while (!service_should_exit)
{ {
//apc_target.disable(); //apc_target.disable();
usleep(10000); my_sleep(10000);
//apc_target.enable(); //apc_target.enable();
for (int i = 0; i < 10 && !service_should_exit; i++) for (int i = 0; i < 10 && !service_should_exit; i++)
{ {
apc_target.process_apc_requests(); apc_target.process_apc_requests();
usleep(int_rand(30)); my_sleep(int_rand(30));
} }
} }
apc_target.disable(); apc_target.disable();
...@@ -99,7 +99,7 @@ public: ...@@ -99,7 +99,7 @@ public:
void call_in_target_thread() void call_in_target_thread()
{ {
usleep(int_rand(1000)); my_sleep(int_rand(1000));
*where_to = value; *where_to = value;
increment_counter(&apcs_served); increment_counter(&apcs_served);
} }
...@@ -145,7 +145,7 @@ void *test_apc_requestor_thread(void *ptr) ...@@ -145,7 +145,7 @@ void *test_apc_requestor_thread(void *ptr)
have_errors= true; have_errors= true;
} }
} }
//usleep(300); //my_sleep(300);
} }
fprintf(stderr, "# test_apc_requestor_thread exiting\n"); fprintf(stderr, "# test_apc_requestor_thread exiting\n");
my_thread_end(); my_thread_end();
...@@ -171,13 +171,13 @@ int main(int args, char **argv) ...@@ -171,13 +171,13 @@ int main(int args, char **argv)
pthread_create(&service_thr, NULL, test_apc_service_thread, (void*)NULL); pthread_create(&service_thr, NULL, test_apc_service_thread, (void*)NULL);
while (!started) while (!started)
usleep(1000); my_sleep(1000);
for (i = 0; i < N_THREADS; i++) for (i = 0; i < N_THREADS; i++)
pthread_create(&request_thr[i], NULL, test_apc_requestor_thread, (void*)NULL); pthread_create(&request_thr[i], NULL, test_apc_requestor_thread, (void*)NULL);
for (i = 0; i < 15; i++) for (i = 0; i < 15; i++)
{ {
usleep(500*1000); my_sleep(500*1000);
fprintf(stderr, "# %d APCs served %d missed\n", apcs_served, apcs_missed); fprintf(stderr, "# %d APCs served %d missed\n", apcs_served, apcs_missed);
} }
fprintf(stderr, "# Shutting down requestors\n"); fprintf(stderr, "# Shutting down requestors\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment