8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-26 06:43:04 +01:00

Fix AV in trace when UNICODE collation is not found - thanks to Alex

This commit is contained in:
asfernandes 2009-05-27 00:09:52 +00:00
parent 7f664fc33a
commit 2cafed53f7
2 changed files with 8 additions and 3 deletions

View File

@ -106,7 +106,6 @@ void TraceCfgReader::readConfig()
charset cs;
IntlUtil::initUtf8Charset(&cs);
texttype tt;
string collAttributes("ICU-VERSION=");
collAttributes += Jrd::UnicodeUtil::DEFAULT_ICU_VERSION;
@ -116,7 +115,10 @@ void TraceCfgReader::readConfig()
collAttributesBuffer.push(reinterpret_cast<const UCHAR*>(collAttributes.c_str()),
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));
Jrd::TextType textType(0, &tt, charSet);

View File

@ -138,7 +138,10 @@ TracePluginImpl::TracePluginImpl(const TracePluginConfig &configuration, TraceIn
}
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);
textType = FB_NEW(*getDefaultMemoryPool()) Jrd::TextType(0, &tt, charSet);