mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 04:53:01 +01:00
Bug#8070
corrected possible unalignment in NdbRecAttr access methods
This commit is contained in:
parent
f813e0dac0
commit
a3f7796dd9
1 changed files with 12 additions and 4 deletions
|
@ -304,7 +304,9 @@ inline
|
|||
Int64
|
||||
NdbRecAttr::int64_value() const
|
||||
{
|
||||
return *(Int64*)theRef;
|
||||
Int64 val;
|
||||
memcpy(&val,theRef,8);
|
||||
return val;
|
||||
}
|
||||
|
||||
inline
|
||||
|
@ -332,7 +334,9 @@ inline
|
|||
Uint64
|
||||
NdbRecAttr::u_64_value() const
|
||||
{
|
||||
return *(Uint64*)theRef;
|
||||
Uint64 val;
|
||||
memcpy(&val,theRef,8);
|
||||
return val;
|
||||
}
|
||||
|
||||
inline
|
||||
|
@ -360,14 +364,18 @@ inline
|
|||
float
|
||||
NdbRecAttr::float_value() const
|
||||
{
|
||||
return *(float*)theRef;
|
||||
float val;
|
||||
memcpy(&val,theRef,sizeof(val));
|
||||
return val;
|
||||
}
|
||||
|
||||
inline
|
||||
double
|
||||
NdbRecAttr::double_value() const
|
||||
{
|
||||
return *(double*)theRef;
|
||||
double val;
|
||||
memcpy(&val,theRef,sizeof(val));
|
||||
return val;
|
||||
}
|
||||
|
||||
inline
|
||||
|
|
Loading…
Reference in a new issue