mirror of
https://github.com/MariaDB/server.git
synced 2026-05-07 23:54:31 +02:00
Jim's fix for the #10443.
Fix handling of floats and doubles when using prepared statements API in the embedded server. sql/sql_prepare.cc: Jim's fix for the #10443. Within the embedded server, there's no need to use float4get() and float8get() for setting parameters, since they are never stored.
This commit is contained in:
parent
297f80ed40
commit
10b76d41a4
1 changed files with 8 additions and 4 deletions
|
|
@ -306,24 +306,28 @@ static void set_param_int64(Item_param *param, uchar **pos, ulong len)
|
||||||
|
|
||||||
static void set_param_float(Item_param *param, uchar **pos, ulong len)
|
static void set_param_float(Item_param *param, uchar **pos, ulong len)
|
||||||
{
|
{
|
||||||
|
float data;
|
||||||
#ifndef EMBEDDED_LIBRARY
|
#ifndef EMBEDDED_LIBRARY
|
||||||
if (len < 4)
|
if (len < 4)
|
||||||
return;
|
return;
|
||||||
#endif
|
|
||||||
float data;
|
|
||||||
float4get(data,*pos);
|
float4get(data,*pos);
|
||||||
|
#else
|
||||||
|
data= *(float*) *pos;
|
||||||
|
#endif
|
||||||
param->set_double((double) data);
|
param->set_double((double) data);
|
||||||
*pos+= 4;
|
*pos+= 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_param_double(Item_param *param, uchar **pos, ulong len)
|
static void set_param_double(Item_param *param, uchar **pos, ulong len)
|
||||||
{
|
{
|
||||||
|
double data;
|
||||||
#ifndef EMBEDDED_LIBRARY
|
#ifndef EMBEDDED_LIBRARY
|
||||||
if (len < 8)
|
if (len < 8)
|
||||||
return;
|
return;
|
||||||
#endif
|
|
||||||
double data;
|
|
||||||
float8get(data,*pos);
|
float8get(data,*pos);
|
||||||
|
#else
|
||||||
|
data= *(double*) *pos;
|
||||||
|
#endif
|
||||||
param->set_double((double) data);
|
param->set_double((double) data);
|
||||||
*pos+= 8;
|
*pos+= 8;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue