From 29f9fb7a0a7df0136293aed63cd596bd45ff5b55 Mon Sep 17 00:00:00 2001 From: Konstantin Osipov Date: Mon, 7 Jun 2010 18:53:50 +0400 Subject: Backport two small cleanups from trunk-iplus tree: 1) No mutex and no function call if we're not using plugins. 2) If we're above the table definition cache limit, delete the oldest unused share, not the share on our hands. sql/sql_base.cc: If we're above the table definition cache limit, delete the oldest unused share, not the share on our hands. sql/sql_lex.cc: No mutex and no function call if we're not using plugins. --- sql/sql_lex.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'sql/sql_lex.cc') diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index e87204ffd40..3f3c650d1e8 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -435,8 +435,11 @@ void lex_end(LEX *lex) DBUG_PRINT("enter", ("lex: 0x%lx", (long) lex)); /* release used plugins */ - plugin_unlock_list(0, (plugin_ref*)lex->plugins.buffer, - lex->plugins.elements); + if (lex->plugins.elements) /* No function call and no mutex if no plugins. */ + { + plugin_unlock_list(0, (plugin_ref*)lex->plugins.buffer, + lex->plugins.elements); + } reset_dynamic(&lex->plugins); DBUG_VOID_RETURN; -- cgit v1.2.1