From 1ef3534109b8bc1eef156c4ad0f68736189fd849 Mon Sep 17 00:00:00 2001 From: Rahim Kanji Date: Fri, 24 Nov 2023 14:01:01 +0500 Subject: [PATCH] Enable CLIENT_DEPRECATE_EOF on 20% of total mysql connections --- test/tap/tests/set_testing-240-t.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/tap/tests/set_testing-240-t.cpp b/test/tap/tests/set_testing-240-t.cpp index 0576bc4b81..3a0fc53f24 100644 --- a/test/tap/tests/set_testing-240-t.cpp +++ b/test/tap/tests/set_testing-240-t.cpp @@ -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"; @@ -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) {