8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-02-02 10:40:38 +01:00

Avoid GBAK's mandatory runtime dependency on ICU, load it only when

really needed (-skip_data switch is specified).
This commit is contained in:
Dmitry Yemanov 2016-03-16 19:10:51 +03:00
parent 47056cb3b5
commit faa5d8b003
2 changed files with 7 additions and 5 deletions

View File

@ -2401,8 +2401,6 @@ void BurpGlobals::setupSkipData(const Firebird::string& regexp)
// msg 356 regular expression to skip tables was already set
}
Jrd::TextType* textType = unicodeCollation.getTextType();
// Compile skip relation expressions
try
{
@ -2412,6 +2410,11 @@ void BurpGlobals::setupSkipData(const Firebird::string& regexp)
if (!uSvc->utf8FileNames())
ISC_systemToUtf8(filter);
if (!unicodeCollation)
unicodeCollation = FB_NEW UnicodeCollationHolder(*getDefaultMemoryPool());
Jrd::TextType* const textType = unicodeCollation->getTextType();
skipDataMatcher.reset(FB_NEW Firebird::SimilarToMatcher<UCHAR, Jrd::UpcaseConverter<> >(
*getDefaultMemoryPool(), textType, (const UCHAR*) filter.c_str(),
filter.length(), '\\', true));

View File

@ -915,8 +915,7 @@ public:
verboseInterval(10000),
flag_on_line(true),
firstMap(true),
stdIoMode(false),
unicodeCollation(*getDefaultMemoryPool())
stdIoMode(false)
{
// this is VERY dirty hack to keep current behaviour
memset (&gbl_database_file_name, 0,
@ -1089,7 +1088,7 @@ public:
bool flag_on_line; // indicates whether we will bring the database on-line
bool firstMap; // this is the first time we entered get_mapping()
bool stdIoMode; // stdin or stdout is used as backup file
UnicodeCollationHolder unicodeCollation;
Firebird::AutoPtr<UnicodeCollationHolder> unicodeCollation;
Firebird::AutoPtr<Firebird::SimilarToMatcher<UCHAR, Jrd::UpcaseConverter<> > > skipDataMatcher;
public: