From 07d4f27195efc64cba7af16cf07e54ea545599d2 Mon Sep 17 00:00:00 2001 From: "ramil@mysql.com" <> Date: Fri, 15 Jul 2005 11:17:57 +0500 Subject: 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 | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'sql/sql_prepare.cc') diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 9e2612c5661..89f930fa735 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -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) { + float data; #ifndef EMBEDDED_LIBRARY if (len < 4) return; -#endif - float data; float4get(data,*pos); +#else + data= *(float*) *pos; +#endif param->set_double((double) data); *pos+= 4; } static void set_param_double(Item_param *param, uchar **pos, ulong len) { + double data; #ifndef EMBEDDED_LIBRARY if (len < 8) return; -#endif - double data; float8get(data,*pos); +#else + data= *(double*) *pos; +#endif param->set_double((double) data); *pos+= 8; } -- cgit v1.2.1