Skip to content

Commit 90a2bf4

Browse files
committed
Bug#23236404 QUERY REWRITE PLUGIN SUFFERS SCALABILITY ISSUES
Problem: ======== Audit plugins are being acquired on the first use. Releasing plugins after execution of each query and reacquiring them again significantly affects scalability. Fix: ==== Audit plugins are being acquired on the first use, and released when the connection ends. Reviewed-by: ============ Georgi Kodinov <georgi.kodinov@oracle.com> Ramil Kalimullin <ramil.kalimullin@oracle.com>
1 parent 53ca133 commit 90a2bf4

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

mysql-test/t/version_token.test

+1
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ connection con1;
207207
set @@version_tokens_session= "token100=def;;; token2 = abc ;;;;;";
208208
--error ER_VTOKEN_PLUGIN_TOKEN_NOT_FOUND
209209
create table t1 (c1 int);
210+
disconnect con1;
210211

211212
-- echo
212213
-- echo # Connection: default

sql/conn_handler/connection_handler_one_thread.cc

-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ bool One_thread_connection_handler::add_connection(Channel_info* channel_info)
8484
delete channel_info;
8585
while (thd_connection_alive(thd))
8686
{
87-
mysql_audit_release(thd);
8887
if (do_command(thd))
8988
break;
9089
}

sql/conn_handler/connection_handler_per_thread.cc

-1
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,6 @@ extern "C" void *handle_connection(void *arg)
297297
{
298298
while (thd_connection_alive(thd))
299299
{
300-
mysql_audit_release(thd);
301300
if (do_command(thd))
302301
break;
303302
}

sql/sql_plugin.cc

+6
Original file line numberDiff line numberDiff line change
@@ -4185,6 +4185,9 @@ bool Sql_cmd_install_plugin::execute(THD *thd)
41854185
bool st= mysql_install_plugin(thd, &m_comment, &m_ident);
41864186
if (!st)
41874187
my_ok(thd);
4188+
#ifndef EMBEDDED_LIBRARY
4189+
mysql_audit_release(thd);
4190+
#endif
41884191
return st;
41894192
}
41904193

@@ -4194,5 +4197,8 @@ bool Sql_cmd_uninstall_plugin::execute(THD *thd)
41944197
bool st= mysql_uninstall_plugin(thd, &m_comment);
41954198
if (!st)
41964199
my_ok(thd);
4200+
#ifndef EMBEDDED_LIBRARY
4201+
mysql_audit_release(thd);
4202+
#endif
41974203
return st;
41984204
}

0 commit comments

Comments
 (0)