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

Cleanup: avoid deprecated entries in regular calls

This commit is contained in:
AlexPeshkoff 2021-11-09 12:48:04 +03:00
parent d8346d268c
commit a16ac21317
3 changed files with 176 additions and 86 deletions

View File

@ -89,6 +89,7 @@ private:
Firebird::RefPtr<StableAttachmentPart> sAtt;
void freeEngineData(Firebird::CheckStatusWrapper* status);
void internalClose(Firebird::CheckStatusWrapper* status);
};
class JTransaction FB_FINAL :
@ -145,6 +146,9 @@ private:
JTransaction(JTransaction* from);
void freeEngineData(Firebird::CheckStatusWrapper* status);
void internalCommit(Firebird::CheckStatusWrapper* status);
void internalRollback(Firebird::CheckStatusWrapper* status);
void internalDisconnect(Firebird::CheckStatusWrapper* status);
};
class JResultSet FB_FINAL :
@ -483,6 +487,9 @@ private:
{
att = NULL;
}
void internalDetach(Firebird::CheckStatusWrapper* status);
void internalDropDatabase(Firebird::CheckStatusWrapper* status);
};
class JService FB_FINAL :

View File

@ -2483,13 +2483,19 @@ void JAttachment::cancelOperation(CheckStatusWrapper* user_status, int option)
void JBlob::close(CheckStatusWrapper* user_status)
{
deprecatedClose(user_status);
internalClose(user_status);
if (user_status->isEmpty())
release();
}
void JBlob::deprecatedClose(CheckStatusWrapper* user_status)
{
internalClose(user_status);
}
void JBlob::internalClose(CheckStatusWrapper* user_status)
{
/**************************************
*
@ -2530,13 +2536,19 @@ void JBlob::deprecatedClose(CheckStatusWrapper* user_status)
void JTransaction::commit(CheckStatusWrapper* user_status)
{
deprecatedCommit(user_status);
internalCommit(user_status);
if (user_status->isEmpty())
release();
}
void JTransaction::deprecatedCommit(CheckStatusWrapper* user_status)
{
internalCommit(user_status);
}
void JTransaction::internalCommit(CheckStatusWrapper* user_status)
{
/**************************************
*
@ -3242,18 +3254,8 @@ void JAttachment::executeDyn(CheckStatusWrapper* status, ITransaction* /*tra*/,
}
void JAttachment::deprecatedDetach(CheckStatusWrapper* user_status)
void JAttachment::internalDetach(CheckStatusWrapper* user_status)
{
/**************************************
*
* g d s _ $ d e t a c h
*
**************************************
*
* Functional description
* Close down a database.
*
**************************************/
if (!att->getHandle())
return; // already detached
@ -3261,19 +3263,15 @@ void JAttachment::deprecatedDetach(CheckStatusWrapper* user_status)
}
void JAttachment::deprecatedDetach(CheckStatusWrapper* user_status)
{
internalDetach(user_status);
}
void JAttachment::detach(CheckStatusWrapper* user_status)
{
/**************************************
*
* g d s _ $ d e t a c h
*
**************************************
*
* Functional description
* Close down a database.
*
**************************************/
deprecatedDetach(user_status);
internalDetach(user_status);
if (user_status->isEmpty())
release();
}
@ -3284,6 +3282,7 @@ void JAttachment::freeEngineData(CheckStatusWrapper* user_status, bool forceFree
/**************************************
*
* f r e e E n g i n e D a t a
* former g d s _ $ d e t a c h
*
**************************************
*
@ -3355,13 +3354,19 @@ void JAttachment::freeEngineData(CheckStatusWrapper* user_status, bool forceFree
void JAttachment::dropDatabase(CheckStatusWrapper* user_status)
{
deprecatedDropDatabase(user_status);
internalDropDatabase(user_status);
if (user_status->isEmpty())
release();
}
void JAttachment::deprecatedDropDatabase(CheckStatusWrapper* user_status)
{
internalDropDatabase(user_status);
}
void JAttachment::internalDropDatabase(CheckStatusWrapper* user_status)
{
/**************************************
*
@ -3936,16 +3941,6 @@ JTransaction* JAttachment::reconnectTransaction(CheckStatusWrapper* user_status,
void JRequest::deprecatedFree(CheckStatusWrapper* user_status)
{
/**************************************
*
* g d s _ $ r e l e a s e _ r e q u e s t
*
**************************************
*
* Functional description
* Release a request.
*
**************************************/
freeEngineData(user_status);
}
@ -4075,13 +4070,19 @@ void JTransaction::rollbackRetaining(CheckStatusWrapper* user_status)
void JTransaction::rollback(CheckStatusWrapper* user_status)
{
deprecatedRollback(user_status);
internalRollback(user_status);
if (user_status->isEmpty())
release();
}
void JTransaction::deprecatedRollback(CheckStatusWrapper* user_status)
{
internalRollback(user_status);
}
void JTransaction::internalRollback(CheckStatusWrapper* user_status)
{
/**************************************
*
@ -4121,13 +4122,19 @@ void JTransaction::deprecatedRollback(CheckStatusWrapper* user_status)
void JTransaction::disconnect(CheckStatusWrapper* user_status)
{
deprecatedDisconnect(user_status);
internalDisconnect(user_status);
if (user_status->isEmpty())
release();
}
void JTransaction::deprecatedDisconnect(CheckStatusWrapper* user_status)
{
internalDisconnect(user_status);
}
void JTransaction::internalDisconnect(CheckStatusWrapper* user_status)
{
try
{
@ -4264,16 +4271,6 @@ JService* JProvider::attachServiceManager(CheckStatusWrapper* user_status, const
void JService::deprecatedDetach(CheckStatusWrapper* user_status)
{
/**************************************
*
* g d s _ $ s e r v i c e _ d e t a c h
*
**************************************
*
* Functional description
* Close down a service.
*
**************************************/
freeEngineData(user_status);
}

