Skip to content

Commit 40b842e

Browse files
committed
Fixed #9068: Regression in fb6.0 restore "Implementation of text subtype 21 not located". Also fixed an issue with cache of charsets initialization.
1 parent 3427fbc commit 40b842e

3 files changed

Lines changed: 36 additions & 3 deletions

File tree

src/jrd/dfw.epp

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ static bool delete_trigger(thread_db*, SSHORT, DeferredWork*, jrd_tra*);
392392
static bool modify_trigger(thread_db*, SSHORT, DeferredWork*, jrd_tra*);
393393
static bool create_collation(thread_db*, SSHORT, DeferredWork*, jrd_tra*);
394394
static bool delete_collation(thread_db*, SSHORT, DeferredWork*, jrd_tra*);
395+
static bool commit_charset(thread_db*, SSHORT, DeferredWork*, jrd_tra*);
395396
static bool delete_exception(thread_db*, SSHORT, DeferredWork*, jrd_tra*);
396397
static bool set_generator(thread_db*, SSHORT, DeferredWork*, jrd_tra*);
397398
static bool delete_generator(thread_db*, SSHORT, DeferredWork*, jrd_tra*);
@@ -1207,6 +1208,7 @@ static inline constexpr deferred_task task_table[] =
12071208
{ dfw_delete_prm, delete_parameter },
12081209
{ dfw_create_collation, create_collation },
12091210
{ dfw_delete_collation, delete_collation },
1211+
{ dfw_commit_charset, commit_charset },
12101212
{ dfw_delete_exception, delete_exception },
12111213
{ dfw_set_generator, set_generator },
12121214
{ dfw_delete_generator, delete_generator },
@@ -3377,6 +3379,37 @@ static bool create_collation(thread_db* tdbb, SSHORT phase, DeferredWork* work,
33773379
work->getQualifiedName(), false);
33783380
return true;
33793381

3382+
case 2:
3383+
return true;
3384+
3385+
case 3:
3386+
DFW_post_work(transaction, dfw_commit_charset, nullptr, nullptr, CSetId(id));
3387+
return true;
3388+
}
3389+
3390+
return false;
3391+
}
3392+
3393+
3394+
static bool commit_charset(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_tra* transaction)
3395+
{
3396+
/**************************************
3397+
*
3398+
* c o m m i t _ c h a r s e t
3399+
*
3400+
**************************************
3401+
*
3402+
* Functional description
3403+
* Execute commit on charset id.
3404+
*
3405+
**************************************/
3406+
3407+
SET_TDBB(tdbb);
3408+
CSetId id(work->dfw_id);
3409+
3410+
switch (phase)
3411+
{
3412+
case 1:
33803413
case 2:
33813414
case 3:
33823415
case 4:
@@ -3387,7 +3420,7 @@ static bool create_collation(thread_db* tdbb, SSHORT phase, DeferredWork* work,
33873420
case 7:
33883421
{
33893422
auto* cs = MetadataCache::getPerm<Cached::CharSet>(tdbb, id, 0);
3390-
// fb_assert(cs); -------------- breaks INI_ini()
3423+
fb_assert(cs);
33913424
if (cs)
33923425
cs->commit(tdbb);
33933426
}

src/jrd/ini.epp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1888,7 +1888,7 @@ static void store_intlnames(thread_db* tdbb, NonRelationSecurity& security)
18881888
for (const IntlManager::CharSetDefinition* charSet = IntlManager::defaultCharSets;
18891889
charSet->name; ++charSet)
18901890
{
1891-
MetadataCache::getVersioned<Cached::CharSet>(tdbb, charSet->id, CacheFlag::UPGRADE | CacheFlag::NOCOMMIT);
1891+
MetadataCache::newVersion<Cached::CharSet>(tdbb, charSet->id);
18921892
}
18931893
}
18941894

src/jrd/tra.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,8 +536,8 @@ enum dfw_t : int {
536536
dfw_delete_prm,
537537
dfw_create_collation,
538538
dfw_delete_collation,
539+
dfw_commit_charset,
539540
dfw_delete_exception,
540-
//dfw_unlink_file,
541541
dfw_delete_generator,
542542
dfw_create_function,
543543
dfw_modify_function,

0 commit comments

Comments
 (0)