summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorunknown <vva@eagle.mysql.r18.ru>2004-10-04 23:26:42 +0500
committerunknown <vva@eagle.mysql.r18.ru>2004-10-04 23:26:42 +0500
commit2db923858253787cd5bb0082cfb14d13d3b5e906 (patch)
tree4abdd475e13ff4def7440bf8517e499dae105852 /include
parent43bf4ace6bb74c6133db95892e88736db7806779 (diff)
downloadmariadb-git-2db923858253787cd5bb0082cfb14d13d3b5e906.tar.gz
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
Diffstat (limited to 'include')
-rw-r--r--include/config-win.h8
-rw-r--r--include/my_global.h8
2 files changed, 14 insertions, 2 deletions
diff --git a/include/config-win.h b/include/config-win.h
index bb6d663bd8d..152e85c8e68 100644
--- a/include/config-win.h
+++ b/include/config-win.h
@@ -218,7 +218,13 @@ inline double ulonglong2double(ulonglong value)
((uint32) (uchar) (A)[0])))
#define sint4korr(A) (*((long *) (A)))
#define uint2korr(A) (*((uint16 *) (A)))
-#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)
#define uint4korr(A) (*((unsigned long *) (A)))
#define uint5korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) +\
(((uint32) ((uchar) (A)[1])) << 8) +\
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])) +\