| 1493 | } |
| 1494 | |
| 1495 | static int plugin_initialize(MEM_ROOT *tmp_root, struct st_plugin_int *plugin, |
| 1496 | int *argc, char **argv, bool options_only) |
| 1497 | { |
| 1498 | int ret= 1; |
| 1499 | DBUG_ENTER("plugin_initialize"); |
| 1500 | |
| 1501 | mysql_mutex_assert_owner(&LOCK_plugin); |
| 1502 | uint state= plugin->state; |
| 1503 | DBUG_ASSERT(state == PLUGIN_IS_UNINITIALIZED); |
| 1504 | |
| 1505 | mysql_mutex_unlock(&LOCK_plugin); |
| 1506 | |
| 1507 | mysql_prlock_wrlock(&LOCK_system_variables_hash); |
| 1508 | if (test_plugin_options(tmp_root, plugin, argc, argv)) |
| 1509 | state= PLUGIN_IS_DISABLED; |
| 1510 | mysql_prlock_unlock(&LOCK_system_variables_hash); |
| 1511 | |
| 1512 | if (options_only || state == PLUGIN_IS_DISABLED) |
| 1513 | { |
| 1514 | ret= !options_only && plugin_is_forced(plugin); |
| 1515 | state= PLUGIN_IS_DISABLED; |
| 1516 | } |
| 1517 | else |
| 1518 | ret= plugin_do_initialize(plugin, state); |
| 1519 | |
| 1520 | if (ret && ret != HA_ERR_RETRY_INIT) |
| 1521 | plugin_variables_deinit(plugin); |
| 1522 | |
| 1523 | mysql_mutex_lock(&LOCK_plugin); |
| 1524 | plugin->state= state; |
| 1525 | |
| 1526 | DBUG_RETURN(ret); |
| 1527 | } |
| 1528 | |
| 1529 | |
| 1530 | extern "C" const uchar *get_plugin_hash_key(const void *, size_t *, my_bool); |
no test coverage detected