Details
-
Task
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
Description
my_thread_id, the type of many thread_id variables/functions, is a readability typedef of uint64 de jure, but due to binary log format specifications, only 4 bytes are valid (MDEV-15089). In fact –
In mysqld.cc, static recalculate_thread_id_range() places a grand limit of (0, UINT_MAX32) on my_thread_id next_thread_id(void) and aborts the program when there’re “2^32 connections”.
To prevent inconsistent-size bugs (such as MDEV-35646) once and for all, we should change it to a typedef of uint32_t to reflect its de facto range.
There appears to be thread_id-named variables/functions that don’tcan’t make use of the my_thread_id typedef – some are ulonglong (64-bit) and some ulong/unsigned long (64-bit on Linux, 32-bit on Windows) (including slave_proxy_id of sql/log_event.h, the old name of pseudo_thread_id).
Any thread_id users among them should convert to my_thread_id to join the consistency’s cause.
(I tried to do this as part of MDEV-35646; a few files in but none understood uintXX of my_global.h (nor uintXX_t of MDEV-35460).
Attachments
Issue Links
- causes
-
MDEV-15089 Ensure that connection ID is in 32bit range
- Closed
-
MDEV-35646 pseudo_thread_id Can Overflow on Binlog Write
- In Review
- split to
-
MDEV-35707 Sys_var_XXX types should be fixed-typed, not by how many ‘long’s
- Open