mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 11:27:39 +02: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:
parent
533deb0ac4
commit
27dadbd895
5 changed files with 13 additions and 19 deletions
|
|
@ -62,9 +62,8 @@ pthread_handler_t test_wt(void *arg)
|
|||
{
|
||||
WT_RESOURCE_ID resid;
|
||||
int blockers[THREADS/10], j, k;
|
||||
bzero(&resid, sizeof(resid));
|
||||
|
||||
resid.value.num= id;
|
||||
resid.value= id;
|
||||
resid.type= &restype;
|
||||
|
||||
res= 0;
|
||||
|
|
@ -187,8 +186,7 @@ void do_tests()
|
|||
WT_RESOURCE_ID resid[3];
|
||||
for (i=0; i < 3; i++)
|
||||
{
|
||||
bzero(&resid[i], sizeof(resid[i]));
|
||||
resid[i].value.num= i+1;
|
||||
resid[i].value= i+1;
|
||||
resid[i].type= &restype;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue