1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-08-08 14:02:17 +03:00

Fixes for bigendian systems (CONC-252, CONC-265)

This commit is contained in:
Georg Richter
2017-06-30 14:00:28 +02:00
parent 28f4832800
commit 6e156a63e3
4 changed files with 10 additions and 5 deletions

View File

@@ -453,7 +453,7 @@ static long ma_get_length(MYSQL_STMT *stmt, unsigned int param_nr, unsigned long
return stmt->params[param_nr].length[row_nr];
}
static char ma_get_indicator(MYSQL_STMT *stmt, unsigned int param_nr, unsigned long row_nr)
static signed char ma_get_indicator(MYSQL_STMT *stmt, unsigned int param_nr, unsigned long row_nr)
{
if (!MARIADB_STMT_BULK_SUPPORTED(stmt) ||
!stmt->array_size ||
@@ -484,7 +484,7 @@ int store_param(MYSQL_STMT *stmt, int column, unsigned char **p, unsigned long r
{
void *buf= ma_get_buffer_offset(stmt, stmt->params[column].buffer_type,
stmt->params[column].buffer, row_nr);
char indicator= ma_get_indicator(stmt, column, row_nr);
signed char indicator= ma_get_indicator(stmt, column, row_nr);
switch (stmt->params[column].buffer_type) {
case MYSQL_TYPE_TINY:
@@ -896,7 +896,7 @@ unsigned char* mysql_stmt_execute_generate_bulk_request(MYSQL_STMT *stmt, size_t
{
size_t size= 0;
my_bool has_data= TRUE;
char indicator= ma_get_indicator(stmt, i, j);
signed char indicator= ma_get_indicator(stmt, i, j);
/* check if we need to send data */
if (indicator > 0)
has_data= FALSE;
@@ -930,9 +930,11 @@ unsigned char* mysql_stmt_execute_generate_bulk_request(MYSQL_STMT *stmt, size_t
size+= 5; /* max 8 bytes for size */
if (indicator == STMT_INDICATOR_NTS ||
(!stmt->row_size && ma_get_length(stmt,i,j) == -1))
{
size+= strlen(ma_get_buffer_offset(stmt,
stmt->params[i].buffer_type,
stmt->params[i].buffer,j));
}
else
size+= (size_t)ma_get_length(stmt, i, j);
break;

View File

@@ -194,7 +194,7 @@ static int test_cursor(MYSQL *mysql)
{
int rc;
MYSQL_STMT *stmt;
unsigned int prefetch_rows= 1;
unsigned long prefetch_rows= 1;
unsigned long cursor_type= CURSOR_TYPE_READ_ONLY;
stmt= mysql_stmt_init(mysql);

View File

@@ -1189,7 +1189,7 @@ static int test_zerofill(MYSQL *mysql)
static int test_server_status(MYSQL *mysql)
{
int rc;
unsigned long server_status;
unsigned int server_status;
MYSQL_STMT *stmt= mysql_stmt_init(mysql);
rc= mysql_autocommit(mysql, 1);

View File

@@ -63,6 +63,9 @@ static int test_conc_27(MYSQL *mysql)
DWORD threads[THREAD_NUM];
#endif
diag("please run this test manually as root");
return SKIP;
rc= mysql_query(mysql, "DROP TABLE IF EXISTS t_conc27");
check_mysql_rc(rc, mysql);