Commit dd601de6 authored by konstantin@mysql.com's avatar konstantin@mysql.com

Cleanup.

parent 65b70328
...@@ -3393,7 +3393,7 @@ static void fetch_long_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field, ...@@ -3393,7 +3393,7 @@ static void fetch_long_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
longlong value) longlong value)
{ {
char *buffer= (char *)param->buffer; char *buffer= (char *)param->buffer;
uint field_is_unsigned= (field->flags & UNSIGNED_FLAG); uint field_is_unsigned= field->flags & UNSIGNED_FLAG;
switch (param->buffer_type) { switch (param->buffer_type) {
case MYSQL_TYPE_NULL: /* do nothing */ case MYSQL_TYPE_NULL: /* do nothing */
...@@ -3590,13 +3590,13 @@ static void fetch_result_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field, ...@@ -3590,13 +3590,13 @@ static void fetch_result_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
{ {
ulong length; ulong length;
enum enum_field_types field_type= field->type; enum enum_field_types field_type= field->type;
uint field_is_unsigned= field->flags & UNSIGNED_FLAG;
switch (field_type) { switch (field_type) {
case MYSQL_TYPE_TINY: case MYSQL_TYPE_TINY:
{ {
char value= (char) **row; char value= (char) **row;
uint field_is_unsigned= (field->flags & UNSIGNED_FLAG); longlong data= field_is_unsigned ? (longlong) (unsigned char) value :
longlong data= (field_is_unsigned) ? (longlong) (unsigned char) value:
(longlong) value; (longlong) value;
fetch_long_with_conversion(param, field, data); fetch_long_with_conversion(param, field, data);
length= 1; length= 1;
...@@ -3606,9 +3606,8 @@ static void fetch_result_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field, ...@@ -3606,9 +3606,8 @@ static void fetch_result_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
case MYSQL_TYPE_YEAR: case MYSQL_TYPE_YEAR:
{ {
short value= sint2korr(*row); short value= sint2korr(*row);
uint field_is_unsigned= (field->flags & UNSIGNED_FLAG); longlong data= field_is_unsigned ? (longlong) (unsigned short) value :
longlong data= ((field_is_unsigned) ? (longlong) (unsigned short) value: (longlong) value;
(longlong) value);
fetch_long_with_conversion(param, field, data); fetch_long_with_conversion(param, field, data);
length= 2; length= 2;
break; break;
...@@ -3616,9 +3615,8 @@ static void fetch_result_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field, ...@@ -3616,9 +3615,8 @@ static void fetch_result_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
case MYSQL_TYPE_LONG: case MYSQL_TYPE_LONG:
{ {
long value= sint4korr(*row); long value= sint4korr(*row);
uint field_is_unsigned= (field->flags & UNSIGNED_FLAG); longlong data= field_is_unsigned ? (longlong) (unsigned long) value :
longlong data= ((field_is_unsigned) ? (longlong) (unsigned long) value: (longlong) value;
(longlong) value);
fetch_long_with_conversion(param, field, data); fetch_long_with_conversion(param, field, data);
length= 4; length= 4;
break; break;
......
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