You've already forked mariadb-connector-c
mirror of
https://github.com/mariadb-corporation/mariadb-connector-c.git
synced 2025-08-07 02:42:49 +03:00
Added test case for conc336
This commit is contained in:
45
unittest/libmariadb/conc336.c
Normal file
45
unittest/libmariadb/conc336.c
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
#include "my_test.h"
|
||||||
|
|
||||||
|
#define MAX_COUNT 4000
|
||||||
|
|
||||||
|
int main(int argc, char *argv[]) {
|
||||||
|
|
||||||
|
MYSQL *mysql;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
if (argc > 1)
|
||||||
|
get_options(argc, argv);
|
||||||
|
|
||||||
|
get_envvars();
|
||||||
|
|
||||||
|
for (i = 0; i < MAX_COUNT; ++i) {
|
||||||
|
|
||||||
|
if (mysql_library_init(-1, NULL, NULL) != 0) {
|
||||||
|
diag("mysql_library_init failed");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
mysql = mysql_init(NULL);
|
||||||
|
if (!mysql) {
|
||||||
|
diag("mysql_init failed");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!mysql_real_connect(mysql, hostname, username, password, NULL, port, NULL, 0)) {
|
||||||
|
diag("mysql_real_connect failed: %s", mysql_error(mysql));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mysql_query(mysql, "SELECT NULL LIMIT 0") != 0) {
|
||||||
|
diag("mysql_query failed: %s", mysql_error(mysql));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
mysql_close(mysql);
|
||||||
|
mysql_library_end();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
}
|
Reference in New Issue
Block a user