summaryrefslogtreecommitdiff
path: root/sql/wsrep_mysqld.h
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2019-08-20 10:32:04 +0300
committerJan Lindström <jan.lindstrom@mariadb.com>2019-08-20 10:32:04 +0300
commit7b4de10477a7bdb51656d827ad2d914d29a4be4c (patch)
treebf1bade9ffc78d908539de4832c2800369375f85 /sql/wsrep_mysqld.h
parentc5bc0cedea01cabfcd3a8d0d1410e427e2edc08e (diff)
downloadmariadb-git-7b4de10477a7bdb51656d827ad2d914d29a4be4c.tar.gz
MDEV-20378: Galera uses uninitialized memory
Problem was that wsrep thread argument was deleted on wrong place. Furthermore, scan method incorrectly used unsafe c_ptr(). Finally, fixed wsrep thread initialization to correctly set up thread_id and pass correct argument to functions and fix signess problem causing compiler errors.
Diffstat (limited to 'sql/wsrep_mysqld.h')
-rw-r--r--sql/wsrep_mysqld.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/sql/wsrep_mysqld.h b/sql/wsrep_mysqld.h
index 8714753ba76..d71d4afea11 100644
--- a/sql/wsrep_mysqld.h
+++ b/sql/wsrep_mysqld.h
@@ -411,18 +411,17 @@ typedef void (*wsrep_thd_processor_fun)(THD*, void *);
class Wsrep_thd_args
{
public:
- Wsrep_thd_args(wsrep_thd_processor_fun fun, void* args,
- wsrep_thread_type thread_type)
+ Wsrep_thd_args(wsrep_thd_processor_fun fun,
+ wsrep_thread_type thread_type,
+ pthread_t thread_id)
:
fun_ (fun),
- args_ (args),
- thread_type_ (thread_type)
+ thread_type_ (thread_type),
+ thread_id_ (thread_id)
{ }
wsrep_thd_processor_fun fun() { return fun_; }
-
- void* args() { return args_; }
-
+ pthread_t* thread_id() {return &thread_id_; }
enum wsrep_thread_type thread_type() {return thread_type_;}
private:
@@ -431,8 +430,8 @@ class Wsrep_thd_args
Wsrep_thd_args& operator=(const Wsrep_thd_args&);
wsrep_thd_processor_fun fun_;
- void* args_;
enum wsrep_thread_type thread_type_;
+ pthread_t thread_id_;
};
void* start_wsrep_THD(void*);