You've already forked mariadb-connector-c
mirror of
https://github.com/mariadb-corporation/mariadb-connector-c.git
synced 2025-08-08 14:02:17 +03:00
More control over results in the unittest.
This commit is contained in:
@@ -35,12 +35,18 @@ static int com_multi_1(MYSQL *mysql)
|
|||||||
/* 1 SELECT result */
|
/* 1 SELECT result */
|
||||||
res= mysql_store_result(mysql);
|
res= mysql_store_result(mysql);
|
||||||
FAIL_UNLESS(res, "1 of 2 simple query in batch no result");
|
FAIL_UNLESS(res, "1 of 2 simple query in batch no result");
|
||||||
|
FAIL_UNLESS(res->field_count == 1 && res->row_count == 1 &&
|
||||||
|
strcmp(res->fields[0].name, "1") == 0,
|
||||||
|
"1 of 2 simple query in batch wrong result");
|
||||||
mysql_free_result(res);
|
mysql_free_result(res);
|
||||||
/* 2 SELECT result */
|
/* 2 SELECT result */
|
||||||
rc= mysql_next_result(mysql);
|
rc= mysql_next_result(mysql);
|
||||||
FAIL_UNLESS(rc == 0, "no second result in the batch");
|
FAIL_UNLESS(rc == 0, "no second result in the batch");
|
||||||
res= mysql_store_result(mysql);
|
res= mysql_store_result(mysql);
|
||||||
FAIL_UNLESS(res, "2 of 2 simple query in batch no result");
|
FAIL_UNLESS(res, "2 of 2 simple query in batch no result");
|
||||||
|
FAIL_UNLESS(res->field_count == 1 && res->row_count == 1 &&
|
||||||
|
strcmp(res->fields[0].name, "2") == 0,
|
||||||
|
"1 of 2 simple query in batch wrong result");
|
||||||
mysql_free_result(res);
|
mysql_free_result(res);
|
||||||
/* WHOLE batch result (OK) */
|
/* WHOLE batch result (OK) */
|
||||||
rc= mysql_next_result(mysql);
|
rc= mysql_next_result(mysql);
|
||||||
|
Reference in New Issue
Block a user