summaryrefslogtreecommitdiff
path: root/libmysql
diff options
context:
space:
mode:
Diffstat (limited to 'libmysql')
-rw-r--r--libmysql/libmysql.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index 0a830c695bb..d1e92f5d91f 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -3114,6 +3114,7 @@ static uint read_binary_date(MYSQL_TIME *tm, uchar **pos)
return length;
}
+
/* Convert Numeric to buffer types */
static void send_data_long(MYSQL_BIND *param, MYSQL_FIELD *field,
longlong value)
@@ -3128,26 +3129,26 @@ static void send_data_long(MYSQL_BIND *param, MYSQL_FIELD *field,
*param->buffer= (uchar) value;
break;
case MYSQL_TYPE_SHORT:
- int2store(buffer, value);
+ shortstore(buffer, value);
break;
case MYSQL_TYPE_LONG:
- int4store(buffer, value);
+ longstore(buffer, value);
break;
case MYSQL_TYPE_LONGLONG:
- int8store(buffer, value);
+ longlongstore(buffer, value);
break;
case MYSQL_TYPE_FLOAT:
{
float data= (field_is_unsigned ? (float) ulonglong2double(value) :
(float) value);
- float4store(buffer, data);
+ floatstore(buffer, data);
break;
}
case MYSQL_TYPE_DOUBLE:
{
double data= (field_is_unsigned ? ulonglong2double(value) :
(double) value);
- float8store(buffer, data);
+ doublestore(buffer, data);
break;
}
default:
@@ -3183,24 +3184,26 @@ static void send_data_double(MYSQL_BIND *param, double value)
*buffer= (uchar)value;
break;
case MYSQL_TYPE_SHORT:
- int2store(buffer, (short)value);
+ shortstore(buffer, (short)value);
break;
case MYSQL_TYPE_LONG:
- int4store(buffer, (long)value);
+ longstore(buffer, (long)value);
break;
case MYSQL_TYPE_LONGLONG:
- int8store(buffer, (longlong)value);
+ {
+ longlong val= (longlong) value;
+ longlongstore(buffer, val);
break;
+ }
case MYSQL_TYPE_FLOAT:
{
- float data= (float)value;
- float4store(buffer, data);
+ float data= (float) value;
+ floatstore(buffer, data);
break;
}
case MYSQL_TYPE_DOUBLE:
{
- double data= (double)value;
- float8store(buffer, data);
+ doublestore(buffer, value);
break;
}
default: