|
|
|
|
@ -939,7 +939,7 @@ bool ProxySQL_Admin::init(const bootstrap_info_t& bootstrap_info) {
|
|
|
|
|
#endif /* PROXYSQLGENAI */
|
|
|
|
|
|
|
|
|
|
if (ProxySQL_PluginManager* plugin_manager = proxysql_get_plugin_manager()) {
|
|
|
|
|
auto merge_plugin_tables = [this](std::vector<table_def_t *>* target, const std::vector<ProxySQL_PluginTableDef>& defs, const char* db_name) {
|
|
|
|
|
auto merge_plugin_tables = [this](std::vector<table_def_t *>* target, const std::vector<ProxySQL_PluginTableDef>& defs, const char* db_name) -> bool {
|
|
|
|
|
for (const auto& def : defs) {
|
|
|
|
|
bool duplicate_name = false;
|
|
|
|
|
for (const auto* existing : *target) {
|
|
|
|
|
@ -949,17 +949,20 @@ bool ProxySQL_Admin::init(const bootstrap_info_t& bootstrap_info) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (duplicate_name) {
|
|
|
|
|
proxy_warning("Skipping plugin table %s for %s because the table name already exists\n",
|
|
|
|
|
def.table_name, db_name);
|
|
|
|
|
continue;
|
|
|
|
|
proxy_error("Plugin table %s for %s conflicts with an existing table name\n",
|
|
|
|
|
def.table_name, db_name);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
insert_into_tables_defs(target, def.table_name, def.table_def);
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
merge_plugin_tables(tables_defs_admin, plugin_manager->tables(ProxySQL_PluginDBKind::admin_db), "admin");
|
|
|
|
|
merge_plugin_tables(tables_defs_config, plugin_manager->tables(ProxySQL_PluginDBKind::config_db), "config");
|
|
|
|
|
merge_plugin_tables(tables_defs_stats, plugin_manager->tables(ProxySQL_PluginDBKind::stats_db), "stats");
|
|
|
|
|
if (!merge_plugin_tables(tables_defs_admin, plugin_manager->tables(ProxySQL_PluginDBKind::admin_db), "admin") ||
|
|
|
|
|
!merge_plugin_tables(tables_defs_config, plugin_manager->tables(ProxySQL_PluginDBKind::config_db), "config") ||
|
|
|
|
|
!merge_plugin_tables(tables_defs_stats, plugin_manager->tables(ProxySQL_PluginDBKind::stats_db), "stats")) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// init ldap here
|
|
|
|
|
|