Commit 3a7e3f06 authored by hf@deer.(none)'s avatar hf@deer.(none)

embedded library: fix for sending of parameters to stored procedure.

using of methods like sint2korr() doesn't work on Bigendian machines
parent bbfe390a
...@@ -256,8 +256,11 @@ void set_param_short(Item_param *param, uchar **pos, ulong len) ...@@ -256,8 +256,11 @@ void set_param_short(Item_param *param, uchar **pos, ulong len)
#ifndef EMBEDDED_LIBRARY #ifndef EMBEDDED_LIBRARY
if (len < 2) if (len < 2)
return; return;
#endif
int16 value= sint2korr(*pos); int16 value= sint2korr(*pos);
#else
int16 value;
shortget(value, *pos);
#endif
param->set_int(param->unsigned_flag ? (longlong) ((uint16) value) : param->set_int(param->unsigned_flag ? (longlong) ((uint16) value) :
(longlong) value); (longlong) value);
*pos+= 2; *pos+= 2;
...@@ -268,8 +271,11 @@ void set_param_int32(Item_param *param, uchar **pos, ulong len) ...@@ -268,8 +271,11 @@ void set_param_int32(Item_param *param, uchar **pos, ulong len)
#ifndef EMBEDDED_LIBRARY #ifndef EMBEDDED_LIBRARY
if (len < 4) if (len < 4)
return; return;
#endif
int32 value= sint4korr(*pos); int32 value= sint4korr(*pos);
#else
int32 value;
longget(value, *pos);
#endif
param->set_int(param->unsigned_flag ? (longlong) ((uint32) value) : param->set_int(param->unsigned_flag ? (longlong) ((uint32) value) :
(longlong) value); (longlong) value);
*pos+= 4; *pos+= 4;
...@@ -280,9 +286,13 @@ void set_param_int64(Item_param *param, uchar **pos, ulong len) ...@@ -280,9 +286,13 @@ void set_param_int64(Item_param *param, uchar **pos, ulong len)
#ifndef EMBEDDED_LIBRARY #ifndef EMBEDDED_LIBRARY
if (len < 8) if (len < 8)
return; return;
#endif
param->set_int((longlong)sint8korr(*pos)); param->set_int((longlong)sint8korr(*pos));
*pos+= 8; *pos+= 8;
#else
longlong value;
longlongget(value, *pos);
param->set_int(value);
#endif
} }
void set_param_float(Item_param *param, uchar **pos, ulong len) void set_param_float(Item_param *param, uchar **pos, ulong len)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment