mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-27 18:03:04 +01:00
Fix AV in trace when UNICODE collation is not found - thanks to Alex
This commit is contained in:
parent
7f664fc33a
commit
2cafed53f7
@ -106,7 +106,6 @@ void TraceCfgReader::readConfig()
|
|||||||
|
|
||||||
charset cs;
|
charset cs;
|
||||||
IntlUtil::initUtf8Charset(&cs);
|
IntlUtil::initUtf8Charset(&cs);
|
||||||
texttype tt;
|
|
||||||
|
|
||||||
string collAttributes("ICU-VERSION=");
|
string collAttributes("ICU-VERSION=");
|
||||||
collAttributes += Jrd::UnicodeUtil::DEFAULT_ICU_VERSION;
|
collAttributes += Jrd::UnicodeUtil::DEFAULT_ICU_VERSION;
|
||||||
@ -116,7 +115,10 @@ void TraceCfgReader::readConfig()
|
|||||||
collAttributesBuffer.push(reinterpret_cast<const UCHAR*>(collAttributes.c_str()),
|
collAttributesBuffer.push(reinterpret_cast<const UCHAR*>(collAttributes.c_str()),
|
||||||
collAttributes.length());
|
collAttributes.length());
|
||||||
|
|
||||||
IntlUtil::initUnicodeCollation(&tt, &cs, "UNICODE", 0, collAttributesBuffer, string());
|
texttype tt;
|
||||||
|
if (!IntlUtil::initUnicodeCollation(&tt, &cs, "UNICODE", 0, collAttributesBuffer, string()))
|
||||||
|
fatal_exception::raiseFmt("cannot initialize UNICODE collation to use in trace plugin");
|
||||||
|
|
||||||
AutoPtr<Jrd::CharSet> charSet(Jrd::CharSet::createInstance(*getDefaultMemoryPool(), 0, &cs));
|
AutoPtr<Jrd::CharSet> charSet(Jrd::CharSet::createInstance(*getDefaultMemoryPool(), 0, &cs));
|
||||||
Jrd::TextType textType(0, &tt, charSet);
|
Jrd::TextType textType(0, &tt, charSet);
|
||||||
|
|
||||||
|
@ -138,7 +138,10 @@ TracePluginImpl::TracePluginImpl(const TracePluginConfig &configuration, TraceIn
|
|||||||
}
|
}
|
||||||
|
|
||||||
IntlUtil::initUtf8Charset(&cs);
|
IntlUtil::initUtf8Charset(&cs);
|
||||||
IntlUtil::initUnicodeCollation(&tt, &cs, "UNICODE", 0, UCharBuffer(), string());
|
|
||||||
|
if (!IntlUtil::initUnicodeCollation(&tt, &cs, "UNICODE", 0, UCharBuffer(), string()))
|
||||||
|
fatal_exception::raiseFmt("cannot initialize UNICODE collation to use in trace plugin");
|
||||||
|
|
||||||
charSet = Jrd::CharSet::createInstance(*getDefaultMemoryPool(), 0, &cs);
|
charSet = Jrd::CharSet::createInstance(*getDefaultMemoryPool(), 0, &cs);
|
||||||
textType = FB_NEW(*getDefaultMemoryPool()) Jrd::TextType(0, &tt, charSet);
|
textType = FB_NEW(*getDefaultMemoryPool()) Jrd::TextType(0, &tt, charSet);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user