Skip to content

Commit

Permalink
Enable CLIENT_DEPRECATE_EOF on 20% of total mysql connections
Browse files Browse the repository at this point in the history
  • Loading branch information
rahim-kanji committed Nov 24, 2023
1 parent 8bfdf16 commit 1ef3534
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/tap/tests/set_testing-240-t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ int queries_per_connections=10;
//unsigned int num_threads=5;
unsigned int num_threads=20;
int count=20;
int total_conn_having_client_deprecate_eof_support = (count * 0.2); // 20% of connections will have CLIENT_DEPRECATE_EOF flag enabled
char *username=NULL;
char *password=NULL;
char *host=(char *)"localhost";
Expand Down Expand Up @@ -114,6 +115,10 @@ void * my_conn_thread(void *arg) {
if (mysql==NULL) {
exit(EXIT_FAILURE);
}
if (i < total_conn_having_client_deprecate_eof_support) {
// enable 'CLIENT_DEPRECATE_EOF' support
mysql->options.client_flag |= CLIENT_DEPRECATE_EOF;
}
MYSQL *rc=mysql_real_connect(mysql, cl.root_host, cl.root_username, cl.root_password, schema, (local ? 0 : ( port + rand()%multiport ) ), NULL, 0);
// MYSQL *rc=mysql_real_connect(mysql, cl.mysql_host, cl.mysql_username, cl.mysql_password, schema, (local ? 0 : ( cl.mysql_port + rand()%multiport ) ), NULL, 0);
if (rc==NULL) {
Expand Down

0 comments on commit 1ef3534

Please sign in to comment.