summaryrefslogtreecommitdiff
path: root/unittest/mysys
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mysql.com>2008-09-01 21:43:11 +0200
committerSergei Golubchik <serg@mysql.com>2008-09-01 21:43:11 +0200
commit27dadbd89577e8ff80c926cfb3fbd36cf0fb48a4 (patch)
tree58664cd91e50a30abd69134062c4a7c130146cdd /unittest/mysys
parent533deb0ac4ecb9ca802034459120ce725006e4f1 (diff)
downloadmariadb-git-27dadbd89577e8ff80c926cfb3fbd36cf0fb48a4.tar.gz
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
Diffstat (limited to 'unittest/mysys')
-rw-r--r--unittest/mysys/waiting_threads-t.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/unittest/mysys/waiting_threads-t.c b/unittest/mysys/waiting_threads-t.c
index 3c60e31a66f..39a8e800db0 100644
--- a/unittest/mysys/waiting_threads-t.c
+++ b/unittest/mysys/waiting_threads-t.c
@@ -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;
}