mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 00:03:02 +01:00
Fixed CORE-4478: Failure to load provider/plugin not reported
This commit is contained in:
parent
2dfeb0e422
commit
2b066db7ab
@ -1418,16 +1418,16 @@ C --
|
||||
PARAMETER (GDS__attachment_in_use = 335545002)
|
||||
INTEGER*4 GDS__transaction_in_use
|
||||
PARAMETER (GDS__transaction_in_use = 335545003)
|
||||
INTEGER*4 GDS__pman_plugin_notfound
|
||||
PARAMETER (GDS__pman_plugin_notfound = 335545004)
|
||||
INTEGER*4 GDS__pman_cannot_load_plugin
|
||||
PARAMETER (GDS__pman_cannot_load_plugin = 335545005)
|
||||
PARAMETER (GDS__pman_cannot_load_plugin = 335545004)
|
||||
INTEGER*4 GDS__pman_module_notfound
|
||||
PARAMETER (GDS__pman_module_notfound = 335545005)
|
||||
INTEGER*4 GDS__pman_entrypoint_notfound
|
||||
PARAMETER (GDS__pman_entrypoint_notfound = 335545006)
|
||||
INTEGER*4 GDS__pman_bad_conf_index
|
||||
PARAMETER (GDS__pman_bad_conf_index = 335545007)
|
||||
INTEGER*4 GDS__pman_unknown_instance
|
||||
PARAMETER (GDS__pman_unknown_instance = 335545008)
|
||||
INTEGER*4 GDS__pman_module_bad
|
||||
PARAMETER (GDS__pman_module_bad = 335545007)
|
||||
INTEGER*4 GDS__pman_plugin_notfound
|
||||
PARAMETER (GDS__pman_plugin_notfound = 335545008)
|
||||
INTEGER*4 GDS__sysf_invalid_trig_namespace
|
||||
PARAMETER (GDS__sysf_invalid_trig_namespace = 335545009)
|
||||
INTEGER*4 GDS__unexpected_null
|
||||
|
@ -716,11 +716,11 @@ const
|
||||
gds_eem_engine_notfound = 335545001;
|
||||
gds_attachment_in_use = 335545002;
|
||||
gds_transaction_in_use = 335545003;
|
||||
gds_pman_plugin_notfound = 335545004;
|
||||
gds_pman_cannot_load_plugin = 335545005;
|
||||
gds_pman_cannot_load_plugin = 335545004;
|
||||
gds_pman_module_notfound = 335545005;
|
||||
gds_pman_entrypoint_notfound = 335545006;
|
||||
gds_pman_bad_conf_index = 335545007;
|
||||
gds_pman_unknown_instance = 335545008;
|
||||
gds_pman_module_bad = 335545007;
|
||||
gds_pman_plugin_notfound = 335545008;
|
||||
gds_sysf_invalid_trig_namespace = 335545009;
|
||||
gds_unexpected_null = 335545010;
|
||||
gds_type_notcompat_blob = 335545011;
|
||||
|
@ -184,7 +184,11 @@ const Config::ConfigEntry Config::entries[MAX_CONFIG_KEY] =
|
||||
{TYPE_INTEGER, "FileSystemCacheSize", (ConfigValue) 0}, // percent
|
||||
{TYPE_STRING, "Providers", (ConfigValue) "Remote, " CURRENT_ENGINE ", Loopback"},
|
||||
{TYPE_STRING, "AuthServer", (ConfigValue) "Srp"},
|
||||
#ifdef WIN_NT
|
||||
{TYPE_STRING, "AuthClient", (ConfigValue) "Srp, Win_Sspi, Legacy_Auth"},
|
||||
#else
|
||||
{TYPE_STRING, "AuthClient", (ConfigValue) "Srp, Legacy_Auth"},
|
||||
#endif
|
||||
{TYPE_STRING, "UserManager", (ConfigValue) "Srp"},
|
||||
{TYPE_STRING, "TracePlugin", (ConfigValue) "fbtrace"},
|
||||
{TYPE_STRING, "SecurityDatabase", (ConfigValue) "$(root)/security3.fdb"}, // security database name
|
||||
|
@ -705,11 +705,11 @@ static const struct {
|
||||
{"eem_engine_notfound", 335545001},
|
||||
{"attachment_in_use", 335545002},
|
||||
{"transaction_in_use", 335545003},
|
||||
{"pman_plugin_notfound", 335545004},
|
||||
{"pman_cannot_load_plugin", 335545005},
|
||||
{"pman_cannot_load_plugin", 335545004},
|
||||
{"pman_module_notfound", 335545005},
|
||||
{"pman_entrypoint_notfound", 335545006},
|
||||
{"pman_bad_conf_index", 335545007},
|
||||
{"pman_unknown_instance", 335545008},
|
||||
{"pman_module_bad", 335545007},
|
||||
{"pman_plugin_notfound", 335545008},
|
||||
{"sysf_invalid_trig_namespace", 335545009},
|
||||
{"unexpected_null", 335545010},
|
||||
{"type_notcompat_blob", 335545011},
|
||||
|
@ -739,11 +739,11 @@ const ISC_STATUS isc_eem_bad_plugin_ver = 335545000L;
|
||||
const ISC_STATUS isc_eem_engine_notfound = 335545001L;
|
||||
const ISC_STATUS isc_attachment_in_use = 335545002L;
|
||||
const ISC_STATUS isc_transaction_in_use = 335545003L;
|
||||
const ISC_STATUS isc_pman_plugin_notfound = 335545004L;
|
||||
const ISC_STATUS isc_pman_cannot_load_plugin = 335545005L;
|
||||
const ISC_STATUS isc_pman_cannot_load_plugin = 335545004L;
|
||||
const ISC_STATUS isc_pman_module_notfound = 335545005L;
|
||||
const ISC_STATUS isc_pman_entrypoint_notfound = 335545006L;
|
||||
const ISC_STATUS isc_pman_bad_conf_index = 335545007L;
|
||||
const ISC_STATUS isc_pman_unknown_instance = 335545008L;
|
||||
const ISC_STATUS isc_pman_module_bad = 335545007L;
|
||||
const ISC_STATUS isc_pman_plugin_notfound = 335545008L;
|
||||
const ISC_STATUS isc_sysf_invalid_trig_namespace = 335545009L;
|
||||
const ISC_STATUS isc_unexpected_null = 335545010L;
|
||||
const ISC_STATUS isc_type_notcompat_blob = 335545011L;
|
||||
@ -1996,11 +1996,11 @@ const ISC_STATUS isc_err_max = 1231;
|
||||
#define isc_eem_engine_notfound 335545001L
|
||||
#define isc_attachment_in_use 335545002L
|
||||
#define isc_transaction_in_use 335545003L
|
||||
#define isc_pman_plugin_notfound 335545004L
|
||||
#define isc_pman_cannot_load_plugin 335545005L
|
||||
#define isc_pman_cannot_load_plugin 335545004L
|
||||
#define isc_pman_module_notfound 335545005L
|
||||
#define isc_pman_entrypoint_notfound 335545006L
|
||||
#define isc_pman_bad_conf_index 335545007L
|
||||
#define isc_pman_unknown_instance 335545008L
|
||||
#define isc_pman_module_bad 335545007L
|
||||
#define isc_pman_plugin_notfound 335545008L
|
||||
#define isc_sysf_invalid_trig_namespace 335545009L
|
||||
#define isc_unexpected_null 335545010L
|
||||
#define isc_type_notcompat_blob 335545011L
|
||||
|
@ -708,11 +708,11 @@ Data source : @4"}, /* eds_statement */
|
||||
{335545001, "External engine @1 not found"}, /* eem_engine_notfound */
|
||||
{335545002, "Attachment is in use"}, /* attachment_in_use */
|
||||
{335545003, "Transaction is in use"}, /* transaction_in_use */
|
||||
{335545004, "Plugin @1 not found"}, /* pman_plugin_notfound */
|
||||
{335545005, "Module @1 exists, but can not be loaded"}, /* pman_cannot_load_plugin */
|
||||
{335545006, "Entrypoint of plugin @1 does not exist"}, /* pman_entrypoint_notfound */
|
||||
{335545007, "Invalid value @1 for parameter index at PluginImpl::getConfigInfo: out of bounds"}, /* pman_bad_conf_index */
|
||||
{335545008, "Plugin @1 does not create @2 instances"}, /* pman_unknown_instance */
|
||||
{335545004, "Error loading plugin @1"}, /* pman_cannot_load_plugin */
|
||||
{335545005, "Loadable module @1 not found"}, /* pman_module_notfound */
|
||||
{335545006, "Standard plugin entrypoint does not exist in module @1"}, /* pman_entrypoint_notfound */
|
||||
{335545007, "Module @1 exists but can not be loaded"}, /* pman_module_bad */
|
||||
{335545008, "Module @1 does not contain plugin @2 type @3"}, /* pman_plugin_notfound */
|
||||
{335545009, "Invalid usage of context namespace DDL_TRIGGER"}, /* sysf_invalid_trig_namespace */
|
||||
{335545010, "Value is NULL but isNull parameter was not informed"}, /* unexpected_null */
|
||||
{335545011, "Type @1 is incompatible with BLOB"}, /* type_notcompat_blob */
|
||||
|
@ -704,11 +704,11 @@ static const struct {
|
||||
{335545001, -901}, /* 681 eem_engine_notfound */
|
||||
{335545002, -532}, /* 682 attachment_in_use */
|
||||
{335545003, -532}, /* 683 transaction_in_use */
|
||||
{335545004, -901}, /* 684 pman_plugin_notfound */
|
||||
{335545005, -901}, /* 685 pman_cannot_load_plugin */
|
||||
{335545004, -901}, /* 684 pman_cannot_load_plugin */
|
||||
{335545005, -901}, /* 685 pman_module_notfound */
|
||||
{335545006, -901}, /* 686 pman_entrypoint_notfound */
|
||||
{335545007, -901}, /* 687 pman_bad_conf_index */
|
||||
{335545008, -901}, /* 688 pman_unknown_instance */
|
||||
{335545007, -901}, /* 687 pman_module_bad */
|
||||
{335545008, -901}, /* 688 pman_plugin_notfound */
|
||||
{335545009, -833}, /* 689 sysf_invalid_trig_namespace */
|
||||
{335545010, -901}, /* 690 unexpected_null */
|
||||
{335545011, -901}, /* 691 type_notcompat_blob */
|
||||
|
@ -704,11 +704,11 @@ static const struct {
|
||||
{335545001, "39000"}, // 681 eem_engine_notfound
|
||||
{335545002, "08002"}, // 682 attachment_in_use
|
||||
{335545003, "25S02"}, // 683 transaction_in_use
|
||||
{335545004, "39000"}, // 684 pman_plugin_notfound
|
||||
{335545005, "39000"}, // 685 pman_cannot_load_plugin
|
||||
{335545006, "39000"}, // 686 pman_entrypoint_notfound
|
||||
{335545007, "39000"}, // 687 pman_bad_conf_index
|
||||
{335545008, "39000"}, // 688 pman_unknown_instance
|
||||
{335545004, "39000"}, // 684 pman_cannot_load_plugin
|
||||
{335545005, "00000"}, // 685 pman_module_notfound
|
||||
{335545006, "00000"}, // 686 pman_entrypoint_notfound
|
||||
{335545007, "00000"}, // 687 pman_module_bad
|
||||
{335545008, "00000"}, // 688 pman_plugin_notfound
|
||||
{335545009, "42000"}, // 689 sysf_invalid_trig_namespace
|
||||
{335545010, "22002"}, // 690 unexpected_null
|
||||
{335545011, "2200G"}, // 691 type_notcompat_blob
|
||||
|
@ -791,11 +791,11 @@ Data source : @4', NULL, NULL)
|
||||
('eem_engine_notfound', 'getEngine', 'ExtEngineManager.cpp', NULL, 0, 681, NULL, 'External engine @1 not found', NULL, NULL)
|
||||
('attachment_in_use', 'GDS_DETACH/GDS_DROP_DATABASE', 'jrd.cpp', NULL, 0, 682, NULL, 'Attachment is in use', NULL, NULL)
|
||||
('transaction_in_use', 'commit/prepare/rollback', 'jrd.cpp', NULL, 0, 683, NULL, 'Transaction is in use', NULL, NULL)
|
||||
('pman_plugin_notfound', 'PluginManager::getPlugin', 'PluginManager.cpp', NULL, 0, 684, NULL, 'Plugin @1 not found', NULL, NULL)
|
||||
('pman_cannot_load_plugin', 'PluginManager::getPlugin', 'PluginManager.cpp', NULL, 0, 685, NULL, 'Module @1 exists, but can not be loaded', NULL, NULL)
|
||||
('pman_entrypoint_notfound', 'PluginManager::getPlugin', 'PluginManager.cpp', NULL, 0, 686, NULL, 'Entrypoint of plugin @1 does not exist', NULL, NULL)
|
||||
('pman_bad_conf_index', 'PluginImpl::getConfigInfo', 'PluginManager.cpp', NULL, 0, 687, NULL, 'Invalid value @1 for parameter index at PluginImpl::getConfigInfo: out of bounds', NULL, NULL)
|
||||
('pman_unknown_instance', 'PluginImpl::getExternalEngineFactory', 'PluginManager.cpp', NULL, 0, 688, NULL, 'Plugin @1 does not create @2 instances', NULL, NULL)
|
||||
('pman_cannot_load_plugin', 'PluginManager::getPlugin', 'PluginManager.cpp', NULL, 0, 684, NULL, 'Error loading plugin @1', NULL, NULL)
|
||||
('pman_module_notfound', 'PluginManager::getPlugin', 'PluginManager.cpp', NULL, 0, 685, NULL, 'Loadable module @1 not found', NULL, NULL)
|
||||
('pman_entrypoint_notfound', 'PluginManager::getPlugin', 'PluginManager.cpp', NULL, 0, 686, NULL, 'Standard plugin entrypoint does not exist in module @1', NULL, NULL)
|
||||
('pman_module_bad', 'PluginImpl::getConfigInfo', 'PluginManager.cpp', NULL, 0, 687, NULL, 'Module @1 exists but can not be loaded', NULL, NULL)
|
||||
('pman_plugin_notfound', 'PluginImpl::getExternalEngineFactory', 'PluginManager.cpp', NULL, 0, 688, NULL, 'Module @1 does not contain plugin @2 type @3', NULL, NULL)
|
||||
('sysf_invalid_trig_namespace', 'evlGetContext', 'SysFunction.cpp', NULL, 0, 689, NULL, 'Invalid usage of context namespace DDL_TRIGGER', NULL, NULL)
|
||||
('unexpected_null', 'ValueMover::getValue', 'ValueImpl.cpp', NULL, 0, 690, NULL, 'Value is NULL but isNull parameter was not informed', NULL, NULL)
|
||||
('type_notcompat_blob', 'ValueImpl::getBlobId', 'ValueImpl.cpp', NULL, 0, 691, NULL, 'Type @1 is incompatible with BLOB', NULL, NULL)
|
||||
|
@ -689,11 +689,11 @@ set bulk_insert INSERT INTO SYSTEM_ERRORS (SQL_CODE, SQL_CLASS, SQL_SUBCLASS, FA
|
||||
(-901, '39', '000', 0, 681, 'eem_engine_notfound', NULL, NULL)
|
||||
(-532, '08', '002', 0, 682, 'attachment_in_use', NULL, NULL)
|
||||
(-532, '25', 'S02', 0, 683, 'transaction_in_use', NULL, NULL)
|
||||
(-901, '39', '000', 0, 684, 'pman_plugin_notfound', NULL, NULL)
|
||||
(-901, '39', '000', 0, 685, 'pman_cannot_load_plugin', NULL, NULL)
|
||||
(-901, '39', '000', 0, 686, 'pman_entrypoint_notfound', NULL, NULL)
|
||||
(-901, '39', '000', 0, 687, 'pman_bad_conf_index', NULL, NULL)
|
||||
(-901, '39', '000', 0, 688, 'pman_unknown_instance', NULL, NULL)
|
||||
(-901, '39', '000', 0, 684, 'pman_cannot_load_plugin', NULL, NULL)
|
||||
(-901, '00', '000', 0, 685, 'pman_module_notfound', NULL, NULL)
|
||||
(-901, '00', '000', 0, 686, 'pman_entrypoint_notfound', NULL, NULL)
|
||||
(-901, '00', '000', 0, 687, 'pman_module_bad', NULL, NULL)
|
||||
(-901, '00', '000', 0, 688, 'pman_plugin_notfound', NULL, NULL)
|
||||
(-833, '42', '000', 0, 689, 'sysf_invalid_trig_namespace', NULL, NULL)
|
||||
(-901, '22', '002', 0, 690, 'unexpected_null', NULL, NULL)
|
||||
(-901, '22', '00G', 0, 691, 'type_notcompat_blob', NULL, NULL)
|
||||
|
@ -127,41 +127,6 @@ namespace
|
||||
return RefPtr<ConfigFile>(NULL);
|
||||
}
|
||||
|
||||
struct PluginLoadInfo
|
||||
{
|
||||
PathName curModule, regName, plugConfigFile;
|
||||
RefPtr<ConfigFile> conf;
|
||||
|
||||
PluginLoadInfo(const char* pluginName)
|
||||
{
|
||||
// define default values for plugin ...
|
||||
curModule = fb_utils::getPrefix(Firebird::DirType::FB_DIR_PLUGINS, pluginName);
|
||||
regName = pluginName;
|
||||
|
||||
// and try to load them from conf file
|
||||
conf = findConfig("Plugin", pluginName);
|
||||
|
||||
if (conf.hasData())
|
||||
{
|
||||
const ConfigFile::Parameter* v = conf->findParameter("RegisterName");
|
||||
if (v)
|
||||
{
|
||||
regName = v->value.ToPathName();
|
||||
}
|
||||
|
||||
v = conf->findParameter("Module");
|
||||
if (v)
|
||||
{
|
||||
curModule = v->value.ToPathName();
|
||||
}
|
||||
}
|
||||
|
||||
plugConfigFile = curModule;
|
||||
changeExtension(plugConfigFile, "conf");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
bool flShutdown = false;
|
||||
|
||||
class ConfigParameterAccess FB_FINAL : public RefCntIface<IConfigEntry, FB_CONFIG_PARAMETER_VERSION>
|
||||
@ -771,6 +736,49 @@ namespace
|
||||
return 1;
|
||||
}
|
||||
|
||||
struct PluginLoadInfo
|
||||
{
|
||||
PathName curModule, regName, plugConfigFile;
|
||||
RefPtr<ConfigFile> conf;
|
||||
bool required;
|
||||
|
||||
PluginLoadInfo(const char* pluginName)
|
||||
{
|
||||
// define default values for plugin ...
|
||||
curModule = fb_utils::getPrefix(Firebird::DirType::FB_DIR_PLUGINS, pluginName);
|
||||
regName = pluginName;
|
||||
required = false;
|
||||
|
||||
// and try to load them from conf file
|
||||
conf = findConfig("Plugin", pluginName);
|
||||
|
||||
if (conf.hasData())
|
||||
{
|
||||
const ConfigFile::Parameter* v = conf->findParameter("RegisterName");
|
||||
if (v)
|
||||
{
|
||||
regName = v->value.ToPathName();
|
||||
}
|
||||
|
||||
v = conf->findParameter("Module");
|
||||
if (v)
|
||||
{
|
||||
curModule = v->value.ToPathName();
|
||||
}
|
||||
|
||||
v = conf->findParameter("Required");
|
||||
if (v)
|
||||
{
|
||||
required = v->asBoolean();
|
||||
}
|
||||
}
|
||||
|
||||
plugConfigFile = curModule;
|
||||
changeExtension(plugConfigFile, "conf");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Provides access to plugins of given type / name.
|
||||
class PluginSet FB_FINAL : public RefCntIface<IPluginSet, FB_PLUGIN_SET_VERSION>
|
||||
{
|
||||
@ -841,11 +849,11 @@ namespace
|
||||
RefPtr<IFirebirdConf> firebirdConf;
|
||||
MasterInterfacePtr masterInterface;
|
||||
|
||||
RefPtr<PluginModule> loadModule(const PathName& modName);
|
||||
RefPtr<PluginModule> loadModule(const PluginLoadInfo& info);
|
||||
|
||||
void loadError(const Arg::StatusVector& error)
|
||||
{
|
||||
error.raise();
|
||||
(Arg::Gds(isc_pman_cannot_load_plugin) << currentName << error).raise();
|
||||
}
|
||||
};
|
||||
|
||||
@ -882,7 +890,7 @@ namespace
|
||||
RefPtr<PluginModule> m(modules->findModule(info.curModule));
|
||||
if (!m.hasData() && !flShutdown)
|
||||
{
|
||||
m = loadModule(info.curModule);
|
||||
m = loadModule(info);
|
||||
}
|
||||
if (!m.hasData())
|
||||
{
|
||||
@ -892,9 +900,8 @@ namespace
|
||||
int r = m->findPlugin(interfaceType, info.regName);
|
||||
if (r < 0)
|
||||
{
|
||||
gds__log("Misconfigured: module %s does not contain plugin %s type %d",
|
||||
info.curModule.c_str(), info.regName.c_str(), interfaceType);
|
||||
continue;
|
||||
loadError(Arg::Gds(isc_pman_plugin_notfound) <<
|
||||
info.curModule << info.regName << Arg::Num(interfaceType));
|
||||
}
|
||||
|
||||
currentPlugin = new ConfiguredPlugin(m, r, info.conf, info.plugConfigFile, currentName);
|
||||
@ -909,9 +916,9 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
RefPtr<PluginModule> PluginSet::loadModule(const PathName& asIsModuleName)
|
||||
RefPtr<PluginModule> PluginSet::loadModule(const PluginLoadInfo& info)
|
||||
{
|
||||
PathName fixedModuleName(asIsModuleName);
|
||||
PathName fixedModuleName(info.curModule);
|
||||
|
||||
ModuleLoader::Module* module = ModuleLoader::loadModule(fixedModuleName);
|
||||
|
||||
@ -925,13 +932,17 @@ namespace
|
||||
{
|
||||
if (ModuleLoader::isLoadableModule(fixedModuleName))
|
||||
{
|
||||
loadError(Arg::Gds(isc_pman_cannot_load_plugin) << fixedModuleName);
|
||||
loadError(Arg::Gds(isc_pman_module_bad) << fixedModuleName);
|
||||
}
|
||||
if (info.required)
|
||||
{
|
||||
loadError(Arg::Gds(isc_pman_module_notfound) << fixedModuleName);
|
||||
}
|
||||
|
||||
return RefPtr<PluginModule>(NULL);
|
||||
}
|
||||
|
||||
RefPtr<PluginModule> rc(new PluginModule(module, asIsModuleName));
|
||||
RefPtr<PluginModule> rc(new PluginModule(module, info.curModule));
|
||||
PluginEntrypoint* startModule;
|
||||
if (module->findSymbol(STRINGIZE(FB_PLUGIN_ENTRY_POINT), startModule))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user