summaryrefslogtreecommitdiff
path: root/sql/log.h
diff options
context:
space:
mode:
authorSujatha <sujatha.sivakumar@mariadb.com>2020-01-23 16:17:55 +0530
committerSujatha <sujatha.sivakumar@mariadb.com>2020-01-29 16:33:05 +0530
commitd89bb8867459c058997f0e315cef76d95b56fb2b (patch)
tree7e87c235337316b4a12169981be13e615963ec16 /sql/log.h
parent5271d43648957141b55159958b66fd635d80ac85 (diff)
downloadmariadb-git-d89bb8867459c058997f0e315cef76d95b56fb2b.tar.gz
MDEV-20923:UBSAN: member access within address … which does not point to an object of type 'xid_count_per_binlog'
Problem: ------- Accessing a member within 'xid_count_per_binlog' structure results in following error when 'UBSAN' is enabled. member access within address 0xXXX which does not point to an object of type 'xid_count_per_binlog' Analysis: --------- The problem appears to be that no constructor for 'xid_count_per_binlog' is being called, and thus the vtable will not be initialized. Fix: --- Defined a parameterized constructor for 'xid_count_per_binlog' class.
Diffstat (limited to 'sql/log.h')
-rw-r--r--sql/log.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/sql/log.h b/sql/log.h
index b4c9b24a3a9..277e5c6f69c 100644
--- a/sql/log.h
+++ b/sql/log.h
@@ -587,7 +587,18 @@ public:
long xid_count;
/* For linking in requests to the binlog background thread. */
xid_count_per_binlog *next_in_queue;
- xid_count_per_binlog(); /* Give link error if constructor used. */
+ xid_count_per_binlog(char *log_file_name, uint log_file_name_len)
+ :binlog_id(0), xid_count(0)
+ {
+ binlog_name_len= log_file_name_len;
+ binlog_name= (char *) my_malloc(binlog_name_len, MYF(MY_ZEROFILL));
+ if (binlog_name)
+ memcpy(binlog_name, log_file_name, binlog_name_len);
+ }
+ ~xid_count_per_binlog()
+ {
+ my_free(binlog_name);
+ }
};
I_List<xid_count_per_binlog> binlog_xid_count_list;
mysql_mutex_t LOCK_binlog_background_thread;