|
From: <asf...@us...> - 2015-01-12 00:21:53
|
Revision: 60485
http://sourceforge.net/p/firebird/code/60485
Author: asfernandes
Date: 2015-01-12 00:21:38 +0000 (Mon, 12 Jan 2015)
Log Message:
-----------
Make the API usable with different type of IStatus classes, throwing (what class?) or not throwing. Builtin are CheckStatusWrapper (no throw) and ThrowStatusWrapper (throws FbException).
Modified Paths:
--------------
firebird/trunk/examples/dbcrypt/CryptKeyHolder.cpp
firebird/trunk/examples/dbcrypt/DbCrypt.cpp
firebird/trunk/examples/udr/UdrCppExample.cpp
firebird/trunk/src/auth/AuthDbg.cpp
firebird/trunk/src/auth/AuthDbg.h
firebird/trunk/src/auth/SecureRemotePassword/Message.h
firebird/trunk/src/auth/SecureRemotePassword/client/SrpClient.cpp
firebird/trunk/src/auth/SecureRemotePassword/manage/SrpManagement.cpp
firebird/trunk/src/auth/SecureRemotePassword/server/SrpServer.cpp
firebird/trunk/src/auth/SecurityDatabase/LegacyClient.cpp
firebird/trunk/src/auth/SecurityDatabase/LegacyClient.h
firebird/trunk/src/auth/SecurityDatabase/LegacyManagement.epp
firebird/trunk/src/auth/SecurityDatabase/LegacyManagement.h
firebird/trunk/src/auth/SecurityDatabase/LegacyServer.cpp
firebird/trunk/src/auth/trusted/AuthSspi.cpp
firebird/trunk/src/auth/trusted/AuthSspi.h
firebird/trunk/src/common/Auth.cpp
firebird/trunk/src/common/Auth.h
firebird/trunk/src/common/MsgMetadata.cpp
firebird/trunk/src/common/MsgMetadata.h
firebird/trunk/src/common/StatusHolder.h
firebird/trunk/src/common/call_service.cpp
firebird/trunk/src/common/classes/GetPlugins.h
firebird/trunk/src/common/classes/ImplementHelper.cpp
firebird/trunk/src/common/classes/ImplementHelper.h
firebird/trunk/src/common/classes/TempFile.cpp
firebird/trunk/src/common/classes/TempFile.h
firebird/trunk/src/common/config/config.cpp
firebird/trunk/src/common/config/config.h
firebird/trunk/src/common/isc_sync.cpp
firebird/trunk/src/common/security.cpp
firebird/trunk/src/common/security.h
firebird/trunk/src/common/utils_proto.h
firebird/trunk/src/dsql/DdlNodes.epp
firebird/trunk/src/gpre/boot/gpre_meta_boot.cpp
firebird/trunk/src/gpre/obj_cxx.cpp
firebird/trunk/src/include/firebird/FirebirdInterface.idl
firebird/trunk/src/include/firebird/IdlFbInterfaces.h
firebird/trunk/src/include/firebird/Interface.h
firebird/trunk/src/include/firebird/Message.h
firebird/trunk/src/include/firebird/UdrCppEngine.h
firebird/trunk/src/include/firebird/UdrEngine.h
firebird/trunk/src/isql/isql.epp
firebird/trunk/src/isql/show.epp
firebird/trunk/src/jrd/Attachment.h
firebird/trunk/src/jrd/Database.h
firebird/trunk/src/jrd/EngineInterface.h
firebird/trunk/src/jrd/ExtEngineManager.cpp
firebird/trunk/src/jrd/ExtEngineManager.h
firebird/trunk/src/jrd/UserManagement.cpp
firebird/trunk/src/jrd/extds/InternalDS.cpp
firebird/trunk/src/jrd/jrd.cpp
firebird/trunk/src/jrd/jrd.h
firebird/trunk/src/jrd/trace/TraceConfigStorage.h
firebird/trunk/src/jrd/trace/TraceObjects.cpp
firebird/trunk/src/jrd/trace/TraceObjects.h
firebird/trunk/src/plugins/crypt/arc4/Arc4.cpp
firebird/trunk/src/plugins/udr_engine/UdrEngine.cpp
firebird/trunk/src/remote/client/interface.cpp
firebird/trunk/src/remote/inet.cpp
firebird/trunk/src/remote/remote.cpp
firebird/trunk/src/remote/remote.h
firebird/trunk/src/remote/server/server.cpp
firebird/trunk/src/utilities/gsec/gsec.cpp
firebird/trunk/src/utilities/ntrace/PluginLogWriter.h
firebird/trunk/src/utilities/ntrace/TracePluginImpl.h
firebird/trunk/src/utilities/ntrace/traceplugin.cpp
firebird/trunk/src/yvalve/DistributedTransaction.cpp
firebird/trunk/src/yvalve/MasterImplementation.cpp
firebird/trunk/src/yvalve/MasterImplementation.h
firebird/trunk/src/yvalve/PluginManager.cpp
firebird/trunk/src/yvalve/PluginManager.h
firebird/trunk/src/yvalve/YObjects.h
firebird/trunk/src/yvalve/alt.cpp
firebird/trunk/src/yvalve/perf.cpp
firebird/trunk/src/yvalve/prepa_proto.h
firebird/trunk/src/yvalve/preparse.cpp
firebird/trunk/src/yvalve/utl.cpp
firebird/trunk/src/yvalve/why.cpp
Modified: firebird/trunk/examples/dbcrypt/CryptKeyHolder.cpp
===================================================================
--- firebird/trunk/examples/dbcrypt/CryptKeyHolder.cpp 2015-01-12 00:21:07 UTC (rev 60484)
+++ firebird/trunk/examples/dbcrypt/CryptKeyHolder.cpp 2015-01-12 00:21:38 UTC (rev 60485)
@@ -44,7 +44,7 @@
IMaster* master = NULL;
IPluginManager* pluginManager = NULL;
-class PluginModule : public Api::IPluginModuleImpl<PluginModule>
+class PluginModule : public IPluginModuleImpl<PluginModule, CheckStatusWrapper>
{
public:
PluginModule()
@@ -82,7 +82,7 @@
PluginModule module;
-class CryptKeyHolder : public Api::IKeyHolderPluginImpl<CryptKeyHolder>
+class CryptKeyHolder : public IKeyHolderPluginImpl<CryptKeyHolder, CheckStatusWrapper>
{
public:
explicit CryptKeyHolder(IPluginConfig* cnf) throw()
@@ -97,8 +97,8 @@
}
// IKeyHolderPlugin implementation
- int keyCallback(IStatus* status, ICryptKeyCallback* callback);
- ICryptKeyCallback* keyHandle(IStatus* status, const char* keyName);
+ int keyCallback(CheckStatusWrapper* status, ICryptKeyCallback* callback);
+ ICryptKeyCallback* keyHandle(CheckStatusWrapper* status, const char* keyName);
int release()
{
@@ -136,7 +136,7 @@
}
private:
- class CallbackInterface : public Api::ICryptKeyCallbackImpl<CallbackInterface>
+ class CallbackInterface : public ICryptKeyCallbackImpl<CallbackInterface, CheckStatusWrapper>
{
public:
explicit CallbackInterface(CryptKeyHolder* p)
@@ -175,10 +175,10 @@
AtomicCounter refCounter;
IReferenceCounted* owner;
- void noKeyError(IStatus* status);
+ void noKeyError(CheckStatusWrapper* status);
};
-void CryptKeyHolder::noKeyError(IStatus* status)
+void CryptKeyHolder::noKeyError(CheckStatusWrapper* status)
{
ISC_STATUS_ARRAY vector;
vector[0] = isc_arg_gds;
@@ -189,7 +189,7 @@
status->setErrors(vector);
}
-int CryptKeyHolder::keyCallback(IStatus* status, ICryptKeyCallback* callback)
+int CryptKeyHolder::keyCallback(CheckStatusWrapper* status, ICryptKeyCallback* callback)
{
status->init();
@@ -225,7 +225,7 @@
return 1;
}
-ICryptKeyCallback* CryptKeyHolder::keyHandle(IStatus* status, const char* keyName)
+ICryptKeyCallback* CryptKeyHolder::keyHandle(CheckStatusWrapper* status, const char* keyName)
{
if (strcmp(keyName, "sample") != 0)
{
@@ -235,7 +235,7 @@
return &callbackInterface;
}
-class Factory : public Api::IPluginFactoryImpl<Factory>
+class Factory : public IPluginFactoryImpl<Factory, CheckStatusWrapper>
{
public:
IPluginModule* getModule()
@@ -243,7 +243,7 @@
return &module;
}
- IPluginBase* createPlugin(IStatus* status, IPluginConfig* factoryParameter)
+ IPluginBase* createPlugin(CheckStatusWrapper* status, IPluginConfig* factoryParameter)
{
try
{
Modified: firebird/trunk/examples/dbcrypt/DbCrypt.cpp
===================================================================
--- firebird/trunk/examples/dbcrypt/DbCrypt.cpp 2015-01-12 00:21:07 UTC (rev 60484)
+++ firebird/trunk/examples/dbcrypt/DbCrypt.cpp 2015-01-12 00:21:38 UTC (rev 60485)
@@ -41,7 +41,7 @@
IMaster* master = NULL;
IPluginManager* pluginManager = NULL;
-class PluginModule : public Api::IPluginModuleImpl<PluginModule>
+class PluginModule : public IPluginModuleImpl<PluginModule, CheckStatusWrapper>
{
public:
PluginModule()
@@ -79,7 +79,7 @@
PluginModule module;
-class DbCrypt : public Api::IDbCryptPluginImpl<DbCrypt>
+class DbCrypt : public IDbCryptPluginImpl<DbCrypt, CheckStatusWrapper>
{
public:
explicit DbCrypt(IPluginConfig* cnf) throw()
@@ -94,9 +94,9 @@
}
// ICryptPlugin implementation
- void encrypt(IStatus* status, unsigned int length, const void* from, void* to);
- void decrypt(IStatus* status, unsigned int length, const void* from, void* to);
- void setKey(IStatus* status, unsigned int length, IKeyHolderPlugin** sources);
+ void encrypt(CheckStatusWrapper* status, unsigned int length, const void* from, void* to);
+ void decrypt(CheckStatusWrapper* status, unsigned int length, const void* from, void* to);
+ void setKey(CheckStatusWrapper* status, unsigned int length, IKeyHolderPlugin** sources);
int release()
{
@@ -135,10 +135,10 @@
AtomicCounter refCounter;
IReferenceCounted* owner;
- void noKeyError(IStatus* status);
+ void noKeyError(CheckStatusWrapper* status);
};
-void DbCrypt::noKeyError(IStatus* status)
+void DbCrypt::noKeyError(CheckStatusWrapper* status)
{
ISC_STATUS_ARRAY vector;
vector[0] = isc_arg_gds;
@@ -149,7 +149,7 @@
status->setErrors(vector);
}
-void DbCrypt::encrypt(IStatus* status, unsigned int length, const void* from, void* to)
+void DbCrypt::encrypt(CheckStatusWrapper* status, unsigned int length, const void* from, void* to)
{
status->init();
@@ -168,7 +168,7 @@
}
}
-void DbCrypt::decrypt(IStatus* status, unsigned int length, const void* from, void* to)
+void DbCrypt::decrypt(CheckStatusWrapper* status, unsigned int length, const void* from, void* to)
{
status->init();
@@ -187,7 +187,7 @@
}
}
-void DbCrypt::setKey(IStatus* status, unsigned int length, IKeyHolderPlugin** sources)
+void DbCrypt::setKey(CheckStatusWrapper* status, unsigned int length, IKeyHolderPlugin** sources)
{
status->init();
@@ -243,7 +243,7 @@
noKeyError(status);
}
-class Factory : public Api::IPluginFactoryImpl<Factory>
+class Factory : public IPluginFactoryImpl<Factory, CheckStatusWrapper>
{
public:
IPluginModule* getModule()
@@ -251,7 +251,7 @@
return &module;
}
- IPluginBase* createPlugin(IStatus* status, IPluginConfig* factoryParameter)
+ IPluginBase* createPlugin(CheckStatusWrapper* status, IPluginConfig* factoryParameter)
{
try
{
Modified: firebird/trunk/examples/udr/UdrCppExample.cpp
===================================================================
--- firebird/trunk/examples/udr/UdrCppExample.cpp 2015-01-12 00:21:07 UTC (rev 60484)
+++ firebird/trunk/examples/udr/UdrCppExample.cpp 2015-01-12 00:21:38 UTC (rev 60485)
@@ -21,7 +21,6 @@
*/
#include "ibase.h"
-#include "firebird.h" //// FIXME:
#include "firebird/UdrCppEngine.h"
#include <assert.h>
#include <stdio.h>
@@ -216,14 +215,14 @@
delete [] s;
ISC_STATUS_ARRAY statusVector = {0};
- isc_db_handle dbHandle = getIscDbHandle(context);
+ isc_db_handle dbHandle = getIscDbHandle(status, context);
ISC_ULONG counter = 0;
- StatusException::checkStatus(isc_wait_for_event(
- statusVector, &dbHandle, eveLen, eveBuffer, eveResult), statusVector);
+ FbException::check(isc_wait_for_event(
+ statusVector, &dbHandle, eveLen, eveBuffer, eveResult), status, statusVector);
isc_event_counts(&counter, eveLen, eveBuffer, eveResult);
- StatusException::checkStatus(isc_wait_for_event(
- statusVector, &dbHandle, eveLen, eveBuffer, eveResult), statusVector);
+ FbException::check(isc_wait_for_event(
+ statusVector, &dbHandle, eveLen, eveBuffer, eveResult), status, statusVector);
isc_event_counts(&counter, eveLen, eveBuffer, eveResult);
isc_free((char*) eveBuffer);
@@ -251,11 +250,10 @@
// , inCount(0)
{
// Get input metadata.
- AutoRelease<IMessageMetadata> inMetadata(StatusException::check(status,
- metadata->getInputMetadata(status)));
+ AutoRelease<IMessageMetadata> inMetadata(metadata->getInputMetadata(status));
// Get count of input parameters.
- inCount = StatusException::check(status, inMetadata->getCount(status));
+ inCount = inMetadata->getCount(status);
inNullOffsets.reset(new unsigned[inCount]);
inOffsets.reset(new unsigned[inCount]);
@@ -263,21 +261,20 @@
for (unsigned i = 0; i < inCount; ++i)
{
// Get null offset of the i-th input parameter.
- inNullOffsets[i] = StatusException::check(status, inMetadata->getNullOffset(status, i));
+ inNullOffsets[i] = inMetadata->getNullOffset(status, i);
// Get the offset of the i-th input parameter.
- inOffsets[i] = StatusException::check(status, inMetadata->getOffset(status, i));
+ inOffsets[i] = inMetadata->getOffset(status, i);
}
// Get output metadata.
- AutoRelease<IMessageMetadata> outMetadata(StatusException::check(status,
- metadata->getOutputMetadata(status)));
+ AutoRelease<IMessageMetadata> outMetadata(metadata->getOutputMetadata(status));
// Get null offset of the return value.
- outNullOffset = StatusException::check(status, outMetadata->getNullOffset(status, 0));
+ outNullOffset = outMetadata->getNullOffset(status, 0);
// Get offset of the return value.
- outOffset = StatusException::check(status, outMetadata->getOffset(status, 0));
+ outOffset = outMetadata->getOffset(status, 0);
}
// This function requires the INTEGER parameters and return value, otherwise it will crash.
@@ -333,17 +330,15 @@
// Get offsets once per procedure.
FB_UDR_CONSTRUCTOR
{
- AutoRelease<IMessageMetadata> inMetadata(StatusException::check(status,
- metadata->getInputMetadata(status)));
+ AutoRelease<IMessageMetadata> inMetadata(metadata->getInputMetadata(status));
- inOffsetStart = StatusException::check(status, inMetadata->getOffset(status, 0));
- inOffsetEnd = StatusException::check(status, inMetadata->getOffset(status, 1));
+ inOffsetStart = inMetadata->getOffset(status, 0);
+ inOffsetEnd = inMetadata->getOffset(status, 1);
- AutoRelease<IMessageMetadata> outMetadata(StatusException::check(status,
- metadata->getOutputMetadata(status)));
+ AutoRelease<IMessageMetadata> outMetadata(metadata->getOutputMetadata(status));
- outNullOffset = StatusException::check(status, outMetadata->getNullOffset(status, 0));
- outOffset = StatusException::check(status, outMetadata->getOffset(status, 0));
+ outNullOffset = outMetadata->getNullOffset(status, 0);
+ outOffset = outMetadata->getOffset(status, 0);
}
/*** Procedure destructor.
@@ -542,24 +537,23 @@
// Without FieldsMessage definition, messages will be byte-based.
FB_UDR_CONSTRUCTOR
- , triggerMetadata(StatusException::check(status, metadata->getTriggerMetadata(status)))
+ , triggerMetadata(metadata->getTriggerMetadata(status))
{
ISC_STATUS_ARRAY statusVector = {0};
- isc_db_handle dbHandle = getIscDbHandle(context);
- isc_tr_handle trHandle = getIscTrHandle(context);
+ isc_db_handle dbHandle = getIscDbHandle(status, context);
+ isc_tr_handle trHandle = getIscTrHandle(status, context);
isc_stmt_handle stmtHandle = 0;
- StatusException::checkStatus(isc_dsql_allocate_statement(
- statusVector, &dbHandle, &stmtHandle), statusVector);
- StatusException::checkStatus(isc_dsql_prepare(statusVector, &trHandle, &stmtHandle, 0,
+ FbException::check(isc_dsql_allocate_statement(
+ statusVector, &dbHandle, &stmtHandle), status, statusVector);
+ FbException::check(isc_dsql_prepare(statusVector, &trHandle, &stmtHandle, 0,
"select data_source from replicate_config where name = ?",
- SQL_DIALECT_CURRENT, NULL), statusVector);
+ SQL_DIALECT_CURRENT, NULL), status, statusVector);
- const char* table = StatusException::check(status, metadata->getTriggerTable(status));
+ const char* table = metadata->getTriggerTable(status);
// Skip the first exclamation point, separating the module name and entry point.
- const char* info = StatusException::check(status,
- strchr(metadata->getEntryPoint(status), '!'));
+ const char* info = strchr(metadata->getEntryPoint(status), '!');
// Skip the second exclamation point, separating the entry point and the misc info (config).
if (info)
@@ -573,8 +567,8 @@
XSQLDA* inSqlDa = reinterpret_cast<XSQLDA*>(new char[(XSQLDA_LENGTH(1))]);
inSqlDa->version = SQLDA_VERSION1;
inSqlDa->sqln = 1;
- StatusException::checkStatus(isc_dsql_describe_bind(statusVector, &stmtHandle,
- SQL_DIALECT_CURRENT, inSqlDa), statusVector);
+ FbException::check(isc_dsql_describe_bind(statusVector, &stmtHandle,
+ SQL_DIALECT_CURRENT, inSqlDa), status, statusVector);
inSqlDa->sqlvar[0].sqldata = new char[sizeof(short) + inSqlDa->sqlvar[0].sqllen];
strncpy(inSqlDa->sqlvar[0].sqldata + sizeof(short), info, inSqlDa->sqlvar[0].sqllen);
*reinterpret_cast<short*>(inSqlDa->sqlvar[0].sqldata) = strlen(info);
@@ -582,20 +576,20 @@
XSQLDA* outSqlDa = reinterpret_cast<XSQLDA*>(new char[(XSQLDA_LENGTH(1))]);
outSqlDa->version = SQLDA_VERSION1;
outSqlDa->sqln = 1;
- StatusException::checkStatus(isc_dsql_describe(statusVector, &stmtHandle,
- SQL_DIALECT_CURRENT, outSqlDa), statusVector);
+ FbException::check(isc_dsql_describe(statusVector, &stmtHandle,
+ SQL_DIALECT_CURRENT, outSqlDa), status, statusVector);
outSqlDa->sqlvar[0].sqldata = new char[sizeof(short) + outSqlDa->sqlvar[0].sqllen + 1];
outSqlDa->sqlvar[0].sqldata[sizeof(short) + outSqlDa->sqlvar[0].sqllen] = '\0';
- StatusException::checkStatus(isc_dsql_execute2(statusVector, &trHandle, &stmtHandle,
- SQL_DIALECT_CURRENT, inSqlDa, outSqlDa), statusVector);
- StatusException::checkStatus(isc_dsql_free_statement(
- statusVector, &stmtHandle, DSQL_unprepare), statusVector);
+ FbException::check(isc_dsql_execute2(statusVector, &trHandle, &stmtHandle,
+ SQL_DIALECT_CURRENT, inSqlDa, outSqlDa), status, statusVector);
+ FbException::check(isc_dsql_free_statement(
+ statusVector, &stmtHandle, DSQL_unprepare), status, statusVector);
delete [] inSqlDa->sqlvar[0].sqldata;
delete [] reinterpret_cast<char*>(inSqlDa);
- unsigned count = StatusException::check(status, triggerMetadata->getCount(status));
+ unsigned count = triggerMetadata->getCount(status);
char buffer[65536];
strcpy(buffer, "execute block (\n");
@@ -605,7 +599,7 @@
if (i > 0)
strcat(buffer, ",\n");
- const char* name = StatusException::check(status, triggerMetadata->getField(status, i));
+ const char* name = triggerMetadata->getField(status, i);
strcat(buffer, " p");
sprintf(buffer + strlen(buffer), "%d type of column \"%s\".\"%s\" = ?", i, table, name);
@@ -625,7 +619,7 @@
if (i > 0)
strcat(buffer, ", ");
- const char* name = StatusException::check(status, triggerMetadata->getField(status, i));
+ const char* name = triggerMetadata->getField(status, i);
strcat(buffer, "\"");
strcat(buffer, name);
@@ -655,11 +649,10 @@
strcat(buffer, outSqlDa->sqlvar[0].sqldata + sizeof(short));
strcat(buffer, "';\nend");
- IAttachment* attachment = StatusException::check(status, context->getAttachment(status));
- ITransaction* transaction = StatusException::check(status, context->getTransaction(status));
+ IAttachment* attachment = context->getAttachment(status);
+ ITransaction* transaction = context->getTransaction(status);
- stmt.reset(StatusException::check(status,
- attachment->prepare(status, transaction, 0, buffer, SQL_DIALECT_CURRENT, 0)));
+ stmt.reset(attachment->prepare(status, transaction, 0, buffer, SQL_DIALECT_CURRENT, 0));
delete [] outSqlDa->sqlvar[0].sqldata;
delete [] reinterpret_cast<char*>(outSqlDa);
@@ -673,11 +666,10 @@
FB_UDR_EXECUTE_TRIGGER
{
- ITransaction* transaction = StatusException::check(status, context->getTransaction(status));
+ ITransaction* transaction = context->getTransaction(status);
// This will not work if the table has computed fields.
stmt->execute(status, transaction, triggerMetadata, newFields, NULL, NULL);
- StatusException::check(status->getErrors());
}
AutoRelease<IMessageMetadata> triggerMetadata;
@@ -696,24 +688,23 @@
);
FB_UDR_CONSTRUCTOR
- , triggerMetadata(StatusException::check(status, metadata->getTriggerMetadata(status)))
+ , triggerMetadata(metadata->getTriggerMetadata(status))
{
ISC_STATUS_ARRAY statusVector = {0};
- isc_db_handle dbHandle = getIscDbHandle(context);
- isc_tr_handle trHandle = getIscTrHandle(context);
+ isc_db_handle dbHandle = getIscDbHandle(status, context);
+ isc_tr_handle trHandle = getIscTrHandle(status, context);
isc_stmt_handle stmtHandle = 0;
- StatusException::checkStatus(isc_dsql_allocate_statement(
- statusVector, &dbHandle, &stmtHandle), statusVector);
- StatusException::checkStatus(isc_dsql_prepare(statusVector, &trHandle, &stmtHandle, 0,
+ FbException::check(isc_dsql_allocate_statement(
+ statusVector, &dbHandle, &stmtHandle), status, statusVector);
+ FbException::check(isc_dsql_prepare(statusVector, &trHandle, &stmtHandle, 0,
"select data_source from replicate_config where name = ?",
- SQL_DIALECT_CURRENT, NULL), statusVector);
+ SQL_DIALECT_CURRENT, NULL), status, statusVector);
- const char* table = StatusException::check(status, metadata->getTriggerTable(status));
+ const char* table = metadata->getTriggerTable(status);
// Skip the first exclamation point, separating the module name and entry point.
- const char* info = StatusException::check(status,
- strchr(metadata->getEntryPoint(status), '!'));
+ const char* info = strchr(metadata->getEntryPoint(status), '!');
// Skip the second exclamation point, separating the entry point and the misc info (config).
if (info)
@@ -727,8 +718,8 @@
XSQLDA* inSqlDa = reinterpret_cast<XSQLDA*>(new char[(XSQLDA_LENGTH(1))]);
inSqlDa->version = SQLDA_VERSION1;
inSqlDa->sqln = 1;
- StatusException::checkStatus(isc_dsql_describe_bind(
- statusVector, &stmtHandle, SQL_DIALECT_CURRENT, inSqlDa), statusVector);
+ FbException::check(isc_dsql_describe_bind(
+ statusVector, &stmtHandle, SQL_DIALECT_CURRENT, inSqlDa), status, statusVector);
inSqlDa->sqlvar[0].sqldata = new char[sizeof(short) + inSqlDa->sqlvar[0].sqllen];
strncpy(inSqlDa->sqlvar[0].sqldata + sizeof(short), info, inSqlDa->sqlvar[0].sqllen);
*reinterpret_cast<short*>(inSqlDa->sqlvar[0].sqldata) = strlen(info);
@@ -736,15 +727,15 @@
XSQLDA* outSqlDa = reinterpret_cast<XSQLDA*>(new char[(XSQLDA_LENGTH(1))]);
outSqlDa->version = SQLDA_VERSION1;
outSqlDa->sqln = 1;
- StatusException::checkStatus(isc_dsql_describe(
- statusVector, &stmtHandle, SQL_DIALECT_CURRENT, outSqlDa), statusVector);
+ FbException::check(isc_dsql_describe(
+ statusVector, &stmtHandle, SQL_DIALECT_CURRENT, outSqlDa), status, statusVector);
outSqlDa->sqlvar[0].sqldata = new char[sizeof(short) + outSqlDa->sqlvar[0].sqllen + 1];
outSqlDa->sqlvar[0].sqldata[sizeof(short) + outSqlDa->sqlvar[0].sqllen] = '\0';
- StatusException::checkStatus(isc_dsql_execute2(statusVector, &trHandle, &stmtHandle,
- SQL_DIALECT_CURRENT, inSqlDa, outSqlDa), statusVector);
- StatusException::checkStatus(isc_dsql_free_statement(
- statusVector, &stmtHandle, DSQL_unprepare), statusVector);
+ FbException::check(isc_dsql_execute2(statusVector, &trHandle, &stmtHandle,
+ SQL_DIALECT_CURRENT, inSqlDa, outSqlDa), status, statusVector);
+ FbException::check(isc_dsql_free_statement(
+ statusVector, &stmtHandle, DSQL_unprepare), status, statusVector);
delete [] inSqlDa->sqlvar[0].sqldata;
delete [] reinterpret_cast<char*>(inSqlDa);
@@ -765,11 +756,10 @@
strcat(buffer, outSqlDa->sqlvar[0].sqldata + sizeof(short));
strcat(buffer, "';\nend");
- IAttachment* attachment = StatusException::check(status, context->getAttachment(status));
- ITransaction* transaction = StatusException::check(status, context->getTransaction(status));
+ IAttachment* attachment = context->getAttachment(status);
+ ITransaction* transaction = context->getTransaction(status);
- stmt.reset(StatusException::check(status,
- attachment->prepare(status, transaction, 0, buffer, SQL_DIALECT_CURRENT, 0)));
+ stmt.reset(attachment->prepare(status, transaction, 0, buffer, SQL_DIALECT_CURRENT, 0));
delete [] outSqlDa->sqlvar[0].sqldata;
delete [] reinterpret_cast<char*>(outSqlDa);
@@ -783,10 +773,9 @@
FB_UDR_EXECUTE_TRIGGER
{
- ITransaction* transaction = StatusException::check(status, context->getTransaction(status));
+ ITransaction* transaction = context->getTransaction(status);
stmt->execute(status, transaction, triggerMetadata, newFields, NULL, NULL);
- StatusException::check(status->getErrors());
}
AutoRelease<IMessageMetadata> triggerMetadata;
Modified: firebird/trunk/src/auth/AuthDbg.cpp
===================================================================
--- firebird/trunk/src/auth/AuthDbg.cpp 2015-01-12 00:21:07 UTC (rev 60484)
+++ firebird/trunk/src/auth/AuthDbg.cpp 2015-01-12 00:21:38 UTC (rev 60485)
@@ -61,7 +61,7 @@
check(&s);
}
-int DebugServer::authenticate(Firebird::IStatus* status, Firebird::IServerBlock* sb,
+int DebugServer::authenticate(Firebird::CheckStatusWrapper* status, Firebird::IServerBlock* sb,
Firebird::IWriter* writerInterface)
{
try
@@ -136,7 +136,7 @@
: str(getPool())
{ }
-int DebugClient::authenticate(Firebird::IStatus* status, Firebird::IClientBlock* cb)
+int DebugClient::authenticate(Firebird::CheckStatusWrapper* status, Firebird::IClientBlock* cb)
{
try
{
Modified: firebird/trunk/src/auth/AuthDbg.h
===================================================================
--- firebird/trunk/src/auth/AuthDbg.h 2015-01-12 00:21:07 UTC (rev 60484)
+++ firebird/trunk/src/auth/AuthDbg.h 2015-01-12 00:21:38 UTC (rev 60485)
@@ -46,12 +46,12 @@
// The idea of debug plugin is to send some data from server to client,
// modify them on client and return result (which becomes login name) to the server
-class DebugServer FB_FINAL : public Firebird::StdPlugin<Firebird::Api::IServerImpl<DebugServer> >
+class DebugServer FB_FINAL : public Firebird::StdPlugin<Firebird::IServerImpl<DebugServer, Firebird::CheckStatusWrapper> >
{
public:
explicit DebugServer(Firebird::IPluginConfig*);
- int authenticate(Firebird::IStatus* status, Firebird::IServerBlock* sBlock,
+ int authenticate(Firebird::CheckStatusWrapper* status, Firebird::IServerBlock* sBlock,
Firebird::IWriter* writerInterface);
int release();
@@ -60,12 +60,12 @@
Firebird::RefPtr<Firebird::IConfig> config;
};
-class DebugClient FB_FINAL : public Firebird::StdPlugin<Firebird::Api::IClientImpl<DebugClient> >
+class DebugClient FB_FINAL : public Firebird::StdPlugin<Firebird::IClientImpl<DebugClient, Firebird::CheckStatusWrapper> >
{
public:
DebugClient(Firebird::IPluginConfig*);
- int authenticate(Firebird::IStatus* status, Firebird::IClientBlock* sBlock);
+ int authenticate(Firebird::CheckStatusWrapper* status, Firebird::IClientBlock* sBlock);
int release();
private:
Modified: firebird/trunk/src/auth/SecureRemotePassword/Message.h
===================================================================
--- firebird/trunk/src/auth/SecureRemotePassword/Message.h 2015-01-12 00:21:07 UTC (rev 60484)
+++ firebird/trunk/src/auth/SecureRemotePassword/Message.h 2015-01-12 00:21:38 UTC (rev 60485)
@@ -55,15 +55,18 @@
{
public:
Message(Firebird::IMessageMetadata* aMeta = NULL)
- : metadata(NULL), buffer(NULL), builder(NULL),
- fieldCount(0), fieldList(NULL)
- {
#ifdef INTERNAL_FIREBIRD
- s = &st;
+ : s(&st),
#else
- s = fb_get_master_interface()->getStatus();
+ : s(fb_get_master_interface()->getStatus()),
#endif
-
+ metadata(NULL),
+ buffer(NULL),
+ builder(NULL),
+ fieldCount(0),
+ fieldList(NULL),
+ statusWrapper(s)
+ {
try
{
if (aMeta)
@@ -80,8 +83,8 @@
#else
fb_get_master_interface()->
#endif
- getMetadataBuilder(s, 0);
- check(s);
+ getMetadataBuilder(&statusWrapper, 0);
+ check(&statusWrapper);
builder = bld;
builder->addRef();
}
@@ -123,8 +126,8 @@
{
if (metadata)
{
- unsigned l = metadata->getCount(s);
- check(s);
+ unsigned l = metadata->getCount(&statusWrapper);
+ check(&statusWrapper);
if (fieldCount >= l)
{
#ifdef INTERNAL_FIREBIRD
@@ -135,10 +138,10 @@
#endif
}
- t = metadata->getType(s, fieldCount);
- check(s);
- sz = metadata->getLength(s, fieldCount);
- check(s);
+ t = metadata->getType(&statusWrapper, fieldCount);
+ check(&statusWrapper);
+ sz = metadata->getLength(&statusWrapper, fieldCount);
+ check(&statusWrapper);
if (!checkType<T>(t, sz))
{
#ifdef INTERNAL_FIREBIRD
@@ -152,16 +155,16 @@
{
fb_assert(builder);
- unsigned f = builder->addField(s);
- check(s);
+ unsigned f = builder->addField(&statusWrapper);
+ check(&statusWrapper);
fb_assert(f == fieldCount);
t = getType<T>(sz);
- builder->setType(s, f, t);
- check(s);
- builder->setLength(s, f, sz);
- check(s);
+ builder->setType(&statusWrapper, f, t);
+ check(&statusWrapper);
+ builder->setLength(&statusWrapper, f, sz);
+ check(&statusWrapper);
lnk->next = fieldList;
fieldList = lnk;
@@ -177,10 +180,10 @@
#ifdef INTERNAL_FIREBIRD
Firebird::status_exception::raise(status);
#else
- char s[100];
+ char msg[100];
const ISC_STATUS* st = status->getErrors();
- fb_interpret(s, sizeof(s), &st);
- fatalErrorHandler(s);
+ fb_interpret(msg, sizeof(msg), &st);
+ fatalErrorHandler(msg);
#endif
}
}
@@ -193,8 +196,8 @@
if (!metadata)
{
fb_assert(builder);
- Firebird::IMessageMetadata* aMeta = builder->getMetadata(s);
- check(s);
+ Firebird::IMessageMetadata* aMeta = builder->getMetadata(&statusWrapper);
+ check(&statusWrapper);
metadata = aMeta;
metadata->addRef();
builder->release();
@@ -230,8 +233,8 @@
private:
void createBuffer(Firebird::IMessageMetadata* aMeta)
{
- unsigned l = aMeta->getMessageLength(s);
- check(s);
+ unsigned l = aMeta->getMessageLength(&statusWrapper);
+ check(&statusWrapper);
buffer = new unsigned char[l];
}
@@ -239,14 +242,17 @@
Firebird::IStatus* s;
private:
-#ifdef INTERNAL_FIREBIRD
- Firebird::LocalStatus st;
-#endif
Firebird::IMessageMetadata* metadata;
unsigned char* buffer;
Firebird::IMetadataBuilder* builder;
unsigned fieldCount;
FieldLink* fieldList;
+#ifdef INTERNAL_FIREBIRD
+ Firebird::LocalStatus st;
+#endif
+
+public:
+ Firebird::CheckStatusWrapper statusWrapper;
};
@@ -360,12 +366,12 @@
void setPointers(const unsigned char* buf)
{
- unsigned tmp = msg->getMetadata()->getOffset(msg->s, ind);
- Message::check(msg->s);
+ unsigned tmp = msg->getMetadata()->getOffset(&msg->statusWrapper, ind);
+ Message::check(&msg->statusWrapper);
ptr = (T*) (buf + tmp);
- tmp = msg->getMetadata()->getNullOffset(msg->s, ind);
- Message::check(msg->s);
+ tmp = msg->getMetadata()->getNullOffset(&msg->statusWrapper, ind);
+ Message::check(&msg->statusWrapper);
null.linkMessage((short*) (buf + tmp));
}
Modified: firebird/trunk/src/auth/SecureRemotePassword/client/SrpClient.cpp
===================================================================
--- firebird/trunk/src/auth/SecureRemotePassword/client/SrpClient.cpp 2015-01-12 00:21:07 UTC (rev 60484)
+++ firebird/trunk/src/auth/SecureRemotePassword/client/SrpClient.cpp 2015-01-12 00:21:38 UTC (rev 60485)
@@ -34,7 +34,7 @@
namespace Auth {
-class SrpClient FB_FINAL : public StdPlugin<Api::IClientImpl<SrpClient> >
+class SrpClient FB_FINAL : public StdPlugin<IClientImpl<SrpClient, CheckStatusWrapper> >
{
public:
explicit SrpClient(IPluginConfig*)
@@ -43,7 +43,7 @@
{ }
// IClient implementation
- int authenticate(IStatus*, IClientBlock* cb);
+ int authenticate(CheckStatusWrapper*, IClientBlock* cb);
int release();
private:
@@ -52,7 +52,7 @@
UCharBuffer sessionKey;
};
-int SrpClient::authenticate(IStatus* status, IClientBlock* cb)
+int SrpClient::authenticate(CheckStatusWrapper* status, IClientBlock* cb)
{
try
{
Modified: firebird/trunk/src/auth/SecureRemotePassword/manage/SrpManagement.cpp
===================================================================
--- firebird/trunk/src/auth/SecureRemotePassword/manage/SrpManagement.cpp 2015-01-12 00:21:07 UTC (rev 60484)
+++ firebird/trunk/src/auth/SecureRemotePassword/manage/SrpManagement.cpp 2015-01-12 00:21:38 UTC (rev 60485)
@@ -60,15 +60,16 @@
namespace Auth {
-class SrpManagement FB_FINAL : public Firebird::StdPlugin<Firebird::Api::IManagementImpl<SrpManagement> >
+class SrpManagement FB_FINAL : public Firebird::StdPlugin<Firebird::IManagementImpl<SrpManagement, Firebird::CheckStatusWrapper> >
{
public:
explicit SrpManagement(Firebird::IPluginConfig* par)
: upCount(0), delCount(0)
{
Firebird::LocalStatus s;
- config.assignRefNoIncr(par->getFirebirdConf(&s));
- check(&s);
+ Firebird::CheckStatusWrapper statusWrapper(&s);
+ config.assignRefNoIncr(par->getFirebirdConf(&statusWrapper));
+ check(&statusWrapper);
}
private:
@@ -100,24 +101,25 @@
};
Firebird::LocalStatus s;
- Firebird::ITransaction* ddlTran(att->startTransaction(&s, 0, NULL));
+ Firebird::CheckStatusWrapper statusWrapper(&s);
+ Firebird::ITransaction* ddlTran(att->startTransaction(&statusWrapper, 0, NULL));
try
{
for (const char** sql = script; *sql; ++sql)
{
- att->execute(&s, ddlTran, 0, *sql, SQL_DIALECT_V6, NULL, NULL, NULL, NULL);
- check(&s);
+ att->execute(&statusWrapper, ddlTran, 0, *sql, SQL_DIALECT_V6, NULL, NULL, NULL, NULL);
+ check(&statusWrapper);
}
- ddlTran->commit(&s);
- check(&s);
+ ddlTran->commit(&statusWrapper);
+ check(&statusWrapper);
}
catch (const Firebird::Exception&)
{
if (ddlTran)
{
- ddlTran->rollback(&s);
+ ddlTran->rollback(&statusWrapper);
}
throw;
}
@@ -142,6 +144,7 @@
}
Firebird::LocalStatus s;
+ Firebird::CheckStatusWrapper statusWrapper(&s);
Firebird::string userName(user->userName()->get());
prepareName(userName, '"');
@@ -157,13 +160,13 @@
userName2.c_str(), ADMIN_ROLE);
Message out;
Field<Varying> grantor(out, MAX_SQL_IDENTIFIER_SIZE);
- Firebird::IResultSet* curs = att->openCursor(&s, tra, selGrantor.length(),
+ Firebird::IResultSet* curs = att->openCursor(&statusWrapper, tra, selGrantor.length(),
selGrantor.c_str(), SQL_DIALECT_V6, NULL, NULL, out.getMetadata(), NULL);
- check(&s);
+ check(&statusWrapper);
- bool hasGrant = curs->fetchNext(&s, out.getBuffer()) == Firebird::IStatus::FB_OK;
- curs->close(&s);
- check(&s);
+ bool hasGrant = curs->fetchNext(&statusWrapper, out.getBuffer()) == Firebird::IStatus::FB_OK;
+ curs->close(&statusWrapper);
+ check(&statusWrapper);
if (hasGrant)
{
@@ -187,13 +190,14 @@
sql.printf("GRANT %s TO \"%s\"", ADMIN_ROLE, userName.c_str());
}
- att->execute(&s, tra, sql.length(), sql.c_str(), SQL_DIALECT_V6, NULL, NULL, NULL, NULL);
- check(&s);
+ att->execute(&statusWrapper, tra, sql.length(), sql.c_str(),
+ SQL_DIALECT_V6, NULL, NULL, NULL, NULL);
+ check(&statusWrapper);
}
public:
// IManagement implementation
- void start(Firebird::IStatus* status, Firebird::ILogonInfo* logonInfo)
+ void start(Firebird::CheckStatusWrapper* status, Firebird::ILogonInfo* logonInfo)
{
try
{
@@ -263,7 +267,7 @@
}
}
- int execute(Firebird::IStatus* status, Firebird::IUser* user, Firebird::IListUsers* callback)
+ int execute(Firebird::CheckStatusWrapper* status, Firebird::IUser* user, Firebird::IListUsers* callback)
{
try
{
@@ -608,7 +612,7 @@
return 0;
}
- void commit(Firebird::IStatus* status)
+ void commit(Firebird::CheckStatusWrapper* status)
{
if (tra)
{
@@ -620,7 +624,7 @@
}
}
- void rollback(Firebird::IStatus* status)
+ void rollback(Firebird::CheckStatusWrapper* status)
{
if (tra)
{
@@ -637,10 +641,11 @@
if (--refCounter == 0)
{
Firebird::LocalStatus status;
- rollback(&status);
+ Firebird::CheckStatusWrapper statusWrapper(&status);
+ rollback(&statusWrapper);
if (att)
{
- att->detach(&status);
+ att->detach(&statusWrapper);
if (!(status.getStatus() & Firebird::IStatus::FB_HAS_ERRORS))
{
att = NULL;
@@ -671,7 +676,7 @@
RemotePassword server;
int upCount, delCount;
- bool checkCount(Firebird::IStatus* status, int* count, UCHAR item)
+ bool checkCount(Firebird::CheckStatusWrapper* status, int* count, UCHAR item)
{
unsigned char buffer[100];
att->getInfo(status, 1, &item, sizeof(buffer), buffer);
@@ -688,7 +693,7 @@
return newCount == oldCount + 1;
}
- static void check(Firebird::IStatus* status)
+ static void check(Firebird::CheckStatusWrapper* status)
{
if (status->getStatus() & Firebird::IStatus::FB_HAS_ERRORS)
{
@@ -721,7 +726,7 @@
}
}
- void setField(Firebird::IStatus* st, Blob& to, Firebird::ICharUserField* from)
+ void setField(Firebird::CheckStatusWrapper* st, Blob& to, Firebird::ICharUserField* from)
{
if (from->entered())
{
@@ -784,7 +789,7 @@
}
}
- void assignField(Firebird::IStatus* st, Firebird::AutoPtr<Blob>& field, Firebird::ICharUserField* name)
+ void assignField(Firebird::CheckStatusWrapper* st, Firebird::AutoPtr<Blob>& field, Firebird::ICharUserField* name)
{
if (field.hasData())
{
@@ -804,57 +809,60 @@
static void listField(Firebird::ICharUserField* to, Varfield& from)
{
Firebird::LocalStatus st;
- to->setEntered(&st, from.null ? 0 : 1);
- check(&st);
+ Firebird::CheckStatusWrapper statusWrapper(&st);
+ to->setEntered(&statusWrapper, from.null ? 0 : 1);
+ check(&statusWrapper);
if (!from.null)
{
- to->set(&st, from);
- check(&st);
+ to->set(&statusWrapper, from);
+ check(&statusWrapper);
}
}
static void listField(Firebird::IIntUserField* to, Boolean& from)
{
Firebird::LocalStatus st;
- to->setEntered(&st, from.null ? 0 : 1);
- check(&st);
+ Firebird::CheckStatusWrapper statusWrapper(&st);
+ to->setEntered(&statusWrapper, from.null ? 0 : 1);
+ check(&statusWrapper);
if (!from.null)
{
- to->set(&st, from);
- check(&st);
+ to->set(&statusWrapper, from);
+ check(&statusWrapper);
}
}
void listField(Firebird::ICharUserField* to, Blob& from)
{
Firebird::LocalStatus st;
- to->setEntered(&st, from.null ? 0 : 1);
- check(&st);
+ Firebird::CheckStatusWrapper statusWrapper(&st);
+ to->setEntered(&statusWrapper, from.null ? 0 : 1);
+ check(&statusWrapper);
if (!from.null)
{
Firebird::string s;
Firebird::IBlob* blob = NULL;
try
{
- blob = att->openBlob(&st, tra, &from, 0, NULL);
- check(&st);
+ blob = att->openBlob(&statusWrapper, tra, &from, 0, NULL);
+ check(&statusWrapper);
char segbuf[256];
unsigned len;
for (;;)
{
- int cc = blob->getSegment(&st, sizeof(segbuf), segbuf, &len);
- check(&st);
+ int cc = blob->getSegment(&statusWrapper, sizeof(segbuf), segbuf, &len);
+ check(&statusWrapper);
if (cc == Firebird::IStatus::FB_EOF)
break;
s.append(segbuf, len);
}
- blob->close(&st);
- check(&st);
+ blob->close(&statusWrapper);
+ check(&statusWrapper);
- to->set(&st, s.c_str());
- check(&st);
+ to->set(&statusWrapper, s.c_str());
+ check(&statusWrapper);
}
catch (const Firebird::Exception&)
{
@@ -865,7 +873,7 @@
}
}
- void blobWrite(Firebird::IStatus* st, Blob& to, Firebird::ICharUserField* from)
+ void blobWrite(Firebird::CheckStatusWrapper* st, Blob& to, Firebird::ICharUserField* from)
{
to.null = FB_FALSE;
const char* ptr = from->get();
Modified: firebird/trunk/src/auth/SecureRemotePassword/server/SrpServer.cpp
===================================================================
--- firebird/trunk/src/auth/SecureRemotePassword/server/SrpServer.cpp 2015-01-12 00:21:07 UTC (rev 60484)
+++ firebird/trunk/src/auth/SecureRemotePassword/server/SrpServer.cpp 2015-01-12 00:21:38 UTC (rev 60485)
@@ -48,7 +48,7 @@
namespace Auth {
-class SrpServer FB_FINAL : public StdPlugin<Api::IServerImpl<SrpServer> >
+class SrpServer FB_FINAL : public StdPlugin<IServerImpl<SrpServer, CheckStatusWrapper> >
{
public:
explicit SrpServer(IPluginConfig* par)
@@ -63,7 +63,7 @@
}
// IServer implementation
- int authenticate(IStatus* status, IServerBlock* sBlock, IWriter* writerInterface);
+ int authenticate(CheckStatusWrapper* status, IServerBlock* sBlock, IWriter* writerInterface);
int release();
private:
@@ -78,7 +78,7 @@
const char* secDbName;
};
-int SrpServer::authenticate(IStatus* status, IServerBlock* sb, IWriter* writerInterface)
+int SrpServer::authenticate(CheckStatusWrapper* status, IServerBlock* sb, IWriter* writerInterface)
{
try
{
Modified: firebird/trunk/src/auth/SecurityDatabase/LegacyClient.cpp
===================================================================
--- firebird/trunk/src/auth/SecurityDatabase/LegacyClient.cpp 2015-01-12 00:21:07 UTC (rev 60484)
+++ firebird/trunk/src/auth/SecurityDatabase/LegacyClient.cpp 2015-01-12 00:21:38 UTC (rev 60485)
@@ -35,7 +35,7 @@
namespace Auth {
-int SecurityDatabaseClient::authenticate(Firebird::IStatus* status, Firebird::IClientBlock* cb)
+int SecurityDatabaseClient::authenticate(Firebird::CheckStatusWrapper* status, Firebird::IClientBlock* cb)
{
// fprintf(stderr, "Clnt: Legacy: lgn=%s pswd=%s\n", cb->getLogin(), cb->getPassword());
if (!(cb->getLogin() && cb->getPassword()))
Modified: firebird/trunk/src/auth/SecurityDatabase/LegacyClient.h
===================================================================
--- firebird/trunk/src/auth/SecurityDatabase/LegacyClient.h 2015-01-12 00:21:07 UTC (rev 60484)
+++ firebird/trunk/src/auth/SecurityDatabase/LegacyClient.h 2015-01-12 00:21:38 UTC (rev 60485)
@@ -35,7 +35,7 @@
// Required to stop analyzing rest of plugins before first roundtrip to server
// if legacy login is present in DPB
-class SecurityDatabaseClient FB_FINAL : public Firebird::StdPlugin<Firebird::Api::IClientImpl<SecurityDatabaseClient> >
+class SecurityDatabaseClient FB_FINAL : public Firebird::StdPlugin<Firebird::IClientImpl<SecurityDatabaseClient, Firebird::CheckStatusWrapper> >
{
public:
explicit SecurityDatabaseClient(Firebird::IPluginConfig*)
@@ -43,7 +43,7 @@
}
// IClient implementation
- int authenticate(Firebird::IStatus*, Firebird::IClientBlock* data);
+ int authenticate(Firebird::CheckStatusWrapper*, Firebird::IClientBlock* data);
int release();
};
Modified: firebird/trunk/src/auth/SecurityDatabase/LegacyManagement.epp
===================================================================
--- firebird/trunk/src/auth/SecurityDatabase/LegacyManagement.epp 2015-01-12 00:21:07 UTC (rev 60484)
+++ firebird/trunk/src/auth/SecurityDatabase/LegacyManagement.epp 2015-01-12 00:21:38 UTC (rev 60485)
@@ -107,11 +107,12 @@
: database(0), transaction(0)
{
Firebird::LocalStatus s;
- config.assignRefNoIncr(par->getFirebirdConf(&s));
+ Firebird::CheckStatusWrapper statusWrapper(&s);
+ config.assignRefNoIncr(par->getFirebirdConf(&statusWrapper));
check(&s);
}
-void SecurityDatabaseManagement::start(Firebird::IStatus* st, Firebird::ILogonInfo* logonInfo)
+void SecurityDatabaseManagement::start(Firebird::CheckStatusWrapper* st, Firebird::ILogonInfo* logonInfo)
{
try
{
@@ -165,7 +166,7 @@
}
}
-void SecurityDatabaseManagement::commit(Firebird::IStatus* st)
+void SecurityDatabaseManagement::commit(Firebird::CheckStatusWrapper* st)
{
try
{
@@ -186,7 +187,7 @@
}
}
-void SecurityDatabaseManagement::rollback(Firebird::IStatus* st)
+void SecurityDatabaseManagement::rollback(Firebird::CheckStatusWrapper* st)
{
try
{
@@ -232,7 +233,7 @@
strncpy(to, from, len);
}
-int SecurityDatabaseManagement::execute(Firebird::IStatus* st, Firebird::IUser* user, Firebird::IListUsers* callback)
+int SecurityDatabaseManagement::execute(Firebird::CheckStatusWrapper* st, Firebird::IUser* user, Firebird::IListUsers* callback)
{
/*************************************
*
@@ -552,7 +553,9 @@
if (!user->userName()->entered())
{
Firebird::LocalStatus s2;
- Firebird::IStatus* s = st;
+ Firebird::CheckStatusWrapper statusWrapper2(&s2);
+ Firebird::CheckStatusWrapper* s = st;
+
FOR (TRANSACTION_HANDLE transaction REQUEST_HANDLE request) U IN PLG$VIEW_USERS
try
{
@@ -620,7 +623,7 @@
catch(const Firebird::Exception& ex)
{
ex.stuffException(s);
- s = &s2;
+ s = &statusWrapper2;
}
END_FOR
ON_ERROR
@@ -634,7 +637,9 @@
{
Firebird::string attr, a1, a2, a3;
Firebird::LocalStatus s2;
- Firebird::IStatus* s = st;
+ Firebird::CheckStatusWrapper statusWrapper2(&s2);
+ Firebird::CheckStatusWrapper* s = st;
+
FOR (TRANSACTION_HANDLE transaction REQUEST_HANDLE request) U IN PLG$VIEW_USERS
WITH U.PLG$USER_NAME EQ user->userName()->get()
@@ -700,7 +705,7 @@
catch(const Firebird::Exception& ex)
{
ex.stuffException(s);
- s = &s2;
+ s = &statusWrapper2;
}
END_FOR
ON_ERROR
Modified: firebird/trunk/src/auth/SecurityDatabase/LegacyManagement.h
===================================================================
--- firebird/trunk/src/auth/SecurityDatabase/LegacyManagement.h 2015-01-12 00:21:07 UTC (rev 60484)
+++ firebird/trunk/src/auth/SecurityDatabase/LegacyManagement.h 2015-01-12 00:21:38 UTC (rev 60485)
@@ -33,16 +33,16 @@
namespace Auth {
-class SecurityDatabaseManagement FB_FINAL : public Firebird::StdPlugin<Firebird::Api::IManagementImpl<SecurityDatabaseManagement> >
+class SecurityDatabaseManagement FB_FINAL : public Firebird::StdPlugin<Firebird::IManagementImpl<SecurityDatabaseManagement, Firebird::CheckStatusWrapper> >
{
public:
explicit SecurityDatabaseManagement(Firebird::IPluginConfig* par);
// IManagement implementation
- void start(Firebird::IStatus* status, Firebird::ILogonInfo* logonInfo);
- int execute(Firebird::IStatus* status, Firebird::IUser* user, Firebird::IListUsers* callback);
- void commit(Firebird::IStatus* status);
- void rollback(Firebird::IStatus* status);
+ void start(Firebird::CheckStatusWrapper* status, Firebird::ILogonInfo* logonInfo);
+ int execute(Firebird::CheckStatusWrapper* status, Firebird::IUser* user, Firebird::IListUsers* callback);
+ void commit(Firebird::CheckStatusWrapper* status);
+ void rollback(Firebird::CheckStatusWrapper* status);
int release();
Modified: firebird/trunk/src/auth/SecurityDatabase/LegacyServer.cpp
===================================================================
--- firebird/trunk/src/auth/SecurityDatabase/LegacyServer.cpp 2015-01-12 00:21:07 UTC (rev 60484)
+++ firebird/trunk/src/auth/SecurityDatabase/LegacyServer.cpp 2015-01-12 00:21:38 UTC (rev 60485)
@@ -123,7 +123,7 @@
namespace Auth {
-class SecurityDatabaseServer FB_FINAL : public Firebird::StdPlugin<Firebird::Api::IServerImpl<SecurityDatabaseServer> >
+class SecurityDatabaseServer FB_FINAL : public StdPlugin<IServerImpl<SecurityDatabaseServer, CheckStatusWrapper> >
{
public:
explicit SecurityDatabaseServer(Firebird::IPluginConfig* p)
@@ -131,14 +131,14 @@
{ }
// IServer implementation
- int authenticate(Firebird::IStatus* status, Firebird::IServerBlock* sBlock, Firebird::IWriter* writerInterface);
+ int authenticate(Firebird::CheckStatusWrapper* status, Firebird::IServerBlock* sBlock, Firebird::IWriter* writerInterface);
int release();
private:
Firebird::RefPtr<Firebird::IPluginConfig> iParameter;
};
-class SecurityDatabase FB_FINAL : public Firebird::RefCntIface<Firebird::Api::ITimerImpl<SecurityDatabase> >
+class SecurityDatabase FB_FINAL : public RefCntIface<ITimerImpl<SecurityDatabase, CheckStatusWrapper> >
{
public:
int verify(IWriter* authBlock, IServerBlock* sBlock);
@@ -472,7 +472,7 @@
const static unsigned int INIT_KEY = ((~0) - 1);
static unsigned int secDbKey = INIT_KEY;
-int SecurityDatabaseServer::authenticate(Firebird::IStatus* status, IServerBlock* sBlock,
+int SecurityDatabaseServer::authenticate(Firebird::CheckStatusWrapper* status, IServerBlock* sBlock,
IWriter* writerInterface)
{
status->init();
Modified: firebird/trunk/src/auth/trusted/AuthSspi.cpp
===================================================================
--- firebird/trunk/src/auth/trusted/AuthSspi.cpp 2015-01-12 00:21:07 UTC (rev 60484)
+++ firebird/trunk/src/auth/trusted/AuthSspi.cpp 2015-01-12 00:21:38 UTC (rev 60485)
@@ -342,7 +342,7 @@
: sspiData(getPool())
{ }
-int WinSspiServer::authenticate(Firebird::IStatus* status,
+int WinSspiServer::authenticate(Firebird::CheckStatusWrapper* status,
IServerBlock* sBlock,
IWriter* writerInterface)
{
@@ -398,7 +398,7 @@
return 1;
}
-int WinSspiClient::authenticate(Firebird::IStatus* status,
+int WinSspiClient::authenticate(Firebird::CheckStatusWrapper* status,
IClientBlock* cBlock)
{
try
Modified: firebird/trunk/src/auth/trusted/AuthSspi.h
===================================================================
--- firebird/trunk/src/auth/trusted/AuthSspi.h 2015-01-12 00:21:07 UTC (rev 60484)
+++ firebird/trunk/src/auth/trusted/AuthSspi.h 2015-01-12 00:21:38 UTC (rev 60485)
@@ -100,11 +100,11 @@
bool getLogin(Firebird::string& login, bool& wh);
};
-class WinSspiServer : public Firebird::StdPlugin<Firebird::Api::IServerImpl<WinSspiServer> >
+class WinSspiServer : public Firebird::StdPlugin<Firebird::IServerImpl<WinSspiServer, Firebird::CheckStatusWrapper> >
{
public:
// IServer implementation
- int authenticate(Firebird::IStatus* status, Firebird::IServerBlock* sBlock, Firebird::IWriter* writerInterface);
+ int authenticate(Firebird::CheckStatusWrapper* status, Firebird::IServerBlock* sBlock, Firebird::IWriter* writerInterface);
int release();
WinSspiServer(Firebird::IPluginConfig*);
@@ -114,11 +114,11 @@
AuthSspi sspi;
};
-class WinSspiClient : public Firebird::StdPlugin<Firebird::Api::IClientImpl<WinSspiClient> >
+class WinSspiClient : public Firebird::StdPlugin<Firebird::IClientImpl<WinSspiClient, Firebird::CheckStatusWrapper> >
{
public:
// IClient implementation
- int authenticate(Firebird::IStatus* status, Firebird::IClientBlock* sBlock);
+ int authenticate(Firebird::CheckStatusWrapper* status, Firebird::IClientBlock* sBlock);
int release();
WinSspiClient(Firebird::IPluginConfig*);
Modified: firebird/trunk/src/common/Auth.cpp
===================================================================
--- firebird/trunk/src/common/Auth.cpp 2015-01-12 00:21:07 UTC (rev 60484)
+++ firebird/trunk/src/common/Auth.cpp 2015-01-12 00:21:38 UTC (rev 60485)
@@ -60,7 +60,7 @@
sequence = 0;
}
-void WriterImplementation::add(Firebird::IStatus* st, const char* name)
+void WriterImplementation::add(Firebird::CheckStatusWrapper* st, const char* name)
{
try
{
@@ -98,7 +98,7 @@
result.insertBytes(sequence++, current.getBuffer(), current.getBufferLength());
}
-void WriterImplementation::setType(Firebird::IStatus* st, const char* value)
+void WriterImplementation::setType(Firebird::CheckStatusWrapper* st, const char* value)
{
try
{
@@ -111,7 +111,7 @@
}
}
-void WriterImplementation::setDb(Firebird::IStatus* st, const char* value)
+void WriterImplementation::setDb(Firebird::CheckStatusWrapper* st, const char* value)
{
try
{
Modified: firebird/trunk/src/common/Auth.h
===================================================================
--- firebird/trunk/src/common/Auth.h 2015-01-12 00:21:07 UTC (rev 60484)
+++ firebird/trunk/src/common/Auth.h 2015-01-12 00:21:38 UTC (rev 60485)
@@ -39,7 +39,7 @@
namespace Auth {
-class WriterImplementation : public Firebird::AutoIface<Firebird::Api::IWriterImpl<WriterImplementation> >
+class WriterImplementation : public Firebird::AutoIface<Firebird::IWriterImpl<WriterImplementation, Firebird::CheckStatusWrapper> >
{
public:
WriterImplementation();
@@ -49,9 +49,9 @@
// IWriter implementation
void reset();
- void add(Firebird::IStatus* st, const char* name);
- void setType(Firebird::IStatus* st, const char* value);
- void setDb(Firebird::IStatus* st, const char* value);
+ void add(Firebird::CheckStatusWrapper* st, const char* name);
+ void setType(Firebird::CheckStatusWrapper* st, const char* value);
+ void setDb(Firebird::CheckStatusWrapper* st, const char* value);
private:
Firebird::ClumpletWriter current, result;
Modified: firebird/trunk/src/common/MsgMetadata.cpp
===================================================================
--- firebird/trunk/src/common/MsgMetadata.cpp 2015-01-12 00:21:07 UTC (rev 60484)
+++ firebird/trunk/src/common/MsgMetadata.cpp 2015-01-12 00:21:38 UTC (rev 60485)
@@ -55,7 +55,7 @@
return 0;
}
-void MetadataBuilder::setType(IStatus* status, unsigned index, unsigned type)
+void MetadataBuilder::setType(CheckStatusWrapper* status, unsigned index, unsigned type)
{
try
{
@@ -81,7 +81,7 @@
}
}
-void MetadataBuilder::setSubType(IStatus* status, unsigned index, int subType)
+void MetadataBuilder::setSubType(CheckStatusWrapper* status, unsigned index, int subType)
{
try
{
@@ -96,7 +96,7 @@
}
}
-void MetadataBuilder::setLength(IStatus* status, unsigned index, unsigned length)
+void MetadataBuilder::setLength(CheckStatusWrapper* status, unsigned index, unsigned length)
{
try
{
@@ -114,7 +114,7 @@
}
}
-void MetadataBuilder::setCharSet(IStatus* status, unsigned index, unsigned charSet)
+void MetadataBuilder::setCharSet(CheckStatusWrapper* status, unsigned index, unsigned charSet)
{
try
{
@@ -129,7 +129,7 @@
}
}
-void MetadataBuilder::setScale(IStatus* status, unsigned index, unsigned scale)
+void MetadataBuilder::setScale(CheckStatusWrapper* status, unsigned index, unsigned scale)
{
try
{
@@ -144,7 +144,7 @@
}
}
-void MetadataBuilder::truncate(IStatus* status, unsigned count)
+void MetadataBuilder::truncate(CheckStatusWrapper* status, unsigned count)
{
try
{
@@ -161,7 +161,7 @@
}
}
-void MetadataBuilder::remove(IStatus* status, unsigned index)
+void MetadataBuilder::remove(CheckStatusWrapper* status, unsigned index)
{
try
{
@@ -177,7 +177,7 @@
}
}
-void MetadataBuilder::moveNameToIndex(IStatus* status, const char* name, unsigned index)
+void MetadataBuilder::moveNameToIndex(CheckStatusWrapper* status, const char* name, unsigned index)
{
try
{
@@ -206,7 +206,7 @@
}
}
-unsigned MetadataBuilder::addField(IStatus* status)
+unsigned MetadataBuilder::addField(CheckStatusWrapper* status)
{
try
{
@@ -224,7 +224,7 @@
}
}
-IMessageMetadata* MetadataBuilder::getMetadata(IStatus* status)
+IMessageMetadata* MetadataBuilder::getMetadata(CheckStatusWrapper* status)
{
try
{
@@ -311,7 +311,7 @@
}
-IMetadataBuilder* MsgMetadata::getBuilder(IStatus* status)
+IMetadataBuilder* MsgMetadata::getBuilder(CheckStatusWrapper* status)
{
try
{
Modified: firebird/trunk/src/common/MsgMetadata.h
===================================================================
--- firebird/trunk/src/common/MsgMetadata.h 2015-01-12 00:21:07 UTC (rev 60484)
+++ firebird/trunk/src/common/MsgMetadata.h 2015-01-12 00:21:38 UTC (rev 60485)
@@ -38,7 +38,7 @@
class StatementMetadata;
class MetadataFromBlr;
-class MsgMetadata : public RefCntIface<Api::IMessageMetadataImpl<MsgMetadata> >
+class MsgMetadata : public RefCntIface<IMessageMetadataImpl<MsgMetadata, CheckStatusWrapper> >
{
friend class MetadataBuilder;
friend class StatementMetadata;
@@ -140,12 +140,12 @@
// IMessageMetadata implementation
int release();
- unsigned getCount(IStatus* /*status*/)
+ unsigned getCount(CheckStatusWrapper* /*status*/)
{
return (unsigned) items.getCount();
}
- const char* getField(IStatus* status, unsigned index)
+ const char* getField(CheckStatusWrapper* status, unsigned index)
{
if (index < items.getCount())
return items[index].field.c_str();
@@ -154,7 +154,7 @@
return NULL;
}
- const char* getRelation(IStatus* status, unsigned index)
+ const char* getRelation(CheckStatusWrapper* status, unsigned index)
{
if (index < items.getCount())
return items[index].relation.c_str();
@@ -163,7 +163,7 @@
return NULL;
}
- const char* getOwner(IStatus* status, unsigned index)
+ const char* getOwner(CheckStatusWrapper* status, unsigned index)
{
if (index < items.getCount())
return items[index].owner.c_str();
@@ -172,7 +172,7 @@
return NULL;
}
- const char* getAlias(IStatus* status, unsigned index)
+ const char* getAlias(CheckStatusWrapper* status, unsigned index)
{
if (index < items.getCount())
return items[index].alias.c_str();
@@ -181,7 +181,7 @@
return NULL;
}
- unsigned getType(IStatus* status, unsigned index)
+ unsigned getType(CheckStatusWrapper* status, unsigned index)
{
if (index < items.getCount())
return items[index].type;
@@ -190,7 +190,7 @@
return 0;
}
- FB_BOOLEAN isNullable(IStatus* status, unsigned index)
+ FB_BOOLEAN isNullable(CheckStatusWrapper* status, unsigned index)
{
if (index < items.getCount())
return items[index].nullable;
@@ -199,7 +199,7 @@
return false;
}
- int getSubType(IStatus* status, unsigned index)
+ int getSubType(CheckStatusWrapper* status, unsigned index)
{
if (index < items.getCount())
return items[index].subType;
@@ -208,7 +208,7 @@
return 0;
}
- unsigned getLength(IStatus* status, unsigned index)
+ unsigned getLength(CheckStatusWrapper* status, unsigned index)
{
if (index < items.getCount())
return items[index].length;
@@ -217,7 +217,7 @@
return 0;
}
- int getScale(IStatus* status, unsigned index)
+ int getScale(CheckStatusWrapper* status, unsigned index)
{
if (index < items.getCount())
return items[index].scale;
@@ -226,7 +226,7 @@
return 0;
}
- unsigned getCharSet(IStatus* status, unsigned index)
+ unsigned getCharSet(CheckStatusWrapper* status, unsigned index)
{
if (index < items.getCount())
return items[index].charSet;
@@ -235,7 +235,7 @@
return 0;
}
- unsigned getOffset(IStatus* status, unsigned index)
+ unsigned getOffset(CheckStatusWrapper* status, unsigned index)
{
if (index < items.getCount())
return items[index].offset;
@@ -244,7 +244,7 @@
return 0;
}
- unsigned getNullOffset(IStatus* status, unsigned index)
+ unsigned getNullOffset(CheckStatusWrapper* status, unsigned index)
{
if (index < items.getCount())
return items[index].nullInd;
@@ -253,9 +253,9 @@
return 0;
}
- IMetadataBuilder* getBuilder(IStatus* status);
+ IMetadataBuilder* getBuilder(CheckStatusWrapper* status);
- unsigned getMessageLength(IStatus* /*status*/)
+ unsigned getMessageLength(CheckStatusWrapper* /*status*/)
{
return length;
}
@@ -265,7 +265,7 @@
unsigned makeOffsets();
private:
- void raiseIndexError(IStatus* status, unsigned index, const char* method) const
+ void raiseIndexError(CheckStatusWrapper* status, unsigned index, const char* method) const
{
(Arg::Gds(isc_invalid_index_val) <<
Arg::Num(index) << (string("IMessageMetadata::") + method)).copyTo(status);
@@ -278,7 +278,7 @@
unsigned length;
};
-//class AttMetadata : public Api::IMessageMetadataBaseImpl<AttMetadata, MsgMetadata>
+//class AttMetadata : public IMessageMetadataBaseImpl<AttMetadata, CheckStatusWrapper, MsgMetadata>
class AttMetadata : public MsgMetadata
{
public:
@@ -292,7 +292,7 @@
RefPtr<RefCounted> attachment;
};
-class MetadataBuilder FB_FINAL : public RefCntIface<Api::IMetadataBuilderImpl<MetadataBuilder> >
+class MetadataBuilder FB_FINAL : public RefCntIface<IMetadataBuilderImpl<MetadataBuilder, CheckStatusWrapper> >
{
public:
explicit MetadataBuilder(const MsgMetadata* from);
@@ -301,16 +301,16 @@
int release();
// IMetadataBuilder implementation
- void setType(IStatus* status, unsigned index, unsigned type);
- void setSubType(IStatus* status, unsigned index, int subType);
- void setLength(IStatus* status, unsigned index, unsigned length);
- void setCharSet(IStatus* status, unsigned index, unsigned charSet);
- void setScale(IStatus* status, unsigned index, unsigned scale);
- void truncate(IStatus* status, unsigned count);
- void remove(IStatus* status, unsigned index);
- void moveNameToIndex(IStatus* status, const char* name, unsigned index);
- unsigned addField(IStatus* status);
- IMessageMetadata* getMetadata(IStatus* status);
+ void setType(CheckStatusWrapper* status, unsigned index, unsigned type);
+ void setSubType(CheckStatusWrapper* status, unsigned index, int subType);
+ void setLength(CheckStatusWrapper* status, unsigned index, unsigned length);
+ void setCharSet(CheckStatusWrapper* status, unsigned index, unsigned charSet);
+ void setScale(CheckStatusWrapper* status, unsigned index, unsigned scale);
+ void truncate(CheckStatusWrapper* status, unsigned count);
+ void remove(CheckStatusWrapper* status, unsigned index);
+ void moveNameToIndex(CheckStatusWrapper* status, const char* name, unsigned index);
+ unsigned addField(CheckStatusWrapper* status);
+ IMessageMetadata* getMetadata(CheckStatusWrappe...
[truncated message content] |