| 2578 | |
| 2579 | |
| 2580 | static bool plugin_dl_foreach_internal(THD *thd, st_plugin_dl *plugin_dl, |
| 2581 | st_maria_plugin *plug, |
| 2582 | plugin_foreach_func *func, void *arg) |
| 2583 | { |
| 2584 | for (; plug->name; plug++) |
| 2585 | { |
| 2586 | st_plugin_int tmp, *plugin; |
| 2587 | |
| 2588 | tmp.name.str= const_cast<char*>(plug->name); |
| 2589 | tmp.name.length= strlen(plug->name); |
| 2590 | tmp.plugin= plug; |
| 2591 | tmp.plugin_dl= plugin_dl; |
| 2592 | |
| 2593 | mysql_mutex_lock(&LOCK_plugin); |
| 2594 | if ((plugin= plugin_find_internal(&tmp.name, plug->type)) && |
| 2595 | plugin->plugin == plug) |
| 2596 | |
| 2597 | { |
| 2598 | tmp.state= plugin->state; |
| 2599 | tmp.load_option= plugin->load_option; |
| 2600 | } |
| 2601 | else |
| 2602 | { |
| 2603 | tmp.state= PLUGIN_IS_FREED; |
| 2604 | tmp.load_option= PLUGIN_OFF; |
| 2605 | } |
| 2606 | mysql_mutex_unlock(&LOCK_plugin); |
| 2607 | |
| 2608 | plugin= &tmp; |
| 2609 | if (func(thd, plugin_int_to_ref(plugin), arg)) |
| 2610 | return 1; |
| 2611 | } |
| 2612 | return 0; |
| 2613 | } |
| 2614 | |
| 2615 | bool plugin_dl_foreach(THD *thd, const LEX_CSTRING *dl, |
| 2616 | plugin_foreach_func *func, void *arg) |
no test coverage detected