mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
wt: don't support a key as a union { ulonglong, void* }. Although convenient,
it forces the user to bzero a key before setting it as a pointer, otherwise it'll have random content on architectures where sizeof(void*) < sizeof(ulonglong). Declaring a key as ulonglong only (not a union) makes this user mistake impossible. include/waiting_threads.h: WT_RESOURCE_ID::value is an ulonglong, not a union mysys/waiting_threads.c: WT_RESOURCE_ID::value is an ulonglong, not a union storage/maria/ma_write.c: WT_RESOURCE_ID::value is an ulonglong, not a union storage/maria/trnman.c: WT_RESOURCE_ID::value is an ulonglong, not a union unittest/mysys/waiting_threads-t.c: WT_RESOURCE_ID::value is an ulonglong, not a union
This commit is contained in:
@@ -32,10 +32,7 @@ typedef struct st_wt_resource_type {
|
||||
|
||||
struct st_wt_resource_id {
|
||||
WT_RESOURCE_TYPE *type;
|
||||
union {
|
||||
void *ptr;
|
||||
ulonglong num;
|
||||
} value;
|
||||
ulonglong value;
|
||||
};
|
||||
|
||||
#define WT_WAIT_STATS 24
|
||||
|
Reference in New Issue
Block a user