diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index 6d2cc901eb1..0293f6bf33b 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -598,7 +598,7 @@ void *create_embedded_thd(int client_flag) thd->set_time(); thd->init_for_queries(); thd->client_capabilities= client_flag; - thd->real_id= (pthread_t) thd; + thd->real_id= pthread_self(); thd->db= NULL; thd->db_length= 0;