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

Fixed compiler warnings in bulk1.c and features-10_2.c

This commit is contained in:
Georg Richter
2017-03-06 15:04:47 +01:00
parent aae1d2df74
commit a1315d2a2d
2 changed files with 6 additions and 6 deletions

View File

@@ -291,7 +291,7 @@ static int bulk4(MYSQL *mysql)
rc= mysql_query(mysql, "SELECT * FROM bulk4 WHERE row=3"); rc= mysql_query(mysql, "SELECT * FROM bulk4 WHERE row=3");
check_mysql_rc(rc, mysql); check_mysql_rc(rc, mysql);
res= mysql_store_result(mysql); res= mysql_store_result(mysql);
rc= mysql_num_rows(res); rc= (int)mysql_num_rows(res);
mysql_free_result(res); mysql_free_result(res);
FAIL_IF(rc != 3, "expected 3 rows"); FAIL_IF(rc != 3, "expected 3 rows");
rc= mysql_query(mysql, "DROP TABLE IF EXISTS bulk4"); rc= mysql_query(mysql, "DROP TABLE IF EXISTS bulk4");
@@ -307,7 +307,7 @@ static int bulk_null(MYSQL *mysql)
unsigned int param_count= 2; unsigned int param_count= 2;
unsigned int array_size= 2; unsigned int array_size= 2;
unsigned long lengths[2]= {-1, -1}; unsigned long lengths[2]= {-1, -1};
const char **buf= calloc(1, 2 * sizeof(char *)); char **buf= calloc(1, 2 * sizeof(char *));
if (!bulk_enabled) if (!bulk_enabled)
{ {
@@ -401,7 +401,7 @@ static int bulk5(MYSQL *mysql)
check_mysql_rc(rc, mysql); check_mysql_rc(rc, mysql);
res= mysql_store_result(mysql); res= mysql_store_result(mysql);
rows= mysql_num_rows(res); rows= (unsigned long)mysql_num_rows(res);
mysql_free_result(res); mysql_free_result(res);
FAIL_IF(rows != 5, "expected 5 rows"); FAIL_IF(rows != 5, "expected 5 rows");
@@ -467,7 +467,7 @@ static int bulk6(MYSQL *mysql)
check_mysql_rc(rc, mysql); check_mysql_rc(rc, mysql);
res= mysql_store_result(mysql); res= mysql_store_result(mysql);
rows= mysql_num_rows(res); rows= (unsigned long)mysql_num_rows(res);
mysql_free_result(res); mysql_free_result(res);
FAIL_IF(rows != 5, "expected 5 rows"); FAIL_IF(rows != 5, "expected 5 rows");
@@ -501,7 +501,7 @@ static int bulk6(MYSQL *mysql)
check_mysql_rc(rc, mysql); check_mysql_rc(rc, mysql);
res= mysql_store_result(mysql); res= mysql_store_result(mysql);
rows= mysql_num_rows(res); rows= (unsigned long)mysql_num_rows(res);
mysql_free_result(res); mysql_free_result(res);
FAIL_IF(rows != 10, "expected 10 rows"); FAIL_IF(rows != 10, "expected 10 rows");

View File

@@ -86,7 +86,7 @@ static int execute_direct_example(MYSQL *mysql)
bind[0].buffer= &intval; bind[0].buffer= &intval;
bind[1].buffer_type= MYSQL_TYPE_STRING; bind[1].buffer_type= MYSQL_TYPE_STRING;
bind[1].buffer= (char *)strval; bind[1].buffer= (char *)strval;
bind[1].buffer_length= strlen(strval); bind[1].buffer_length= (unsigned long)strlen(strval);
/* set number of parameters */ /* set number of parameters */
rc= mysql_stmt_attr_set(stmt, STMT_ATTR_PREBIND_PARAMS, &param_count); rc= mysql_stmt_attr_set(stmt, STMT_ATTR_PREBIND_PARAMS, &param_count);