Skip to content

Commit 2e092bf

Browse files
committed
Fixed CORE-6433: Several firebird servers crash
1 parent 15839cc commit 2e092bf

4 files changed

Lines changed: 9 additions & 11 deletions

File tree

src/jrd/Attachment.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ using namespace Firebird;
5252

5353

5454
// static method
55-
Jrd::Attachment* Jrd::Attachment::create(Database* dbb, Firebird::IProvider* provider)
55+
Jrd::Attachment* Jrd::Attachment::create(Database* dbb, JProvider* provider)
5656
{
5757
MemoryPool* const pool = dbb->createPool();
5858

@@ -171,7 +171,7 @@ void Jrd::Attachment::backupStateReadUnLock(thread_db* tdbb)
171171
}
172172

173173

174-
Jrd::Attachment::Attachment(MemoryPool* pool, Database* dbb, IProvider* provider)
174+
Jrd::Attachment::Attachment(MemoryPool* pool, Database* dbb, JProvider* provider)
175175
: att_pool(pool),
176176
att_memory_stats(&dbb->dbb_memory_stats),
177177
att_database(dbb),

src/jrd/Attachment.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ class Attachment : public pool_alloc<type_att>
228228
};
229229

230230
public:
231-
static Attachment* create(Database* dbb, Firebird::IProvider* provider);
231+
static Attachment* create(Database* dbb, JProvider* provider);
232232
static void destroy(Attachment* const attachment);
233233

234234
MemoryPool* const att_pool; // Memory pool
@@ -384,17 +384,17 @@ class Attachment : public pool_alloc<type_att>
384384

385385
JAttachment* getInterface() throw();
386386

387-
Firebird::IProvider* getProvider()
387+
JProvider* getProvider()
388388
{
389389
fb_assert(att_provider);
390390
return att_provider;
391391
}
392392

393393
private:
394-
Attachment(MemoryPool* pool, Database* dbb, Firebird::IProvider* provider);
394+
Attachment(MemoryPool* pool, Database* dbb, JProvider* provider);
395395
~Attachment();
396396

397-
Firebird::IProvider* att_provider; // Provider which created this attachment
397+
JProvider* att_provider; // Provider which created this attachment
398398
};
399399

400400

src/jrd/extds/InternalDS.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,7 @@ void InternalConnection::attach(thread_db* tdbb, const PathName& dbName,
167167
FbLocalStatus status;
168168
{
169169
EngineCallbackGuard guard(tdbb, *this, FB_FUNCTION);
170-
AutoPlugin<JProvider> jInstance(JProvider::getInstance());
171-
jInstance->setDbCryptCallback(&status, tdbb->getAttachment()->att_crypt_callback);
172-
m_attachment.assignRefNoIncr(jInstance->attachDatabase(&status, m_dbName.c_str(),
170+
m_attachment.assignRefNoIncr(attachment->getProvider()->attachDatabase(&status, m_dbName.c_str(),
173171
newDpb.getBufferLength(), newDpb.getBuffer()));
174172
}
175173

src/jrd/jrd.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,7 +1056,7 @@ static void unwindAttach(thread_db* tdbb, const Exception& ex, FbStatusVector*
10561056
Jrd::Attachment* attachment, Database* dbb, bool internalFlag);
10571057
static JAttachment* initAttachment(thread_db*, const PathName&, const PathName&, RefPtr<const Config>, bool,
10581058
const DatabaseOptions&, RefMutexUnlock&, IPluginConfig*, JProvider*);
1059-
static JAttachment* create_attachment(const PathName&, Database*, IProvider* provider, const DatabaseOptions&, bool newDb);
1059+
static JAttachment* create_attachment(const PathName&, Database*, JProvider* provider, const DatabaseOptions&, bool newDb);
10601060
static void prepare_tra(thread_db*, jrd_tra*, USHORT, const UCHAR*);
10611061
static void start_transaction(thread_db* tdbb, bool transliterate, jrd_tra** tra_handle,
10621062
Jrd::Attachment* attachment, unsigned int tpb_length, const UCHAR* tpb);
@@ -6217,7 +6217,7 @@ static JAttachment* initAttachment(thread_db* tdbb, const PathName& expanded_nam
62176217

62186218
static JAttachment* create_attachment(const PathName& alias_name,
62196219
Database* dbb,
6220-
IProvider* provider,
6220+
JProvider* provider,
62216221
const DatabaseOptions& options,
62226222
bool newDb)
62236223
{

0 commit comments

Comments
 (0)