Skip to content

Commit

Permalink
Added test case for conc336
Browse files Browse the repository at this point in the history
  • Loading branch information
9EOR9 committed May 30, 2018
1 parent 6b16eb7 commit 8f168c4
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions unittest/libmariadb/conc336.c
@@ -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;

}

0 comments on commit 8f168c4

Please sign in to comment.