View File

@ -185,6 +185,8 @@ public:
private:
void freeClientData(CheckStatusWrapper* status, bool force = false);
void internalCancel(Firebird::CheckStatusWrapper* status);
void internalClose(Firebird::CheckStatusWrapper* status);
Rbl* blob;
};
@ -254,6 +256,9 @@ private:
{ }
void freeClientData(CheckStatusWrapper* status, bool force = false);
void internalCommit(Firebird::CheckStatusWrapper* status);
void internalRollback(Firebird::CheckStatusWrapper* status);
void internalDisconnect(Firebird::CheckStatusWrapper* status);
Attachment* remAtt;
Rtr* transaction;
@ -303,6 +308,7 @@ public:
private:
void releaseStatement();
void freeClientData(CheckStatusWrapper* status, bool force = false);
void internalClose(CheckStatusWrapper* status);
Statement* stmt;
RefPtr<IMessageMetadata> outputFormat;
@ -355,6 +361,7 @@ public:
private:
void freeClientData(CheckStatusWrapper* status, bool force = false);
void internalClose(Firebird::CheckStatusWrapper* status);
void releaseStatement();
void setServerInfo();
@ -589,6 +596,7 @@ public:
private:
void freeClientData(CheckStatusWrapper* status, bool force = false);
void internalClose(CheckStatusWrapper* status);
Attachment* attachment;
};
@ -691,6 +699,7 @@ public:
private:
void freeClientData(CheckStatusWrapper* status, bool force = false);
void internalFree(CheckStatusWrapper* status);
StatementMetadata metadata;
Attachment* remAtt;
@ -742,6 +751,7 @@ public:
private:
void freeClientData(CheckStatusWrapper* status, bool force = false);
void internalFree(CheckStatusWrapper* status);
Attachment* remAtt;
Rrq* rq;
@ -780,6 +790,7 @@ public:
private:
void freeClientData(CheckStatusWrapper* status, bool force = false);
void internalCancel(CheckStatusWrapper* status);
Rvnt* rvnt;
Rdb* rdb;
@ -889,6 +900,8 @@ public:
private:
void execWithCheck(CheckStatusWrapper* status, const string& stmt);
void freeClientData(CheckStatusWrapper* status, bool force = false);
void internalDetach(Firebird::CheckStatusWrapper* status);
void internalDropDatabase(Firebird::CheckStatusWrapper* status);
SLONG getSingleInfo(CheckStatusWrapper* status, UCHAR infoItem);
Rdb* rdb;
@ -929,6 +942,7 @@ public:
private:
void freeClientData(CheckStatusWrapper* status, bool force = false);
void internalDetach(CheckStatusWrapper* status);
Rdb* rdb;
};
@ -1298,7 +1312,7 @@ void Blob::freeClientData(CheckStatusWrapper* status, bool force)
}
void Blob::deprecatedCancel(CheckStatusWrapper* status)
void Blob::internalCancel(CheckStatusWrapper* status)
{
/**************************************
*
@ -1317,13 +1331,19 @@ void Blob::deprecatedCancel(CheckStatusWrapper* status)
void Blob::cancel(CheckStatusWrapper* status)
{
deprecatedCancel(status);
internalCancel(status);
if (status->isEmpty())
release();
}
void Blob::deprecatedClose(CheckStatusWrapper* status)
void Blob::deprecatedCancel(CheckStatusWrapper* status)
{
internalCancel(status);
}
void Blob::internalClose(CheckStatusWrapper* status)
{
/**************************************
*
@ -1364,12 +1384,18 @@ void Blob::deprecatedClose(CheckStatusWrapper* status)
void Blob::close(CheckStatusWrapper* status)
{
deprecatedClose(status);
internalClose(status);
if (status->isEmpty())
release();
}
void Blob::deprecatedClose(CheckStatusWrapper* status)
{
internalClose(status);
}
void Events::freeClientData(CheckStatusWrapper* status, bool force)
{
/**************************************
@ -1452,7 +1478,7 @@ void Events::freeClientData(CheckStatusWrapper* status, bool force)
}
void Events::deprecatedCancel(CheckStatusWrapper* status)
void Events::internalCancel(CheckStatusWrapper* status)
{
/**************************************
*
@ -1471,13 +1497,19 @@ void Events::deprecatedCancel(CheckStatusWrapper* status)
void Events::cancel(CheckStatusWrapper* status)
{
deprecatedCancel(status);
internalCancel(status);
if (status->isEmpty())
release();
}
void Transaction::deprecatedCommit(CheckStatusWrapper* status)
void Events::deprecatedCancel(CheckStatusWrapper* status)
{
internalCancel(status);
}
void Transaction::internalCommit(CheckStatusWrapper* status)
{
/**************************************
*
@ -1514,12 +1546,18 @@ void Transaction::deprecatedCommit(CheckStatusWrapper* status)
void Transaction::commit(CheckStatusWrapper* status)
{
deprecatedCommit(status);
internalCommit(status);
if (status->isEmpty())
release();
}
void Transaction::deprecatedCommit(CheckStatusWrapper* status)
{
internalCommit(status);
}
void Transaction::commitRetaining(CheckStatusWrapper* status)
{
/**************************************
@ -2044,7 +2082,7 @@ void Attachment::freeClientData(CheckStatusWrapper* status, bool force)
}
void Attachment::deprecatedDetach(CheckStatusWrapper* status)
void Attachment::internalDetach(CheckStatusWrapper* status)
{
/**************************************
*
@ -2063,13 +2101,19 @@ void Attachment::deprecatedDetach(CheckStatusWrapper* status)
void Attachment::detach(CheckStatusWrapper* status)
{
deprecatedDetach(status);
internalDetach(status);
if (status->isEmpty())
release();
}
void Attachment::deprecatedDropDatabase(CheckStatusWrapper* status)
void Attachment::deprecatedDetach(CheckStatusWrapper* status)
{
internalDetach(status);
}
void Attachment::internalDropDatabase(CheckStatusWrapper* status)
{
/**************************************
*
@ -2129,12 +2173,18 @@ void Attachment::deprecatedDropDatabase(CheckStatusWrapper* status)
void Attachment::dropDatabase(CheckStatusWrapper* status)
{
deprecatedDropDatabase(status);
internalDropDatabase(status);
if (status->isEmpty())
release();
}
void Attachment::deprecatedDropDatabase(CheckStatusWrapper* status)
{
internalDropDatabase(status);
}
SLONG Attachment::getSingleInfo(CheckStatusWrapper* status, UCHAR infoItem)
{
UCHAR buff[16];
@ -3023,7 +3073,7 @@ void Batch::freeClientData(CheckStatusWrapper* status, bool force)
}
void Batch::deprecatedClose(CheckStatusWrapper* status)
void Batch::internalClose(CheckStatusWrapper* status)
{
reset(status);
freeClientData(status);
@ -3032,12 +3082,18 @@ void Batch::deprecatedClose(CheckStatusWrapper* status)
void Batch::close(CheckStatusWrapper* status)
{
deprecatedClose(status);
internalClose(status);
if (status->isEmpty())
release();
}
void Batch::deprecatedClose(CheckStatusWrapper* status)
{
internalClose(status);
}
void Batch::getInfo(CheckStatusWrapper* status, unsigned int itemsLength, const unsigned char* items,
unsigned int bufferLength, unsigned char* buffer)
{
@ -3193,7 +3249,7 @@ void Replicator::process(CheckStatusWrapper* status, unsigned length, const unsi
}
void Replicator::deprecatedClose(CheckStatusWrapper* status)
void Replicator::internalClose(CheckStatusWrapper* status)
{
reset(status);
freeClientData(status);
@ -3202,12 +3258,18 @@ void Replicator::deprecatedClose(CheckStatusWrapper* status)
void Replicator::close(CheckStatusWrapper* status)
{
deprecatedClose(status);
internalClose(status);
if (status->isEmpty())
release();
}
void Replicator::deprecatedClose(CheckStatusWrapper* status)
{
internalClose(status);
}
void Replicator::freeClientData(CheckStatusWrapper* status, bool force)
{
try
@ -3858,7 +3920,7 @@ void Statement::freeClientData(CheckStatusWrapper* status, bool force)
}
void Statement::deprecatedFree(CheckStatusWrapper* status)
void Statement::internalFree(CheckStatusWrapper* status)
{
/**************************************
*
@ -3878,12 +3940,18 @@ void Statement::deprecatedFree(CheckStatusWrapper* status)
void Statement::free(CheckStatusWrapper* status)
{
deprecatedFree(status);
internalFree(status);
if (status->isEmpty())
release();
}
void Statement::deprecatedFree(CheckStatusWrapper* status)
{
internalFree(status);
}
Statement* Attachment::createStatement(CheckStatusWrapper* status, unsigned dialect)
{
reset(status);
@ -4871,7 +4939,7 @@ void ResultSet::freeClientData(CheckStatusWrapper* status, bool force)
}
void ResultSet::deprecatedClose(CheckStatusWrapper* status)
void ResultSet::internalClose(CheckStatusWrapper* status)
{
/**************************************
*
@ -4891,23 +4959,18 @@ void ResultSet::deprecatedClose(CheckStatusWrapper* status)
void ResultSet::close(CheckStatusWrapper* status)
{
/**************************************
*
* d s q l _ f r e e _ s t a t e m e n t
*
**************************************
*
* Functional description
* Close SQL cursor
*
**************************************/
deprecatedClose(status);
internalClose(status);
if (status->isEmpty())
release();
}
void ResultSet::deprecatedClose(CheckStatusWrapper* status)
{
internalClose(status);
}
void ResultSet::releaseStatement()
{
if (tmpStatement)
@ -5791,7 +5854,7 @@ void Request::freeClientData(CheckStatusWrapper* status, bool force)
}
void Request::deprecatedFree(CheckStatusWrapper* status)
void Request::internalFree(CheckStatusWrapper* status)
{
/**************************************
*
@ -5810,12 +5873,18 @@ void Request::deprecatedFree(CheckStatusWrapper* status)
void Request::free(CheckStatusWrapper* status)
{
deprecatedFree(status);
internalFree(status);
if (status->isEmpty())
release();
}
void Request::deprecatedFree(CheckStatusWrapper* status)
{
internalFree(status);
}
void Request::getInfo(CheckStatusWrapper* status, int level,
unsigned int itemsLength, const unsigned char* items,
unsigned int bufferLength, unsigned char* buffer)
@ -5983,7 +6052,7 @@ void Transaction::freeClientData(CheckStatusWrapper* status, bool force)
}
void Transaction::deprecatedRollback(CheckStatusWrapper* status)
void Transaction::internalRollback(CheckStatusWrapper* status)
{
/**************************************
*
@ -6002,13 +6071,19 @@ void Transaction::deprecatedRollback(CheckStatusWrapper* status)
void Transaction::rollback(CheckStatusWrapper* status)
{
deprecatedRollback(status);
internalRollback(status);
if (status->isEmpty())
release();
}
void Transaction::deprecatedDisconnect(CheckStatusWrapper* status)
void Transaction::deprecatedRollback(CheckStatusWrapper* status)
{
internalRollback(status);
}
void Transaction::internalDisconnect(CheckStatusWrapper* status)
{
try
{
@ -6030,12 +6105,17 @@ void Transaction::deprecatedDisconnect(CheckStatusWrapper* status)
void Transaction::disconnect(CheckStatusWrapper* status)
{
deprecatedDisconnect(status);
internalDisconnect(status);
if (status->isEmpty())
release();
}
void Transaction::deprecatedDisconnect(CheckStatusWrapper* status)
{
internalDisconnect(status);
}
int Blob::seek(CheckStatusWrapper* status, int mode, int offset)
{
@ -6288,7 +6368,7 @@ void Service::freeClientData(CheckStatusWrapper* status, bool force)
}
void Service::deprecatedDetach(CheckStatusWrapper* status)
void Service::internalDetach(CheckStatusWrapper* status)
{
/**************************************
*
@ -6307,12 +6387,18 @@ void Service::deprecatedDetach(CheckStatusWrapper* status)
void Service::detach(CheckStatusWrapper* status)
{
deprecatedDetach(status);
internalDetach(status);
if (status->isEmpty())
release();
}
void Service::deprecatedDetach(CheckStatusWrapper* status)
{
internalDetach(status);
}
void Service::query(CheckStatusWrapper* status,
unsigned int sendLength, const unsigned char* sendItems,
unsigned int receiveLength, const unsigned char* receiveItems,