| 2613 | } |
| 2614 | |
| 2615 | bool plugin_dl_foreach(THD *thd, const LEX_CSTRING *dl, |
| 2616 | plugin_foreach_func *func, void *arg) |
| 2617 | { |
| 2618 | bool err= 0; |
| 2619 | |
| 2620 | if (dl) |
| 2621 | { |
| 2622 | mysql_mutex_lock(&LOCK_plugin); |
| 2623 | st_plugin_dl *plugin_dl= plugin_dl_add(dl, MYF(0)); |
| 2624 | mysql_mutex_unlock(&LOCK_plugin); |
| 2625 | |
| 2626 | if (!plugin_dl) |
| 2627 | return 1; |
| 2628 | |
| 2629 | err= plugin_dl_foreach_internal(thd, plugin_dl, plugin_dl->plugins, |
| 2630 | func, arg); |
| 2631 | |
| 2632 | mysql_mutex_lock(&LOCK_plugin); |
| 2633 | plugin_dl_del(plugin_dl); |
| 2634 | mysql_mutex_unlock(&LOCK_plugin); |
| 2635 | } |
| 2636 | else |
| 2637 | { |
| 2638 | struct st_maria_plugin **builtins; |
| 2639 | for (builtins= mysql_mandatory_plugins; !err && *builtins; builtins++) |
| 2640 | err= plugin_dl_foreach_internal(thd, 0, *builtins, func, arg); |
| 2641 | for (builtins= mysql_optional_plugins; !err && *builtins; builtins++) |
| 2642 | err= plugin_dl_foreach_internal(thd, 0, *builtins, func, arg); |
| 2643 | } |
| 2644 | return err; |
| 2645 | } |
| 2646 | |
| 2647 | |
| 2648 | /**************************************************************************** |
no test coverage detected