From c0364263d9dcc9f122529804576f65640587acd4 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 4 Oct 2004 23:26:42 +0500 Subject: patch fixing after review on patch-fixing of Bug #5492 "set @@session.read_rnd_buffer_size=33554432" crashes server on query 1. added warning comments for uint3korr (need one more byte allocated) 2. unsigned long in uint3korr was replaced by unsigned int to avoid problems on 64-bits platforms 3. shorten warning comments in init_rr_cache in sql/records.cc include/config-win.h: 1. added warning comments for uint3korr (need one more byte allocated) 2. unsigned long in uint3korr was replaced by unsigned int to avoid problems on 64-bits platforms include/my_global.h: 1. added warning comments for uint3korr (need one more byte allocated) 2. unsigned long in uint3korr was replaced by unsigned int to avoid problems on 64-bits platforms sql/records.cc: shorten warning comments for my_malloc_lock in init_rr_cache --- include/my_global.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'include/my_global.h') diff --git a/include/my_global.h b/include/my_global.h index f24fc05471e..6871dfbf6c6 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -898,7 +898,13 @@ typedef char bool; /* Ordinary boolean values 0 1 */ (((uint32) ((uchar) (A)[1])) << 8) +\ (((uint32) ((uchar) (A)[2])) << 16)) #else -#define uint3korr(A) (long) (*((unsigned long *) (A)) & 0xFFFFFF) +/* + ATTENTION ! + + Please, note, uint3korr reads 4 bytes (not 3) ! + It means, that you have to provide enough allocated space ! +*/ +#define uint3korr(A) (long) (*((unsigned int *) (A)) & 0xFFFFFF) #endif #define uint4korr(A) (*((unsigned long *) (A))) #define uint5korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) +\ -- cgit v1.2.1