Commit 105a2c1c authored by konstantin@mysql.com's avatar konstantin@mysql.com

Fix for Bug#6024 "Test "client_test" fails in 4.1.6-gamma build (1)":

let's not assume that char is signed (its signedness is not defined).
The server was also affected by the wrong typedef.
parent 60fc4ed0
...@@ -713,7 +713,7 @@ typedef void *gptr; /* Generic pointer */ ...@@ -713,7 +713,7 @@ typedef void *gptr; /* Generic pointer */
typedef char *gptr; /* Generic pointer */ typedef char *gptr; /* Generic pointer */
#endif #endif
#ifndef HAVE_INT_8_16_32 #ifndef HAVE_INT_8_16_32
typedef char int8; /* Signed integer >= 8 bits */ typedef signed char int8; /* Signed integer >= 8 bits */
typedef short int16; /* Signed integer >= 16 bits */ typedef short int16; /* Signed integer >= 16 bits */
#endif #endif
#ifndef HAVE_UCHAR #ifndef HAVE_UCHAR
......
...@@ -3611,9 +3611,10 @@ static void fetch_result_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field, ...@@ -3611,9 +3611,10 @@ static void fetch_result_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
switch (field_type) { switch (field_type) {
case MYSQL_TYPE_TINY: case MYSQL_TYPE_TINY:
{ {
char value= (char) **row; uchar value= **row;
longlong data= field_is_unsigned ? (longlong) (unsigned char) value : /* sic: we need to cast to 'signed char' as 'char' may be unsigned */
(longlong) value; longlong data= field_is_unsigned ? (longlong) value :
(longlong) (signed char) value;
fetch_long_with_conversion(param, field, data); fetch_long_with_conversion(param, field, data);
*row+= 1; *row+= 1;
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