mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 05:22:25 +01:00
Merge grichter@bk-internal.mysql.com:/home/bk/mysql-5.0
into lmy002.wdf.sap.corp:/home/georg/work/mysql/prod/mysql-5.0
This commit is contained in:
commit
79c62d3168
2 changed files with 8 additions and 9 deletions
|
@ -3656,7 +3656,6 @@ static void fetch_long_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Convert double/float column to supplied buffer of any type.
|
||||
|
||||
|
@ -3673,6 +3672,7 @@ static void fetch_float_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
|
|||
double value, int width)
|
||||
{
|
||||
char *buffer= (char *)param->buffer;
|
||||
double val64 = (value < 0 ? -floor(-value) : floor(value));
|
||||
|
||||
switch (param->buffer_type) {
|
||||
case MYSQL_TYPE_NULL: /* do nothing */
|
||||
|
@ -3688,8 +3688,8 @@ static void fetch_float_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
|
|||
*buffer= (uint8) value;
|
||||
else
|
||||
*buffer= (int8) value;
|
||||
*param->error= value != (param->is_unsigned ? (double) ((uint8) *buffer) :
|
||||
(double) ((int8) *buffer));
|
||||
*param->error= val64 != (param->is_unsigned ? (double)((uint8) *buffer) :
|
||||
(double)((int8) *buffer));
|
||||
break;
|
||||
case MYSQL_TYPE_SHORT:
|
||||
if (param->is_unsigned)
|
||||
|
@ -3702,7 +3702,7 @@ static void fetch_float_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
|
|||
short data= (short) value;
|
||||
shortstore(buffer, data);
|
||||
}
|
||||
*param->error= value != (param->is_unsigned ? (double) (*(ushort*) buffer):
|
||||
*param->error= val64 != (param->is_unsigned ? (double) (*(ushort*) buffer):
|
||||
(double) (*(short*) buffer));
|
||||
break;
|
||||
case MYSQL_TYPE_LONG:
|
||||
|
@ -3716,7 +3716,7 @@ static void fetch_float_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
|
|||
int32 data= (int32) value;
|
||||
longstore(buffer, data);
|
||||
}
|
||||
*param->error= value != (param->is_unsigned ? (double) (*(uint32*) buffer):
|
||||
*param->error= val64 != (param->is_unsigned ? (double) (*(uint32*) buffer):
|
||||
(double) (*(int32*) buffer));
|
||||
break;
|
||||
case MYSQL_TYPE_LONGLONG:
|
||||
|
@ -3730,7 +3730,7 @@ static void fetch_float_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
|
|||
longlong data= (longlong) value;
|
||||
longlongstore(buffer, data);
|
||||
}
|
||||
*param->error= value != (param->is_unsigned ?
|
||||
*param->error= val64 != (param->is_unsigned ?
|
||||
ulonglong2double(*(ulonglong*) buffer) :
|
||||
(double) (*(longlong*) buffer));
|
||||
break;
|
||||
|
|
|
@ -3654,8 +3654,8 @@ static void test_bind_result_ext1()
|
|||
check_execute(stmt, rc);
|
||||
|
||||
rc= mysql_stmt_fetch(stmt);
|
||||
DIE_UNLESS(rc == MYSQL_DATA_TRUNCATED);
|
||||
DIE_UNLESS(bind[4].error_value == 1);
|
||||
printf("rc=%d\n", rc);
|
||||
DIE_UNLESS(rc == 0);
|
||||
|
||||
if (!opt_silent)
|
||||
{
|
||||
|
@ -12462,7 +12462,6 @@ static void test_truncation()
|
|||
|
||||
/* double -> longlong: fractional part is lost */
|
||||
DIE_UNLESS(++bind < bind_array + bind_count);
|
||||
DIE_UNLESS(*bind->error && * (longlong*) bind->buffer == 123);
|
||||
|
||||
/* double -> ulonglong, negative fp number to unsigned integer */
|
||||
DIE_UNLESS(++bind < bind_array + bind_count);
|
||||
|
|
Loading…
Reference in a new issue