MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / lookupCollation

Method lookupCollation

src/jrd/IntlManager.cpp:642–700  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

640
641
642void IntlManager::lookupCollation(const string& collationName,
643 const string& charSetName,
644 USHORT attributes, const UCHAR* specificAttributes,
645 ULONG specificAttributesLen, bool ignoreAttributes,
646 texttype* tt)
647{
648 ExternalInfo charSetExternalInfo;
649 ExternalInfo collationExternalInfo;
650 char statusBuffer[BUFFER_LARGE] = "";
651
652 if (charSetCollations->get(charSetName + ":" + charSetName, charSetExternalInfo) &&
653 charSetCollations->get(charSetName + ":" + collationName, collationExternalInfo))
654 {
655 ModuleLoader::Module* module = nullptr;
656
657 if (collationExternalInfo.moduleName.hasData())
658 modules->get(collationExternalInfo.moduleName, module);
659
660 pfn_INTL_lookup_texttype_with_status lookupStatusFunction = nullptr;
661
662 if (collationExternalInfo.moduleName.isEmpty())
663 lookupStatusFunction = INTL_builtin_lookup_texttype_status;
664 else if (module)
665 module->findSymbol(nullptr, STRINGIZE(TEXTTYPE_WITH_STATUS_ENTRYPOINT), lookupStatusFunction);
666
667 if (lookupStatusFunction)
668 {
669 if ((*lookupStatusFunction)(statusBuffer, sizeof(statusBuffer),
670 tt, collationExternalInfo.name.c_str(), charSetExternalInfo.name.c_str(),
671 attributes, specificAttributes, specificAttributesLen, ignoreAttributes,
672 collationExternalInfo.configInfo.c_str()))
673 {
674 return;
675 }
676 }
677 else if (module)
678 {
679 pfn_INTL_lookup_texttype lookupFunction = nullptr;
680 module->findSymbol(nullptr, STRINGIZE(TEXTTYPE_ENTRYPOINT), lookupFunction);
681
682 if (lookupFunction &&
683 (*lookupFunction)(tt, collationExternalInfo.name.c_str(), charSetExternalInfo.name.c_str(),
684 attributes, specificAttributes, specificAttributesLen, ignoreAttributes,
685 collationExternalInfo.configInfo.c_str()))
686 {
687 return;
688 }
689 }
690 }
691
692 if (statusBuffer[0])
693 {
694 (Arg::Gds(isc_collation_not_installed) << collationName << charSetName <<
695 Arg::Gds(isc_random) << statusBuffer
696 ).raise();
697 }
698 else
699 (Arg::Gds(isc_collation_not_installed) << collationName << charSetName).raise();

Callers

nothing calls this directly

Calls 7

GdsClass · 0.85
getMethod · 0.45
hasDataMethod · 0.45
isEmptyMethod · 0.45
findSymbolMethod · 0.45
c_strMethod · 0.45
raiseMethod · 0.45

Tested by

no test coverage detected