summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2012-06-28 17:34:26 +0400
committerSergey Petrunya <psergey@askmonty.org>2012-06-28 17:34:26 +0400
commit94bf016321825209353b41c03e0ea8399787303e (patch)
treedcabf942717e29c9aa1c1c50fe1d0a1a84f5d0d2
parent84fd4e2542fa6483c20c27127294c83211888e9f (diff)
downloadmariadb-git-94bf016321825209353b41c03e0ea8399787303e.tar.gz
sql_select.cc: work compiler warnings
my_apc-t.cc: make it compile on Windows.
-rw-r--r--sql/sql_select.cc5
-rw-r--r--unittest/sql/my_apc-t.cc14
2 files changed, 9 insertions, 10 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index c0e765b7991..5cd7430050b 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -15804,12 +15804,11 @@ do_select(JOIN *join,List<Item> *fields,TABLE *table,Procedure *procedure)
{
DBUG_ASSERT(join->table_count);
- THD *thd= join->thd;
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",
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())
diff --git a/unittest/sql/my_apc-t.cc b/unittest/sql/my_apc-t.cc
index ada09a1675c..741cfbdb124 100644
--- a/unittest/sql/my_apc-t.cc
+++ b/unittest/sql/my_apc-t.cc
@@ -53,7 +53,7 @@ mysql_mutex_t target_mutex;
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)
while (!service_should_exit)
{
//apc_target.disable();
- usleep(10000);
+ my_sleep(10000);
//apc_target.enable();
for (int i = 0; i < 10 && !service_should_exit; i++)
{
apc_target.process_apc_requests();
- usleep(int_rand(30));
+ my_sleep(int_rand(30));
}
}
apc_target.disable();
@@ -99,7 +99,7 @@ public:
void call_in_target_thread()
{
- usleep(int_rand(1000));
+ my_sleep(int_rand(1000));
*where_to = value;
increment_counter(&apcs_served);
}
@@ -145,7 +145,7 @@ void *test_apc_requestor_thread(void *ptr)
have_errors= true;
}
}
- //usleep(300);
+ //my_sleep(300);
}
fprintf(stderr, "# test_apc_requestor_thread exiting\n");
my_thread_end();
@@ -171,13 +171,13 @@ int main(int args, char **argv)
pthread_create(&service_thr, NULL, test_apc_service_thread, (void*)NULL);
while (!started)
- usleep(1000);
+ my_sleep(1000);
for (i = 0; i < N_THREADS; i++)
pthread_create(&request_thr[i], NULL, test_apc_requestor_thread, (void*)NULL);
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, "# Shutting down requestors\n");