summaryrefslogtreecommitdiff
path: root/sql/rpl_gtid.h
diff options
context:
space:
mode:
authorKristian Nielsen <knielsen@knielsen-hq.org>2017-05-10 09:56:31 +0200
committerKristian Nielsen <knielsen@knielsen-hq.org>2017-05-10 09:56:31 +0200
commit0db2cd7c7600c8cd03a1005d299cd0112d80b4ad (patch)
treef22bf1b838726f1a4befd4e3c0e2706dba9cc94d /sql/rpl_gtid.h
parent8683052389e8f59caeb4218dc300d98627be1750 (diff)
downloadmariadb-git-0db2cd7c7600c8cd03a1005d299cd0112d80b4ad.tar.gz
MDEV-12179: Per-engine mysql.gtid_slave_pos table
Intermediate commit. Fix compilation failure with different my_atomic implementation. The my_atomic_loadptr* takes void ** as first argument, so variables updated with it needs to be void * (it is not legal C to cast some_type ** to void **).
Diffstat (limited to 'sql/rpl_gtid.h')
-rw-r--r--sql/rpl_gtid.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/sql/rpl_gtid.h b/sql/rpl_gtid.h
index 4ff1ca563b8..452f3676704 100644
--- a/sql/rpl_gtid.h
+++ b/sql/rpl_gtid.h
@@ -206,10 +206,13 @@ struct rpl_slave_state
The list can be read without lock by an SQL driver thread or worker thread
by reading the gtid_pos_tables pointer atomically with acquire semantics,
to ensure that it will see the correct next pointer of a new head element.
+
+ The type is struct gtid_pos_table *, but needs to be void * to allow using
+ my_atomic operations without violating C strict aliasing semantics.
*/
- struct gtid_pos_table *gtid_pos_tables;
+ void * volatile gtid_pos_tables;
/* The default entry in gtid_pos_tables, mysql.gtid_slave_pos. */
- struct gtid_pos_table *default_gtid_pos_table;
+ void * volatile default_gtid_pos_table;
bool loaded;
rpl_slave_state();