| 1453 | } |
| 1454 | |
| 1455 | static int plugin_do_initialize(struct st_plugin_int *plugin, uint &state) |
| 1456 | { |
| 1457 | DBUG_ENTER("plugin_do_initialize"); |
| 1458 | mysql_mutex_assert_not_owner(&LOCK_plugin); |
| 1459 | plugin_type_init init= plugin_type_initialize[plugin->plugin->type]; |
| 1460 | if (!init) |
| 1461 | init= plugin->plugin->init; |
| 1462 | if (init) |
| 1463 | { |
| 1464 | if (int ret= init(plugin)) |
| 1465 | { |
| 1466 | /* Plugin init failed and did not requested a retry */ |
| 1467 | if (ret != HA_ERR_RETRY_INIT) |
| 1468 | print_init_failed_error(plugin); |
| 1469 | DBUG_RETURN(ret); |
| 1470 | } |
| 1471 | } |
| 1472 | state= PLUGIN_IS_READY; // plugin->init() succeeded |
| 1473 | |
| 1474 | if (plugin->plugin->status_vars) |
| 1475 | { |
| 1476 | /* |
| 1477 | historical ndb behavior caused MySQL plugins to specify |
| 1478 | status var names in full, with the plugin name prefix. |
| 1479 | this was never fixed in MySQL. |
| 1480 | MariaDB fixes that but supports MySQL style too. |
| 1481 | */ |
| 1482 | SHOW_VAR *show_vars= plugin->plugin->status_vars; |
| 1483 | SHOW_VAR tmp_array[2]= {{plugin->plugin->name, |
| 1484 | (char *) plugin->plugin->status_vars, SHOW_ARRAY}, |
| 1485 | {0, 0, SHOW_UNDEF}}; |
| 1486 | if (strncasecmp(show_vars->name, plugin->name.str, plugin->name.length)) |
| 1487 | show_vars= tmp_array; |
| 1488 | |
| 1489 | if (add_status_vars(show_vars)) |
| 1490 | DBUG_RETURN(1); |
| 1491 | } |
| 1492 | DBUG_RETURN(0); |
| 1493 | } |
| 1494 | |
| 1495 | static int plugin_initialize(MEM_ROOT *tmp_root, struct st_plugin_int *plugin, |
| 1496 | int *argc, char **argv, bool options_only) |
no test coverage detected