From: <ale...@us...> - 2014-07-04 08:25:58
|
Revision: 59822 http://sourceforge.net/p/firebird/code/59822 Author: alexpeshkoff Date: 2014-07-04 08:25:49 +0000 (Fri, 04 Jul 2014) Log Message: ----------- Fixed CORE-4478: Failure to load provider/plugin not reported Modified Paths: -------------- firebird/trunk/lang_helpers/gds_codes.ftn firebird/trunk/lang_helpers/gds_codes.pas firebird/trunk/src/common/config/config.cpp firebird/trunk/src/include/gen/codetext.h firebird/trunk/src/include/gen/iberror.h firebird/trunk/src/include/gen/msgs.h firebird/trunk/src/include/gen/sql_code.h firebird/trunk/src/include/gen/sql_state.h firebird/trunk/src/msgs/messages2.sql firebird/trunk/src/msgs/system_errors2.sql firebird/trunk/src/yvalve/PluginManager.cpp Modified: firebird/trunk/lang_helpers/gds_codes.ftn =================================================================== --- firebird/trunk/lang_helpers/gds_codes.ftn 2014-07-04 00:50:22 UTC (rev 59821) +++ firebird/trunk/lang_helpers/gds_codes.ftn 2014-07-04 08:25:49 UTC (rev 59822) @@ -1418,16 +1418,16 @@ 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 Modified: firebird/trunk/lang_helpers/gds_codes.pas =================================================================== --- firebird/trunk/lang_helpers/gds_codes.pas 2014-07-04 00:50:22 UTC (rev 59821) +++ firebird/trunk/lang_helpers/gds_codes.pas 2014-07-04 08:25:49 UTC (rev 59822) @@ -716,11 +716,11 @@ 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; Modified: firebird/trunk/src/common/config/config.cpp =================================================================== --- firebird/trunk/src/common/config/config.cpp 2014-07-04 00:50:22 UTC (rev 59821) +++ firebird/trunk/src/common/config/config.cpp 2014-07-04 08:25:49 UTC (rev 59822) @@ -184,7 +184,11 @@ {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 Modified: firebird/trunk/src/include/gen/codetext.h =================================================================== --- firebird/trunk/src/include/gen/codetext.h 2014-07-04 00:50:22 UTC (rev 59821) +++ firebird/trunk/src/include/gen/codetext.h 2014-07-04 08:25:49 UTC (rev 59822) @@ -705,11 +705,11 @@ {"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}, Modified: firebird/trunk/src/include/gen/iberror.h =================================================================== --- firebird/trunk/src/include/gen/iberror.h 2014-07-04 00:50:22 UTC (rev 59821) +++ firebird/trunk/src/include/gen/iberror.h 2014-07-04 08:25:49 UTC (rev 59822) @@ -739,11 +739,11 @@ 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 @@ #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 Modified: firebird/trunk/src/include/gen/msgs.h =================================================================== --- firebird/trunk/src/include/gen/msgs.h 2014-07-04 00:50:22 UTC (rev 59821) +++ firebird/trunk/src/include/gen/msgs.h 2014-07-04 08:25:49 UTC (rev 59822) @@ -708,11 +708,11 @@ {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 */ Modified: firebird/trunk/src/include/gen/sql_code.h =================================================================== --- firebird/trunk/src/include/gen/sql_code.h 2014-07-04 00:50:22 UTC (rev 59821) +++ firebird/trunk/src/include/gen/sql_code.h 2014-07-04 08:25:49 UTC (rev 59822) @@ -704,11 +704,11 @@ {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 */ Modified: firebird/trunk/src/include/gen/sql_state.h =================================================================== --- firebird/trunk/src/include/gen/sql_state.h 2014-07-04 00:50:22 UTC (rev 59821) +++ firebird/trunk/src/include/gen/sql_state.h 2014-07-04 08:25:49 UTC (rev 59822) @@ -704,11 +704,11 @@ {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 Modified: firebird/trunk/src/msgs/messages2.sql =================================================================== --- firebird/trunk/src/msgs/messages2.sql 2014-07-04 00:50:22 UTC (rev 59821) +++ firebird/trunk/src/msgs/messages2.sql 2014-07-04 08:25:49 UTC (rev 59822) @@ -791,11 +791,11 @@ ('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) Modified: firebird/trunk/src/msgs/system_errors2.sql =================================================================== --- firebird/trunk/src/msgs/system_errors2.sql 2014-07-04 00:50:22 UTC (rev 59821) +++ firebird/trunk/src/msgs/system_errors2.sql 2014-07-04 08:25:49 UTC (rev 59822) @@ -689,11 +689,11 @@ (-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) Modified: firebird/trunk/src/yvalve/PluginManager.cpp =================================================================== --- firebird/trunk/src/yvalve/PluginManager.cpp 2014-07-04 00:50:22 UTC (rev 59821) +++ firebird/trunk/src/yvalve/PluginManager.cpp 2014-07-04 08:25:49 UTC (rev 59822) @@ -127,41 +127,6 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ } } - 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 @@ { 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)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |