diff options
author | Andrei Elkin <andrei.elkin@mariadb.com> | 2020-03-03 13:11:28 +0200 |
---|---|---|
committer | Andrei Elkin <andrei.elkin@mariadb.com> | 2020-03-03 13:12:40 +0200 |
commit | 36cebe53a3645bf1e665ffdf5b552cabcc1e8e56 (patch) | |
tree | 35103f8d1b5529a04d88f73e35d5915a98d49a25 /sql/handler.h | |
parent | 94acfb2a5820d0980203c3a22f8a5fcfa8199236 (diff) | |
download | mariadb-git-bb-10.5-pre_XA.tar.gz |
MDEV-21856 XID_t::formatID has to be constrained to 4 byte sizebb-10.5-pre_XA
Engine (Innodb) and XA replication MDEV-742 requires the XID member
be of a constant minimum across supported platform ulong size which
is 4 bytes.
That is implemented.
Specifically -1 of uint32 is INVALID format id value to mark
xids internally, and xid value that consist of it won't be accepted.
Additionally two more values are reserved for future to make up
the max XID::formatID = (1<<32) - 4.
Diffstat (limited to 'sql/handler.h')
-rw-r--r-- | sql/handler.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sql/handler.h b/sql/handler.h index 0a561ec8b3f..92c2a61ed0e 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -829,6 +829,10 @@ typedef ulonglong my_xid; // this line is the same as in log_event.h @see MYSQL_XID in mysql/plugin.h */ struct xid_t { + static const uint32 INVALID_format_id= UINT32_MAX; + // Two more values reserved for Todo: MDEV-21777 + static const uint32 MAX_format_id= UINT32_MAX - 3; + long formatID; long gtrid_length; long bqual_length; @@ -864,8 +868,8 @@ struct xid_t { bqual_length= b; memcpy(data, d, g+b); } - bool is_null() const { return formatID == -1; } - void null() { formatID= -1; } + bool is_null() const { return formatID == INVALID_format_id; } + void null() { formatID= INVALID_format_id; } my_xid quick_get_my_xid() { my_xid tmp; |