mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 23:23:02 +01:00
Misc
This commit is contained in:
parent
481c0eb531
commit
c991e7d5cf
@ -53,7 +53,7 @@ Syntax and notes :
|
||||
b) if AS USER clause is omitted or <user_name> equal to CURRENT_USER
|
||||
and if ROLE clause is omitted or <role_name> equal to CURRENT_ROLE
|
||||
then the statement is executed in current connection context
|
||||
c) if <user_name> not equal to CURRENT_USER or <role_name> not equal to CURRENT_ROLE
|
||||
c) if <user_name> is not equal to CURRENT_USER or <role_name> not equal to CURRENT_ROLE
|
||||
then the statement is executed in separate connection established inside the same
|
||||
engine instance (i.e. created new internal connection without Y-Valve and remote layers).
|
||||
|
||||
|
@ -56,7 +56,7 @@ Mutex Manager::m_mutex;
|
||||
Provider* Manager::m_providers = NULL;
|
||||
bool Manager::m_initialized = false;
|
||||
|
||||
Manager::Manager(MemoryPool &pool) :
|
||||
Manager::Manager(MemoryPool& pool) :
|
||||
PermanentStorage(pool)
|
||||
{
|
||||
}
|
||||
@ -89,7 +89,7 @@ void Manager::addProvider(Provider* provider)
|
||||
provider->initialize();
|
||||
}
|
||||
|
||||
Provider* Manager::getProvider(const string &prvName)
|
||||
Provider* Manager::getProvider(const string& prvName)
|
||||
{
|
||||
for (Provider* prv = m_providers; prv; prv = prv->m_next) {
|
||||
if (prv->m_name == prvName) {
|
||||
@ -102,8 +102,8 @@ Provider* Manager::getProvider(const string &prvName)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Connection* Manager::getConnection(thread_db *tdbb, const string &dataSource,
|
||||
const string &user, const string &pwd, const string &role, TraScope tra_scope)
|
||||
Connection* Manager::getConnection(thread_db* tdbb, const string& dataSource,
|
||||
const string& user, const string& pwd, const string& role, TraScope tra_scope)
|
||||
{
|
||||
if (!m_initialized)
|
||||
{
|
||||
@ -147,7 +147,7 @@ Connection* Manager::getConnection(thread_db *tdbb, const string &dataSource,
|
||||
return prv->getConnection(tdbb, dbName, user, pwd, role, tra_scope);
|
||||
}
|
||||
|
||||
void Manager::jrdAttachmentEnd(thread_db *tdbb, Jrd::Attachment* att)
|
||||
void Manager::jrdAttachmentEnd(thread_db* tdbb, Jrd::Attachment* att)
|
||||
{
|
||||
for (Provider* prv = m_providers; prv; prv = prv->m_next) {
|
||||
prv->jrdAttachmentEnd(tdbb, att);
|
||||
@ -156,7 +156,7 @@ void Manager::jrdAttachmentEnd(thread_db *tdbb, Jrd::Attachment* att)
|
||||
|
||||
int Manager::shutdown(const int /*reason*/, const int /*mask*/, void* /*arg*/)
|
||||
{
|
||||
thread_db *tdbb = JRD_get_thread_data();
|
||||
thread_db* tdbb = JRD_get_thread_data();
|
||||
for (Provider* prv = m_providers; prv; prv = prv->m_next) {
|
||||
prv->cancelConnections(tdbb);
|
||||
}
|
||||
@ -176,21 +176,21 @@ Provider::Provider(const char* prvName) :
|
||||
|
||||
Provider::~Provider()
|
||||
{
|
||||
thread_db *tdbb = JRD_get_thread_data();
|
||||
thread_db* tdbb = JRD_get_thread_data();
|
||||
clearConnections(tdbb);
|
||||
}
|
||||
|
||||
Connection* Provider::getConnection(thread_db *tdbb, const string &dbName,
|
||||
const string &user, const string &pwd, const string &role, TraScope tra_scope)
|
||||
Connection* Provider::getConnection(thread_db* tdbb, const string& dbName,
|
||||
const string& user, const string& pwd, const string& role, TraScope tra_scope)
|
||||
{
|
||||
MutexLockGuard guard(m_mutex);
|
||||
|
||||
Connection **conn_ptr = m_connections.begin();
|
||||
Connection **end = m_connections.end();
|
||||
Connection** conn_ptr = m_connections.begin();
|
||||
Connection** end = m_connections.end();
|
||||
|
||||
for (; conn_ptr < end; conn_ptr++)
|
||||
{
|
||||
Connection *conn = *conn_ptr;
|
||||
Connection* conn = *conn_ptr;
|
||||
if (conn->isSameDatabase(tdbb, dbName, user, pwd, role) &&
|
||||
conn->isAvailable(tdbb, tra_scope))
|
||||
{
|
||||
@ -198,8 +198,9 @@ Connection* Provider::getConnection(thread_db *tdbb, const string &dbName,
|
||||
}
|
||||
}
|
||||
|
||||
Connection *conn = doCreateConnection();
|
||||
try {
|
||||
Connection* conn = doCreateConnection();
|
||||
try
|
||||
{
|
||||
conn->attach(tdbb, dbName, user, pwd, role);
|
||||
}
|
||||
catch (...)
|
||||
@ -214,7 +215,7 @@ Connection* Provider::getConnection(thread_db *tdbb, const string &dbName,
|
||||
|
||||
// hvlad: in current implementation I didn't return connections in pool as
|
||||
// I have not implemented way to delete long idle connections.
|
||||
void Provider::releaseConnection(thread_db *tdbb, Connection& conn, bool /*inPool*/)
|
||||
void Provider::releaseConnection(thread_db* tdbb, Connection& conn, bool /*inPool*/)
|
||||
{
|
||||
MutexLockGuard guard(m_mutex);
|
||||
|
||||
@ -229,12 +230,12 @@ void Provider::releaseConnection(thread_db *tdbb, Connection& conn, bool /*inPoo
|
||||
fb_assert(false);
|
||||
}
|
||||
|
||||
void Provider::clearConnections(thread_db *tdbb)
|
||||
void Provider::clearConnections(thread_db* tdbb)
|
||||
{
|
||||
MutexLockGuard guard(m_mutex);
|
||||
|
||||
Connection **ptr = m_connections.begin();
|
||||
Connection **end = m_connections.end();
|
||||
Connection** ptr = m_connections.begin();
|
||||
Connection** end = m_connections.end();
|
||||
|
||||
for (; ptr < end; ptr++)
|
||||
{
|
||||
@ -245,12 +246,12 @@ void Provider::clearConnections(thread_db *tdbb)
|
||||
m_connections.clear();
|
||||
}
|
||||
|
||||
void Provider::cancelConnections(thread_db *tdbb)
|
||||
void Provider::cancelConnections(thread_db* tdbb)
|
||||
{
|
||||
MutexLockGuard guard(m_mutex);
|
||||
|
||||
Connection **ptr = m_connections.begin();
|
||||
Connection **end = m_connections.end();
|
||||
Connection** ptr = m_connections.begin();
|
||||
Connection** end = m_connections.end();
|
||||
|
||||
for (; ptr < end; ptr++) {
|
||||
(*ptr)->cancelExecution(tdbb);
|
||||
@ -259,7 +260,7 @@ void Provider::cancelConnections(thread_db *tdbb)
|
||||
|
||||
// Connection
|
||||
|
||||
Connection::Connection(Provider &prov) :
|
||||
Connection::Connection(Provider& prov) :
|
||||
PermanentStorage(prov.getPool()),
|
||||
m_provider(prov),
|
||||
m_dbName(getPool()),
|
||||
@ -274,7 +275,7 @@ Connection::Connection(Provider &prov) :
|
||||
{
|
||||
}
|
||||
|
||||
void Connection::deleteConnection(thread_db *tdbb, Connection *conn)
|
||||
void Connection::deleteConnection(thread_db* tdbb, Connection* conn)
|
||||
{
|
||||
conn->m_deleting = true;
|
||||
|
||||
@ -288,13 +289,13 @@ Connection::~Connection()
|
||||
{
|
||||
}
|
||||
|
||||
void Connection::generateDPB(thread_db *tdbb, ClumpletWriter &dpb,
|
||||
const string &user, const string &pwd, const string &role) const
|
||||
void Connection::generateDPB(thread_db* tdbb, ClumpletWriter& dpb,
|
||||
const string& user, const string& pwd, const string& role) const
|
||||
{
|
||||
dpb.reset(isc_dpb_version1);
|
||||
|
||||
string &attUser = tdbb->getAttachment()->att_user->usr_user_name;
|
||||
string &attRole = tdbb->getAttachment()->att_user->usr_sql_role_name;
|
||||
string& attUser = tdbb->getAttachment()->att_user->usr_user_name;
|
||||
string& attRole = tdbb->getAttachment()->att_user->usr_sql_role_name;
|
||||
|
||||
if ((m_provider.getFlags() & prvTrustedAuth) &&
|
||||
(user.isEmpty() || user == attUser) && pwd.isEmpty() &&
|
||||
@ -322,8 +323,8 @@ void Connection::generateDPB(thread_db *tdbb, ClumpletWriter &dpb,
|
||||
}
|
||||
}
|
||||
|
||||
bool Connection::isSameDatabase(thread_db *tdbb, const string &dbName,
|
||||
const string &user, const string &pwd, const string &role) const
|
||||
bool Connection::isSameDatabase(thread_db* tdbb, const string& dbName,
|
||||
const string& user, const string& pwd, const string& role) const
|
||||
{
|
||||
if (m_dbName != dbName)
|
||||
return false;
|
||||
@ -342,7 +343,7 @@ Transaction* Connection::createTransaction()
|
||||
return tran;
|
||||
}
|
||||
|
||||
void Connection::deleteTransaction(Transaction *tran)
|
||||
void Connection::deleteTransaction(Transaction* tran)
|
||||
{
|
||||
size_t pos;
|
||||
if (m_transactions.find(tran, pos))
|
||||
@ -358,13 +359,13 @@ void Connection::deleteTransaction(Transaction *tran)
|
||||
m_provider.releaseConnection(JRD_get_thread_data(), *this);
|
||||
}
|
||||
|
||||
Statement* Connection::createStatement(const string &sql)
|
||||
Statement* Connection::createStatement(const string& sql)
|
||||
{
|
||||
m_used_stmts++;
|
||||
|
||||
for (Statement **stmt_ptr = &m_freeStatements; *stmt_ptr; stmt_ptr = &(*stmt_ptr)->m_nextFree)
|
||||
for (Statement** stmt_ptr = &m_freeStatements; *stmt_ptr; stmt_ptr = &(*stmt_ptr)->m_nextFree)
|
||||
{
|
||||
Statement *stmt = *stmt_ptr;
|
||||
Statement* stmt = *stmt_ptr;
|
||||
if (stmt->getSql() == sql)
|
||||
{
|
||||
*stmt_ptr = stmt->m_nextFree;
|
||||
@ -376,19 +377,19 @@ Statement* Connection::createStatement(const string &sql)
|
||||
|
||||
if (m_freeStatements)
|
||||
{
|
||||
Statement *stmt = m_freeStatements;
|
||||
Statement* stmt = m_freeStatements;
|
||||
m_freeStatements = stmt->m_nextFree;
|
||||
stmt->m_nextFree = NULL;
|
||||
m_free_stmts--;
|
||||
return stmt;
|
||||
}
|
||||
|
||||
Statement *stmt = doCreateStatement();
|
||||
Statement* stmt = doCreateStatement();
|
||||
m_statements.add(stmt);
|
||||
return stmt;
|
||||
}
|
||||
|
||||
void Connection::releaseStatement(Jrd::thread_db *tdbb, Statement *stmt)
|
||||
void Connection::releaseStatement(Jrd::thread_db* tdbb, Statement* stmt)
|
||||
{
|
||||
fb_assert(stmt && !stmt->isActive());
|
||||
|
||||
@ -417,23 +418,23 @@ void Connection::releaseStatement(Jrd::thread_db *tdbb, Statement *stmt)
|
||||
m_provider.releaseConnection(tdbb, *this);
|
||||
}
|
||||
|
||||
void Connection::clearTransactions(Jrd::thread_db *tdbb)
|
||||
void Connection::clearTransactions(Jrd::thread_db* tdbb)
|
||||
{
|
||||
while (m_transactions.getCount())
|
||||
{
|
||||
Transaction *tran = m_transactions[0];
|
||||
Transaction* tran = m_transactions[0];
|
||||
tran->rollback(tdbb, false);
|
||||
}
|
||||
}
|
||||
|
||||
void Connection::clearStatements(thread_db *tdbb)
|
||||
void Connection::clearStatements(thread_db* tdbb)
|
||||
{
|
||||
Statement **stmt_ptr = m_statements.begin();
|
||||
Statement **end = m_statements.end();
|
||||
Statement** stmt_ptr = m_statements.begin();
|
||||
Statement** end = m_statements.end();
|
||||
|
||||
for (; stmt_ptr < end; stmt_ptr++)
|
||||
{
|
||||
Statement *stmt = *stmt_ptr;
|
||||
Statement* stmt = *stmt_ptr;
|
||||
if (stmt->isActive())
|
||||
stmt->close(tdbb);
|
||||
Statement::deleteStatement(tdbb, stmt);
|
||||
@ -445,7 +446,7 @@ void Connection::clearStatements(thread_db *tdbb)
|
||||
m_free_stmts = m_used_stmts = 0;
|
||||
}
|
||||
|
||||
void Connection::detach(thread_db *tdbb)
|
||||
void Connection::detach(thread_db* tdbb)
|
||||
{
|
||||
const bool was_deleting = m_deleting;
|
||||
m_deleting = true;
|
||||
@ -468,10 +469,10 @@ void Connection::detach(thread_db *tdbb)
|
||||
doDetach(tdbb);
|
||||
}
|
||||
|
||||
Transaction* Connection::findTransaction(thread_db *tdbb, TraScope traScope) const
|
||||
Transaction* Connection::findTransaction(thread_db* tdbb, TraScope traScope) const
|
||||
{
|
||||
jrd_tra *tran = tdbb->getTransaction();
|
||||
Transaction *ext_tran = NULL;
|
||||
jrd_tra* tran = tdbb->getTransaction();
|
||||
Transaction* ext_tran = NULL;
|
||||
|
||||
switch (traScope)
|
||||
{
|
||||
@ -496,7 +497,7 @@ Transaction* Connection::findTransaction(thread_db *tdbb, TraScope traScope) con
|
||||
return ext_tran;
|
||||
}
|
||||
|
||||
void Connection::raise(ISC_STATUS* status, thread_db *tdbb, const char* sWhere)
|
||||
void Connection::raise(ISC_STATUS* status, thread_db* tdbb, const char* sWhere)
|
||||
{
|
||||
string rem_err;
|
||||
m_provider.getRemoteError(status, rem_err);
|
||||
@ -510,7 +511,7 @@ void Connection::raise(ISC_STATUS* status, thread_db *tdbb, const char* sWhere)
|
||||
|
||||
// Transaction
|
||||
|
||||
Transaction::Transaction(Connection &conn) :
|
||||
Transaction::Transaction(Connection& conn) :
|
||||
PermanentStorage(conn.getProvider()->getPool()),
|
||||
m_provider(*conn.getProvider()),
|
||||
m_connection(conn),
|
||||
@ -523,7 +524,7 @@ Transaction::~Transaction()
|
||||
{
|
||||
}
|
||||
|
||||
void Transaction::generateTPB(thread_db *tdbb, ClumpletWriter &tpb,
|
||||
void Transaction::generateTPB(thread_db* tdbb, ClumpletWriter& tpb,
|
||||
TraModes traMode, bool readOnly, bool wait, int lockTimeout) const
|
||||
{
|
||||
switch (traMode)
|
||||
@ -553,7 +554,7 @@ void Transaction::generateTPB(thread_db *tdbb, ClumpletWriter &tpb,
|
||||
tpb.insertInt(isc_tpb_lock_timeout, lockTimeout);
|
||||
}
|
||||
|
||||
void Transaction::start(thread_db *tdbb, TraScope traScope, TraModes traMode,
|
||||
void Transaction::start(thread_db* tdbb, TraScope traScope, TraModes traMode,
|
||||
bool readOnly, bool wait, int lockTimeout)
|
||||
{
|
||||
m_scope = traScope;
|
||||
@ -568,7 +569,7 @@ void Transaction::start(thread_db *tdbb, TraScope traScope, TraModes traMode,
|
||||
m_connection.raise(status, tdbb, "transaction start");
|
||||
}
|
||||
|
||||
jrd_tra *tran = tdbb->getTransaction();
|
||||
jrd_tra* tran = tdbb->getTransaction();
|
||||
switch (m_scope)
|
||||
{
|
||||
case traCommon :
|
||||
@ -585,7 +586,7 @@ void Transaction::start(thread_db *tdbb, TraScope traScope, TraModes traMode,
|
||||
}
|
||||
}
|
||||
|
||||
void Transaction::prepare(thread_db *tdbb, int info_len, const char* info)
|
||||
void Transaction::prepare(thread_db* tdbb, int info_len, const char* info)
|
||||
{
|
||||
ISC_STATUS_ARRAY status = {0};
|
||||
doPrepare(status, tdbb, info_len, info);
|
||||
@ -595,7 +596,7 @@ void Transaction::prepare(thread_db *tdbb, int info_len, const char* info)
|
||||
}
|
||||
}
|
||||
|
||||
void Transaction::commit(thread_db *tdbb, bool retain)
|
||||
void Transaction::commit(thread_db* tdbb, bool retain)
|
||||
{
|
||||
ISC_STATUS_ARRAY status = {0};
|
||||
doCommit(status, tdbb, retain);
|
||||
@ -611,12 +612,12 @@ void Transaction::commit(thread_db *tdbb, bool retain)
|
||||
}
|
||||
}
|
||||
|
||||
void Transaction::rollback(thread_db *tdbb, bool retain)
|
||||
void Transaction::rollback(thread_db* tdbb, bool retain)
|
||||
{
|
||||
ISC_STATUS_ARRAY status = {0};
|
||||
doRollback(status, tdbb, retain);
|
||||
|
||||
Connection &conn = m_connection;
|
||||
Connection& conn = m_connection;
|
||||
if (!retain)
|
||||
{
|
||||
detachFromJrdTran();
|
||||
@ -628,10 +629,10 @@ void Transaction::rollback(thread_db *tdbb, bool retain)
|
||||
}
|
||||
}
|
||||
|
||||
Transaction* Transaction::getTransaction(thread_db *tdbb, Connection *conn, TraScope tra_scope)
|
||||
Transaction* Transaction::getTransaction(thread_db* tdbb, Connection* conn, TraScope tra_scope)
|
||||
{
|
||||
jrd_tra *tran = tdbb->getTransaction();
|
||||
Transaction *ext_tran = conn->findTransaction(tdbb, tra_scope);
|
||||
jrd_tra* tran = tdbb->getTransaction();
|
||||
Transaction* ext_tran = conn->findTransaction(tdbb, tra_scope);
|
||||
|
||||
if (!ext_tran)
|
||||
{
|
||||
@ -676,7 +677,7 @@ void Transaction::detachFromJrdTran()
|
||||
if (!m_jrdTran)
|
||||
return;
|
||||
|
||||
Transaction **tran_ptr = &m_jrdTran->tra_ext_common;
|
||||
Transaction** tran_ptr = &m_jrdTran->tra_ext_common;
|
||||
for (; *tran_ptr; tran_ptr = &(*tran_ptr)->m_nextTran)
|
||||
{
|
||||
if (*tran_ptr == this)
|
||||
@ -690,7 +691,7 @@ void Transaction::detachFromJrdTran()
|
||||
fb_assert(false);
|
||||
}
|
||||
|
||||
void Transaction::jrdTransactionEnd(thread_db *tdbb, jrd_tra* transaction,
|
||||
void Transaction::jrdTransactionEnd(thread_db* tdbb, jrd_tra* transaction,
|
||||
bool commit, bool retain, bool force)
|
||||
{
|
||||
Transaction* tran = transaction->tra_ext_common;
|
||||
@ -719,7 +720,7 @@ void Transaction::jrdTransactionEnd(thread_db *tdbb, jrd_tra* transaction,
|
||||
|
||||
// Statement
|
||||
|
||||
Statement::Statement(Connection &conn) :
|
||||
Statement::Statement(Connection& conn) :
|
||||
PermanentStorage(conn.getProvider()->getPool()),
|
||||
m_provider(*conn.getProvider()),
|
||||
m_connection(conn),
|
||||
@ -753,13 +754,13 @@ Statement::~Statement()
|
||||
clearNames();
|
||||
}
|
||||
|
||||
void Statement::deleteStatement(Jrd::thread_db *tdbb, Statement *stmt)
|
||||
void Statement::deleteStatement(Jrd::thread_db* tdbb, Statement* stmt)
|
||||
{
|
||||
stmt->deallocate(tdbb);
|
||||
delete stmt;
|
||||
}
|
||||
|
||||
void Statement::prepare(thread_db *tdbb, Transaction *tran, const string& sql, bool named)
|
||||
void Statement::prepare(thread_db* tdbb, Transaction* tran, const string& sql, bool named)
|
||||
{
|
||||
fb_assert(!m_active);
|
||||
|
||||
@ -825,7 +826,7 @@ void Statement::open(thread_db* tdbb, Transaction* tran, int in_count,
|
||||
m_active = true;
|
||||
}
|
||||
|
||||
bool Statement::fetch(thread_db *tdbb, int out_count, jrd_nod **out_params)
|
||||
bool Statement::fetch(thread_db* tdbb, int out_count, jrd_nod** out_params)
|
||||
{
|
||||
fb_assert(isAllocated() && m_stmt_selectable);
|
||||
fb_assert(!m_error);
|
||||
@ -850,7 +851,7 @@ bool Statement::fetch(thread_db *tdbb, int out_count, jrd_nod **out_params)
|
||||
return true;
|
||||
}
|
||||
|
||||
void Statement::close(thread_db *tdbb)
|
||||
void Statement::close(thread_db* tdbb)
|
||||
{
|
||||
// we must stuff exception if and only if this is the first time it occurs
|
||||
// once we stuff exception we must punt
|
||||
@ -921,7 +922,7 @@ void Statement::close(thread_db *tdbb)
|
||||
}
|
||||
}
|
||||
|
||||
void Statement::deallocate(thread_db *tdbb)
|
||||
void Statement::deallocate(thread_db* tdbb)
|
||||
{
|
||||
if (isAllocated()) {
|
||||
try {
|
||||
@ -937,10 +938,10 @@ void Statement::deallocate(thread_db *tdbb)
|
||||
|
||||
enum TokenType {ttNone, ttWhite, ttComment, ttBrokenComment, ttString, ttParamMark, ttIdent, ttOther};
|
||||
|
||||
static TokenType getToken(const char **begin, const char *end)
|
||||
static TokenType getToken(const char** begin, const char* end)
|
||||
{
|
||||
TokenType ret = ttNone;
|
||||
const char *p = *begin;
|
||||
const char* p = *begin;
|
||||
|
||||
char c = *p++;
|
||||
switch (c)
|
||||
@ -1032,7 +1033,7 @@ static TokenType getToken(const char **begin, const char *end)
|
||||
void Statement::preprocess(const string& sql, string& ret)
|
||||
{
|
||||
bool passAsIs = true, execBlock = false;
|
||||
const char *p = sql.begin(), *end = sql.end();
|
||||
const char* p = sql.begin(), *end = sql.end();
|
||||
const char* start = p;
|
||||
TokenType tok = getToken(&p, end);
|
||||
|
||||
@ -1056,7 +1057,7 @@ void Statement::preprocess(const string& sql, string& ret)
|
||||
|
||||
if (ident == "EXECUTE")
|
||||
{
|
||||
const char *i2 = p;
|
||||
const char* i2 = p;
|
||||
tok = getToken(&p, end);
|
||||
while (p < end && (tok == ttComment || tok == ttWhite))
|
||||
{
|
||||
@ -1180,7 +1181,7 @@ void Statement::setInParams(thread_db* tdbb, int count, const string* const* nam
|
||||
{
|
||||
const int sqlCount = m_sqlParamsMap.getCount();
|
||||
Array<jrd_nod*> sqlParamsArray(getPool(), 16);
|
||||
jrd_nod **sqlParams = sqlParamsArray.getBuffer(sqlCount);
|
||||
jrd_nod** sqlParams = sqlParamsArray.getBuffer(sqlCount);
|
||||
|
||||
for (int sqlNum = 0; sqlNum < sqlCount; sqlNum++)
|
||||
{
|
||||
@ -1277,7 +1278,7 @@ void Statement::doSetInParams(thread_db* tdbb, int count, const string* const* /
|
||||
|
||||
|
||||
// m_outDescs -> jrd_nod
|
||||
void Statement::getOutParams(thread_db *tdbb, int count, jrd_nod **params)
|
||||
void Statement::getOutParams(thread_db* tdbb, int count, jrd_nod** params)
|
||||
{
|
||||
if (count != getOutputs())
|
||||
{
|
||||
@ -1289,7 +1290,7 @@ void Statement::getOutParams(thread_db *tdbb, int count, jrd_nod **params)
|
||||
if (!count)
|
||||
return;
|
||||
|
||||
jrd_nod **jrdVar = params;
|
||||
jrd_nod** jrdVar = params;
|
||||
for (int i = 0; i < count; i++, jrdVar++)
|
||||
{
|
||||
/*
|
||||
@ -1303,8 +1304,8 @@ void Statement::getOutParams(thread_db *tdbb, int count, jrd_nod **params)
|
||||
*/
|
||||
|
||||
// build the src descriptor
|
||||
dsc &src = m_outDescs[i * 2];
|
||||
const dsc &null = m_outDescs[i * 2 + 1];
|
||||
dsc& src = m_outDescs[i * 2];
|
||||
const dsc& null = m_outDescs[i * 2 + 1];
|
||||
dsc* local = &src;
|
||||
dsc localDsc;
|
||||
bid localBlobID;
|
||||
@ -1324,9 +1325,9 @@ void Statement::getOutParams(thread_db *tdbb, int count, jrd_nod **params)
|
||||
}
|
||||
|
||||
// read external blob (src), store it as temporary local blob and put local blob_id into dst
|
||||
void Statement::getExtBlob(thread_db *tdbb, const dsc &src, dsc &dst)
|
||||
void Statement::getExtBlob(thread_db* tdbb, const dsc& src, dsc& dst)
|
||||
{
|
||||
blb *destBlob = NULL;
|
||||
blb* destBlob = NULL;
|
||||
AutoPtr<Blob> extBlob(m_connection.createBlob());
|
||||
try
|
||||
{
|
||||
@ -1334,7 +1335,7 @@ void Statement::getExtBlob(thread_db *tdbb, const dsc &src, dsc &dst)
|
||||
|
||||
jrd_req* request = tdbb->getRequest();
|
||||
const UCHAR bpb[] = {isc_bpb_version1, isc_bpb_storage, isc_bpb_storage_temp};
|
||||
bid *localBlobID = (bid*) dst.dsc_address;
|
||||
bid* localBlobID = (bid*) dst.dsc_address;
|
||||
destBlob = BLB_create2(tdbb, request->req_transaction, localBlobID, sizeof(bpb), bpb);
|
||||
|
||||
// hvlad ?
|
||||
@ -1368,7 +1369,7 @@ void Statement::getExtBlob(thread_db *tdbb, const dsc &src, dsc &dst)
|
||||
}
|
||||
|
||||
// read local blob, store it as external blob and put external blob_id in dst
|
||||
void Statement::putExtBlob(thread_db *tdbb, dsc &src, dsc &dst)
|
||||
void Statement::putExtBlob(thread_db* tdbb, dsc& src, dsc& dst)
|
||||
{
|
||||
blb* srcBlob = NULL;
|
||||
AutoPtr<Blob> extBlob(m_connection.createBlob());
|
||||
@ -1377,7 +1378,7 @@ void Statement::putExtBlob(thread_db *tdbb, dsc &src, dsc &dst)
|
||||
extBlob->create(tdbb, *m_transaction, dst, NULL);
|
||||
|
||||
jrd_req* request = tdbb->getRequest();
|
||||
bid *srcBid = (bid*) src.dsc_address;
|
||||
bid* srcBid = (bid*) src.dsc_address;
|
||||
|
||||
UCharBuffer bpb;
|
||||
BLB_gen_bpb_from_descs(&src, &dst, bpb);
|
||||
@ -1412,7 +1413,7 @@ void Statement::putExtBlob(thread_db *tdbb, dsc &src, dsc &dst)
|
||||
|
||||
void Statement::clearNames()
|
||||
{
|
||||
string **s = m_sqlParamNames.begin(), **end = m_sqlParamNames.end();
|
||||
string** s = m_sqlParamNames.begin(), **end = m_sqlParamNames.end();
|
||||
for (; s < end; s++)
|
||||
{
|
||||
delete *s;
|
||||
@ -1424,7 +1425,7 @@ void Statement::clearNames()
|
||||
}
|
||||
|
||||
|
||||
void Statement::raise(ISC_STATUS* status, thread_db *tdbb, const char* sWhere,
|
||||
void Statement::raise(ISC_STATUS* status, thread_db* tdbb, const char* sWhere,
|
||||
const string* sQuery)
|
||||
{
|
||||
m_error = true;
|
||||
@ -1488,7 +1489,7 @@ void Statement::unBindFromRequest()
|
||||
|
||||
// EngineCallbackGuard
|
||||
|
||||
void EngineCallbackGuard::init(thread_db *tdbb, Connection &conn)
|
||||
void EngineCallbackGuard::init(thread_db* tdbb, Connection& conn)
|
||||
{
|
||||
m_tdbb = tdbb;
|
||||
m_mutex = conn.isConnected() ? &conn.m_mutex : &conn.m_provider.m_mutex;
|
||||
|
@ -50,25 +50,25 @@ enum TraModes {traReadCommited, traReadCommitedRecVersions, traConcurrency, traC
|
||||
enum TraScope {traAutonomous = 1, traCommon, traTwoPhase};
|
||||
|
||||
// Known built-in provider's names
|
||||
extern const char *FIREBIRD_PROVIDER_NAME;
|
||||
extern const char *INTERNAL_PROVIDER_NAME;
|
||||
extern const char* FIREBIRD_PROVIDER_NAME;
|
||||
extern const char* INTERNAL_PROVIDER_NAME;
|
||||
|
||||
|
||||
// Manage providers
|
||||
class Manager : public Firebird::PermanentStorage
|
||||
{
|
||||
public:
|
||||
explicit Manager(Firebird::MemoryPool &pool);
|
||||
explicit Manager(Firebird::MemoryPool& pool);
|
||||
~Manager();
|
||||
|
||||
static void addProvider(Provider *provider);
|
||||
static Provider* getProvider(const Firebird::string &prvName);
|
||||
static Connection* getConnection(Jrd::thread_db *tdbb,
|
||||
const Firebird::string &dataSource, const Firebird::string &user,
|
||||
const Firebird::string &pwd, const Firebird::string &role, TraScope tra_scope);
|
||||
static void addProvider(Provider* provider);
|
||||
static Provider* getProvider(const Firebird::string& prvName);
|
||||
static Connection* getConnection(Jrd::thread_db* tdbb,
|
||||
const Firebird::string& dataSource, const Firebird::string& user,
|
||||
const Firebird::string& pwd, const Firebird::string& role, TraScope tra_scope);
|
||||
|
||||
// Notify providers when some jrd attachment is about to be released
|
||||
static void jrdAttachmentEnd(Jrd::thread_db *tdbb, Jrd::Attachment* att);
|
||||
static void jrdAttachmentEnd(Jrd::thread_db* tdbb, Jrd::Attachment* att);
|
||||
|
||||
private:
|
||||
static void init();
|
||||
@ -93,18 +93,18 @@ public:
|
||||
virtual ~Provider();
|
||||
|
||||
// return existing or create new Connection
|
||||
virtual Connection* getConnection(Jrd::thread_db *tdbb, const Firebird::string &dbName,
|
||||
const Firebird::string &user, const Firebird::string &pwd, const Firebird::string &role,
|
||||
virtual Connection* getConnection(Jrd::thread_db* tdbb, const Firebird::string& dbName,
|
||||
const Firebird::string& user, const Firebird::string& pwd, const Firebird::string& role,
|
||||
TraScope tra_scope);
|
||||
|
||||
// Connection gets unused, release it into pool or delete it completely
|
||||
virtual void releaseConnection(Jrd::thread_db *tdbb, Connection& conn, bool inPool = true);
|
||||
virtual void releaseConnection(Jrd::thread_db* tdbb, Connection& conn, bool inPool = true);
|
||||
|
||||
// Notify provider when some jrd attachment is about to be released
|
||||
virtual void jrdAttachmentEnd(Jrd::thread_db *tdbb, Jrd::Attachment* att) = 0;
|
||||
virtual void jrdAttachmentEnd(Jrd::thread_db* tdbb, Jrd::Attachment* att) = 0;
|
||||
|
||||
// cancel execution of every connection
|
||||
void cancelConnections(Jrd::thread_db *tdbb);
|
||||
void cancelConnections(Jrd::thread_db* tdbb);
|
||||
|
||||
const Firebird::string& getName() const { return m_name; }
|
||||
|
||||
@ -114,7 +114,7 @@ public:
|
||||
int getFlags() const { return m_flags; }
|
||||
|
||||
// Interprete status and put error description into passed string
|
||||
virtual void getRemoteError(ISC_STATUS* status, Firebird::string &err) const = 0;
|
||||
virtual void getRemoteError(ISC_STATUS* status, Firebird::string& err) const = 0;
|
||||
|
||||
static const Firebird::string* generate(const void*, const Provider* item)
|
||||
{
|
||||
@ -122,7 +122,7 @@ public:
|
||||
}
|
||||
|
||||
protected:
|
||||
void clearConnections(Jrd::thread_db *tdbb);
|
||||
void clearConnections(Jrd::thread_db* tdbb);
|
||||
virtual Connection* doCreateConnection() = 0;
|
||||
|
||||
// Protection against simultaneous attach database calls. Not sure we still
|
||||
@ -148,20 +148,20 @@ class Connection : public Firebird::PermanentStorage
|
||||
protected:
|
||||
friend class EngineCallbackGuard;
|
||||
|
||||
explicit Connection(Provider &prov);
|
||||
explicit Connection(Provider& prov);
|
||||
virtual ~Connection();
|
||||
|
||||
public:
|
||||
static void deleteConnection(Jrd::thread_db *tdbb, Connection *conn);
|
||||
static void deleteConnection(Jrd::thread_db* tdbb, Connection* conn);
|
||||
|
||||
Provider* getProvider() { return &m_provider; }
|
||||
|
||||
virtual void attach(Jrd::thread_db *tdbb, const Firebird::string &dbName,
|
||||
const Firebird::string &user, const Firebird::string &pwd,
|
||||
const Firebird::string &role) = 0;
|
||||
virtual void detach(Jrd::thread_db *tdbb);
|
||||
virtual void attach(Jrd::thread_db* tdbb, const Firebird::string& dbName,
|
||||
const Firebird::string& user, const Firebird::string& pwd,
|
||||
const Firebird::string& role) = 0;
|
||||
virtual void detach(Jrd::thread_db* tdbb);
|
||||
|
||||
virtual bool cancelExecution(Jrd::thread_db *tdbb) = 0;
|
||||
virtual bool cancelExecution(Jrd::thread_db* tdbb) = 0;
|
||||
|
||||
int getSqlDialect() const { return m_sqlDialect; }
|
||||
|
||||
@ -169,16 +169,16 @@ public:
|
||||
// allows to use same connection in more than one transaction and\or
|
||||
// to have more than on active statement at time. See also provider
|
||||
// flags above.
|
||||
virtual bool isAvailable(Jrd::thread_db *tdbb, TraScope traScope) const = 0;
|
||||
virtual bool isAvailable(Jrd::thread_db* tdbb, TraScope traScope) const = 0;
|
||||
|
||||
virtual bool isConnected() const = 0;
|
||||
|
||||
virtual bool isSameDatabase(Jrd::thread_db *tdbb, const Firebird::string &dbName,
|
||||
const Firebird::string &user, const Firebird::string &pwd,
|
||||
const Firebird::string &role) const;
|
||||
virtual bool isSameDatabase(Jrd::thread_db* tdbb, const Firebird::string& dbName,
|
||||
const Firebird::string& user, const Firebird::string& pwd,
|
||||
const Firebird::string& role) const;
|
||||
|
||||
// Search for existing transaction of given scope, may return NULL.
|
||||
Transaction* findTransaction(Jrd::thread_db *tdbb, TraScope traScope) const;
|
||||
Transaction* findTransaction(Jrd::thread_db* tdbb, TraScope traScope) const;
|
||||
|
||||
const Firebird::string getDataSourceName() const
|
||||
{
|
||||
@ -187,40 +187,40 @@ public:
|
||||
|
||||
// Get error description from provider and put it with additional context
|
||||
// info into locally raised exception
|
||||
void raise(ISC_STATUS* status, Jrd::thread_db *tdbb, const char* sWhere);
|
||||
void raise(ISC_STATUS* status, Jrd::thread_db* tdbb, const char* sWhere);
|
||||
|
||||
// Transactions management within connection scope : put newly created
|
||||
// transaction into m_transactions array and delete not needed transaction
|
||||
// immediately (as we didn't pool transactions)
|
||||
Transaction* createTransaction();
|
||||
void deleteTransaction(Transaction *tran);
|
||||
void deleteTransaction(Transaction* tran);
|
||||
|
||||
// Statements management within connection scope : put newly created
|
||||
// statement into m_statements array, but don't delete freed statement
|
||||
// immediately (as we did pooled statements). Instead keep it in
|
||||
// m_freeStatements list for reuse later
|
||||
Statement* createStatement(const Firebird::string &sql);
|
||||
void releaseStatement(Jrd::thread_db *tdbb, Statement *stmt);
|
||||
Statement* createStatement(const Firebird::string& sql);
|
||||
void releaseStatement(Jrd::thread_db* tdbb, Statement* stmt);
|
||||
|
||||
virtual Blob* createBlob() = 0;
|
||||
|
||||
protected:
|
||||
void generateDPB(Jrd::thread_db *tdbb, Firebird::ClumpletWriter &dpb,
|
||||
const Firebird::string &user, const Firebird::string &pwd,
|
||||
const Firebird::string &role) const;
|
||||
void generateDPB(Jrd::thread_db* tdbb, Firebird::ClumpletWriter& dpb,
|
||||
const Firebird::string& user, const Firebird::string& pwd,
|
||||
const Firebird::string& role) const;
|
||||
|
||||
virtual Transaction* doCreateTransaction() = 0;
|
||||
virtual Statement* doCreateStatement() = 0;
|
||||
|
||||
void clearTransactions(Jrd::thread_db *tdbb);
|
||||
void clearStatements(Jrd::thread_db *tdbb);
|
||||
void clearTransactions(Jrd::thread_db* tdbb);
|
||||
void clearStatements(Jrd::thread_db* tdbb);
|
||||
|
||||
virtual void doDetach(Jrd::thread_db *tdbb) = 0;
|
||||
virtual void doDetach(Jrd::thread_db* tdbb) = 0;
|
||||
|
||||
// Protection against simultaneous ISC API calls for the same connection
|
||||
Firebird::Mutex m_mutex;
|
||||
|
||||
Provider &m_provider;
|
||||
Provider& m_provider;
|
||||
Firebird::string m_dbName;
|
||||
Firebird::ClumpletWriter m_dpb;
|
||||
|
||||
@ -242,7 +242,7 @@ protected:
|
||||
friend class Connection;
|
||||
|
||||
// Create and delete only via parent Connection
|
||||
explicit Transaction(Connection &conn);
|
||||
explicit Transaction(Connection& conn);
|
||||
virtual ~Transaction();
|
||||
|
||||
public:
|
||||
@ -253,35 +253,35 @@ public:
|
||||
|
||||
TraScope getScope() const { return m_scope; }
|
||||
|
||||
virtual void start(Jrd::thread_db *tdbb, TraScope traScope, TraModes traMode,
|
||||
virtual void start(Jrd::thread_db* tdbb, TraScope traScope, TraModes traMode,
|
||||
bool readOnly, bool wait, int lockTimeout);
|
||||
virtual void prepare(Jrd::thread_db *tdbb, int info_len, const char* info);
|
||||
virtual void commit(Jrd::thread_db *tdbb, bool retain);
|
||||
virtual void rollback(Jrd::thread_db *tdbb, bool retain);
|
||||
virtual void prepare(Jrd::thread_db* tdbb, int info_len, const char* info);
|
||||
virtual void commit(Jrd::thread_db* tdbb, bool retain);
|
||||
virtual void rollback(Jrd::thread_db* tdbb, bool retain);
|
||||
|
||||
static Transaction* getTransaction(Jrd::thread_db *tdbb,
|
||||
Connection *conn, TraScope tra_scope);
|
||||
static Transaction* getTransaction(Jrd::thread_db* tdbb,
|
||||
Connection* conn, TraScope tra_scope);
|
||||
|
||||
// Notification about end of some jrd transaction. Bound external transaction
|
||||
// (with traCommon scope) must be ended the same way as local jrd transaction
|
||||
static void jrdTransactionEnd(Jrd::thread_db *tdbb, Jrd::jrd_tra* tran,
|
||||
static void jrdTransactionEnd(Jrd::thread_db* tdbb, Jrd::jrd_tra* tran,
|
||||
bool commit, bool retain, bool force);
|
||||
|
||||
protected:
|
||||
virtual void generateTPB(Jrd::thread_db *tdbb, Firebird::ClumpletWriter &tpb,
|
||||
virtual void generateTPB(Jrd::thread_db* tdbb, Firebird::ClumpletWriter& tpb,
|
||||
TraModes traMode, bool readOnly, bool wait, int lockTimeout) const;
|
||||
void detachFromJrdTran();
|
||||
|
||||
virtual void doStart(ISC_STATUS* status, Jrd::thread_db *tdbb, Firebird::ClumpletWriter &tpb) = 0;
|
||||
virtual void doPrepare(ISC_STATUS* status, Jrd::thread_db *tdbb, int info_len, const char* info) = 0;
|
||||
virtual void doCommit(ISC_STATUS* status, Jrd::thread_db *tdbb, bool retain) = 0;
|
||||
virtual void doRollback(ISC_STATUS* status, Jrd::thread_db *tdbb, bool retain) = 0;
|
||||
virtual void doStart(ISC_STATUS* status, Jrd::thread_db* tdbb, Firebird::ClumpletWriter& tpb) = 0;
|
||||
virtual void doPrepare(ISC_STATUS* status, Jrd::thread_db* tdbb, int info_len, const char* info) = 0;
|
||||
virtual void doCommit(ISC_STATUS* status, Jrd::thread_db* tdbb, bool retain) = 0;
|
||||
virtual void doRollback(ISC_STATUS* status, Jrd::thread_db* tdbb, bool retain) = 0;
|
||||
|
||||
Provider &m_provider;
|
||||
Connection &m_connection;
|
||||
Provider& m_provider;
|
||||
Connection& m_connection;
|
||||
TraScope m_scope;
|
||||
Transaction *m_nextTran; // next common transaction
|
||||
Jrd::jrd_tra *m_jrdTran; // parent JRD transaction
|
||||
Transaction* m_nextTran; // next common transaction
|
||||
Jrd::jrd_tra* m_jrdTran; // parent JRD transaction
|
||||
};
|
||||
|
||||
|
||||
@ -293,11 +293,11 @@ protected:
|
||||
friend class Connection;
|
||||
|
||||
// Create and delete only via parent Connection
|
||||
explicit Statement(Connection &conn);
|
||||
explicit Statement(Connection& conn);
|
||||
virtual ~Statement();
|
||||
|
||||
public:
|
||||
static void deleteStatement(Jrd::thread_db *tdbb, Statement *stmt);
|
||||
static void deleteStatement(Jrd::thread_db* tdbb, Statement* stmt);
|
||||
|
||||
Provider* getProvider() { return &m_provider; }
|
||||
|
||||
@ -305,15 +305,15 @@ public:
|
||||
|
||||
Transaction* getTransaction() { return m_transaction; }
|
||||
|
||||
void prepare(Jrd::thread_db *tdbb, Transaction *tran, const Firebird::string& sql, bool named);
|
||||
void execute(Jrd::thread_db *tdbb, Transaction *tran, int in_count,
|
||||
void prepare(Jrd::thread_db* tdbb, Transaction* tran, const Firebird::string& sql, bool named);
|
||||
void execute(Jrd::thread_db* tdbb, Transaction* tran, int in_count,
|
||||
const Firebird::string* const* in_names, Jrd::jrd_nod** in_params,
|
||||
int out_count, Jrd::jrd_nod** out_params);
|
||||
void open(Jrd::thread_db *tdbb, Transaction *tran, int in_count,
|
||||
void open(Jrd::thread_db* tdbb, Transaction* tran, int in_count,
|
||||
const Firebird::string* const* in_names, Jrd::jrd_nod** in_params, bool singleton);
|
||||
bool fetch(Jrd::thread_db *tdbb, int out_count, Jrd::jrd_nod **out_params);
|
||||
void close(Jrd::thread_db *tdbb);
|
||||
void deallocate(Jrd::thread_db *tdbb);
|
||||
bool fetch(Jrd::thread_db* tdbb, int out_count, Jrd::jrd_nod** out_params);
|
||||
void close(Jrd::thread_db* tdbb);
|
||||
void deallocate(Jrd::thread_db* tdbb);
|
||||
|
||||
const Firebird::string& getSql() const { return m_sql; }
|
||||
|
||||
@ -331,7 +331,7 @@ public:
|
||||
|
||||
// Get error description from provider and put it with additional contex
|
||||
// info into locally raised exception
|
||||
void raise(ISC_STATUS* status, Jrd::thread_db *tdbb, const char* sWhere,
|
||||
void raise(ISC_STATUS* status, Jrd::thread_db* tdbb, const char* sWhere,
|
||||
const Firebird::string* sQuery = NULL);
|
||||
|
||||
// Active statement must be bound to parent jrd request
|
||||
@ -339,21 +339,21 @@ public:
|
||||
void unBindFromRequest();
|
||||
|
||||
protected:
|
||||
virtual void doPrepare(Jrd::thread_db *tdbb, const Firebird::string &sql) = 0;
|
||||
virtual void doExecute(Jrd::thread_db *tdbb) = 0;
|
||||
virtual void doOpen(Jrd::thread_db *tdbb) = 0;
|
||||
virtual bool doFetch(Jrd::thread_db *tdbb) = 0;
|
||||
virtual void doClose(Jrd::thread_db *tdbb, bool drop) = 0;
|
||||
virtual void doPrepare(Jrd::thread_db* tdbb, const Firebird::string& sql) = 0;
|
||||
virtual void doExecute(Jrd::thread_db* tdbb) = 0;
|
||||
virtual void doOpen(Jrd::thread_db* tdbb) = 0;
|
||||
virtual bool doFetch(Jrd::thread_db* tdbb) = 0;
|
||||
virtual void doClose(Jrd::thread_db* tdbb, bool drop) = 0;
|
||||
|
||||
void setInParams(Jrd::thread_db *tdbb, int count, const Firebird::string* const* names,
|
||||
void setInParams(Jrd::thread_db* tdbb, int count, const Firebird::string* const* names,
|
||||
Jrd::jrd_nod** params);
|
||||
virtual void getOutParams(Jrd::thread_db *tdbb, int count, Jrd::jrd_nod **params);
|
||||
virtual void getOutParams(Jrd::thread_db* tdbb, int count, Jrd::jrd_nod** params);
|
||||
|
||||
virtual void doSetInParams(Jrd::thread_db *tdbb, int count, const Firebird::string* const* names,
|
||||
virtual void doSetInParams(Jrd::thread_db* tdbb, int count, const Firebird::string* const* names,
|
||||
Jrd::jrd_nod** params);
|
||||
|
||||
virtual void putExtBlob(Jrd::thread_db *tdbb, dsc &src, dsc &dst);
|
||||
virtual void getExtBlob(Jrd::thread_db *tdbb, const dsc &src, dsc &dst);
|
||||
virtual void putExtBlob(Jrd::thread_db* tdbb, dsc& src, dsc& dst);
|
||||
virtual void getExtBlob(Jrd::thread_db* tdbb, const dsc& src, dsc& dst);
|
||||
|
||||
// Preprocess user sql string : replace parameter names by placeholders (?)
|
||||
// and remember correspondence between logical parameter names and unnamed
|
||||
@ -411,38 +411,38 @@ class Blob : public Firebird::PermanentStorage
|
||||
{
|
||||
friend class Connection;
|
||||
protected:
|
||||
explicit Blob(Connection &conn) :
|
||||
explicit Blob(Connection& conn) :
|
||||
PermanentStorage(conn.getProvider()->getPool())
|
||||
{}
|
||||
|
||||
public:
|
||||
virtual ~Blob() {}
|
||||
|
||||
virtual void open(Jrd::thread_db *tdbb, Transaction &tran, const dsc &desc,
|
||||
const Firebird::UCharBuffer *bpb) = 0;
|
||||
virtual void create(Jrd::thread_db *tdbb, Transaction &tran, dsc &desc,
|
||||
virtual void open(Jrd::thread_db* tdbb, Transaction& tran, const dsc& desc,
|
||||
const Firebird::UCharBuffer* bpb) = 0;
|
||||
virtual USHORT read(Jrd::thread_db *tdbb, char *buff, USHORT len) = 0;
|
||||
virtual void write(Jrd::thread_db *tdbb, const char* buff, USHORT len) = 0;
|
||||
virtual void close(Jrd::thread_db *tdbb) = 0;
|
||||
virtual void cancel(Jrd::thread_db *tdbb) = 0;
|
||||
virtual void create(Jrd::thread_db* tdbb, Transaction& tran, dsc& desc,
|
||||
const Firebird::UCharBuffer* bpb) = 0;
|
||||
virtual USHORT read(Jrd::thread_db* tdbb, char* buff, USHORT len) = 0;
|
||||
virtual void write(Jrd::thread_db* tdbb, const char* buff, USHORT len) = 0;
|
||||
virtual void close(Jrd::thread_db* tdbb) = 0;
|
||||
virtual void cancel(Jrd::thread_db* tdbb) = 0;
|
||||
};
|
||||
|
||||
|
||||
class EngineCallbackGuard
|
||||
{
|
||||
public:
|
||||
EngineCallbackGuard(Jrd::thread_db *tdbb, Connection &conn)
|
||||
EngineCallbackGuard(Jrd::thread_db* tdbb, Connection& conn)
|
||||
{
|
||||
init(tdbb, conn);
|
||||
}
|
||||
|
||||
EngineCallbackGuard(Jrd::thread_db *tdbb, Transaction &tran)
|
||||
EngineCallbackGuard(Jrd::thread_db* tdbb, Transaction& tran)
|
||||
{
|
||||
init(tdbb, *tran.getConnection());
|
||||
}
|
||||
|
||||
EngineCallbackGuard(Jrd::thread_db *tdbb, Statement &stmt)
|
||||
EngineCallbackGuard(Jrd::thread_db* tdbb, Statement& stmt)
|
||||
{
|
||||
init(tdbb, *stmt.getConnection());
|
||||
}
|
||||
@ -450,10 +450,10 @@ public:
|
||||
~EngineCallbackGuard();
|
||||
|
||||
private:
|
||||
void init(Jrd::thread_db *tdbb, Connection &conn);
|
||||
void init(Jrd::thread_db* tdbb, Connection& conn);
|
||||
|
||||
Jrd::thread_db* m_tdbb;
|
||||
Firebird::Mutex *m_mutex;
|
||||
Firebird::Mutex* m_mutex;
|
||||
};
|
||||
|
||||
} // namespace EDS
|
||||
|
@ -47,7 +47,7 @@ using namespace Firebird;
|
||||
|
||||
namespace EDS {
|
||||
|
||||
const char *INTERNAL_PROVIDER_NAME = "Internal";
|
||||
const char* INTERNAL_PROVIDER_NAME = "Internal";
|
||||
|
||||
class RegisterInternalProvider
|
||||
{
|
||||
@ -63,23 +63,23 @@ static RegisterInternalProvider reg;
|
||||
|
||||
// InternalProvider
|
||||
|
||||
void InternalProvider::jrdAttachmentEnd(thread_db *tdbb, Attachment* att)
|
||||
void InternalProvider::jrdAttachmentEnd(thread_db* tdbb, Attachment* att)
|
||||
{
|
||||
if (m_connections.getCount() == 0)
|
||||
return;
|
||||
|
||||
Connection **ptr = m_connections.end();
|
||||
Connection **begin = m_connections.begin();
|
||||
Connection** ptr = m_connections.end();
|
||||
Connection** begin = m_connections.begin();
|
||||
|
||||
for (ptr--; ptr >= begin; ptr--)
|
||||
{
|
||||
InternalConnection *conn = (InternalConnection*) *ptr;
|
||||
InternalConnection* conn = (InternalConnection*) *ptr;
|
||||
if (conn->getJrdAtt() == att)
|
||||
releaseConnection(tdbb, *conn, false);
|
||||
}
|
||||
}
|
||||
|
||||
void InternalProvider::getRemoteError(ISC_STATUS* status, string &err) const
|
||||
void InternalProvider::getRemoteError(ISC_STATUS* status, string& err) const
|
||||
{
|
||||
err = "";
|
||||
|
||||
@ -111,9 +111,9 @@ InternalConnection::~InternalConnection()
|
||||
{
|
||||
}
|
||||
|
||||
void InternalConnection::attach(thread_db *tdbb, const Firebird::string &dbName,
|
||||
const Firebird::string &user, const Firebird::string &pwd,
|
||||
const Firebird::string &role)
|
||||
void InternalConnection::attach(thread_db* tdbb, const Firebird::string& dbName,
|
||||
const Firebird::string& user, const Firebird::string& pwd,
|
||||
const Firebird::string& role)
|
||||
{
|
||||
fb_assert(!m_attachment);
|
||||
Database* dbb = tdbb->getDatabase();
|
||||
@ -148,7 +148,7 @@ void InternalConnection::attach(thread_db *tdbb, const Firebird::string &dbName,
|
||||
SQL_DIALECT_V6 : SQL_DIALECT_V5;
|
||||
}
|
||||
|
||||
void InternalConnection::doDetach(thread_db *tdbb)
|
||||
void InternalConnection::doDetach(thread_db* tdbb)
|
||||
{
|
||||
fb_assert(m_attachment);
|
||||
|
||||
@ -184,7 +184,7 @@ void InternalConnection::doDetach(thread_db *tdbb)
|
||||
fb_assert(!m_attachment)
|
||||
}
|
||||
|
||||
bool InternalConnection::cancelExecution(thread_db *tdbb)
|
||||
bool InternalConnection::cancelExecution(thread_db* tdbb)
|
||||
{
|
||||
if (m_isCurrent)
|
||||
return true;
|
||||
@ -198,15 +198,15 @@ bool InternalConnection::cancelExecution(thread_db *tdbb)
|
||||
// a) is current conenction and current thread's attachment is equal to
|
||||
// this attachment, or
|
||||
// b) is not current conenction
|
||||
bool InternalConnection::isAvailable(thread_db *tdbb, TraScope /*traScope*/) const
|
||||
bool InternalConnection::isAvailable(thread_db* tdbb, TraScope /*traScope*/) const
|
||||
{
|
||||
return !m_isCurrent ||
|
||||
(m_isCurrent && (tdbb->getAttachment() == m_attachment));
|
||||
}
|
||||
|
||||
bool InternalConnection::isSameDatabase(thread_db *tdbb, const Firebird::string &dbName,
|
||||
const Firebird::string &user, const Firebird::string &pwd,
|
||||
const Firebird::string &role) const
|
||||
bool InternalConnection::isSameDatabase(thread_db* tdbb, const Firebird::string& dbName,
|
||||
const Firebird::string& user, const Firebird::string& pwd,
|
||||
const Firebird::string& role) const
|
||||
{
|
||||
if (m_isCurrent)
|
||||
return (tdbb->getAttachment() == m_attachment);
|
||||
@ -232,7 +232,7 @@ Blob* InternalConnection::createBlob()
|
||||
|
||||
// InternalTransaction()
|
||||
|
||||
void InternalTransaction::doStart(ISC_STATUS* status, thread_db *tdbb, ClumpletWriter &tpb)
|
||||
void InternalTransaction::doStart(ISC_STATUS* status, thread_db* tdbb, ClumpletWriter& tpb)
|
||||
{
|
||||
fb_assert(!m_transaction);
|
||||
|
||||
@ -241,7 +241,7 @@ void InternalTransaction::doStart(ISC_STATUS* status, thread_db *tdbb, ClumpletW
|
||||
}
|
||||
else
|
||||
{
|
||||
Attachment *att = m_IntConnection.getJrdAtt();
|
||||
Attachment* att = m_IntConnection.getJrdAtt();
|
||||
|
||||
EngineCallbackGuard guard(tdbb, *this);
|
||||
jrd8_start_transaction(status, &m_transaction, 1, &att,
|
||||
@ -275,7 +275,7 @@ void InternalTransaction::doCommit(ISC_STATUS* status, thread_db* tdbb, bool ret
|
||||
}
|
||||
}
|
||||
|
||||
void InternalTransaction::doRollback(ISC_STATUS* status, thread_db *tdbb, bool retain)
|
||||
void InternalTransaction::doRollback(ISC_STATUS* status, thread_db* tdbb, bool retain)
|
||||
{
|
||||
fb_assert(m_transaction);
|
||||
|
||||
@ -303,7 +303,7 @@ void InternalTransaction::doRollback(ISC_STATUS* status, thread_db *tdbb, bool r
|
||||
|
||||
// InternalStatement
|
||||
|
||||
InternalStatement::InternalStatement(InternalConnection &conn) :
|
||||
InternalStatement::InternalStatement(InternalConnection& conn) :
|
||||
Statement(conn),
|
||||
m_intConnection(conn),
|
||||
m_intTransaction(0),
|
||||
@ -317,13 +317,13 @@ InternalStatement::~InternalStatement()
|
||||
{
|
||||
}
|
||||
|
||||
void InternalStatement::doPrepare(thread_db *tdbb, const string &sql)
|
||||
void InternalStatement::doPrepare(thread_db* tdbb, const string& sql)
|
||||
{
|
||||
m_inBlr.clear();
|
||||
m_outBlr.clear();
|
||||
|
||||
Attachment *att = m_intConnection.getJrdAtt();
|
||||
jrd_tra *tran = getIntTransaction()->getJrdTran();
|
||||
Attachment* att = m_intConnection.getJrdAtt();
|
||||
jrd_tra* tran = getIntTransaction()->getJrdTran();
|
||||
|
||||
ISC_STATUS_ARRAY status = {0};
|
||||
if (!m_request)
|
||||
@ -414,9 +414,9 @@ void InternalStatement::doPrepare(thread_db *tdbb, const string &sql)
|
||||
}
|
||||
|
||||
|
||||
void InternalStatement::doExecute(thread_db *tdbb)
|
||||
void InternalStatement::doExecute(thread_db* tdbb)
|
||||
{
|
||||
jrd_tra *transaction = getIntTransaction()->getJrdTran();
|
||||
jrd_tra* transaction = getIntTransaction()->getJrdTran();
|
||||
|
||||
ISC_STATUS_ARRAY status = {0};
|
||||
{
|
||||
@ -434,9 +434,9 @@ void InternalStatement::doExecute(thread_db *tdbb)
|
||||
}
|
||||
|
||||
|
||||
void InternalStatement::doOpen(thread_db *tdbb)
|
||||
void InternalStatement::doOpen(thread_db* tdbb)
|
||||
{
|
||||
jrd_tra *transaction = getIntTransaction()->getJrdTran();
|
||||
jrd_tra* transaction = getIntTransaction()->getJrdTran();
|
||||
|
||||
ISC_STATUS_ARRAY status = {0};
|
||||
{
|
||||
@ -452,7 +452,7 @@ void InternalStatement::doOpen(thread_db *tdbb)
|
||||
}
|
||||
|
||||
|
||||
bool InternalStatement::doFetch(thread_db *tdbb)
|
||||
bool InternalStatement::doFetch(thread_db* tdbb)
|
||||
{
|
||||
ISC_STATUS_ARRAY status = {0};
|
||||
ISC_STATUS res = 0;
|
||||
@ -470,7 +470,7 @@ bool InternalStatement::doFetch(thread_db *tdbb)
|
||||
}
|
||||
|
||||
|
||||
void InternalStatement::doClose(thread_db *tdbb, bool drop)
|
||||
void InternalStatement::doClose(thread_db* tdbb, bool drop)
|
||||
{
|
||||
ISC_STATUS_ARRAY status = {0};
|
||||
{
|
||||
@ -485,7 +485,7 @@ void InternalStatement::doClose(thread_db *tdbb, bool drop)
|
||||
}
|
||||
}
|
||||
|
||||
void InternalStatement::putExtBlob(thread_db *tdbb, dsc &src, dsc &dst)
|
||||
void InternalStatement::putExtBlob(thread_db* tdbb, dsc& src, dsc& dst)
|
||||
{
|
||||
if (m_transaction->getScope() == traCommon)
|
||||
MOV_move(tdbb, &src, &dst);
|
||||
@ -493,7 +493,7 @@ void InternalStatement::putExtBlob(thread_db *tdbb, dsc &src, dsc &dst)
|
||||
Statement::putExtBlob(tdbb, src, dst);
|
||||
}
|
||||
|
||||
void InternalStatement::getExtBlob(thread_db *tdbb, const dsc &src, dsc &dst)
|
||||
void InternalStatement::getExtBlob(thread_db* tdbb, const dsc& src, dsc& dst)
|
||||
{
|
||||
fb_assert(dst.dsc_length == src.dsc_length);
|
||||
fb_assert(dst.dsc_length == sizeof(bid));
|
||||
@ -508,7 +508,7 @@ void InternalStatement::getExtBlob(thread_db *tdbb, const dsc &src, dsc &dst)
|
||||
|
||||
// InternalBlob
|
||||
|
||||
InternalBlob::InternalBlob(InternalConnection &conn) :
|
||||
InternalBlob::InternalBlob(InternalConnection& conn) :
|
||||
Blob(conn),
|
||||
m_connection(conn),
|
||||
m_blob(NULL)
|
||||
@ -521,12 +521,12 @@ InternalBlob::~InternalBlob()
|
||||
fb_assert(!m_blob);
|
||||
}
|
||||
|
||||
void InternalBlob::open(thread_db *tdbb, Transaction &tran, const dsc &desc, const UCharBuffer* bpb)
|
||||
void InternalBlob::open(thread_db* tdbb, Transaction& tran, const dsc& desc, const UCharBuffer* bpb)
|
||||
{
|
||||
fb_assert(!m_blob);
|
||||
fb_assert(sizeof(m_blob_id) == desc.dsc_length);
|
||||
|
||||
Attachment *att = m_connection.getJrdAtt();
|
||||
Attachment* att = m_connection.getJrdAtt();
|
||||
jrd_tra* transaction = ((InternalTransaction&) tran).getJrdTran();
|
||||
memcpy(&m_blob_id, desc.dsc_address, sizeof(m_blob_id));
|
||||
|
||||
@ -546,12 +546,12 @@ void InternalBlob::open(thread_db *tdbb, Transaction &tran, const dsc &desc, con
|
||||
fb_assert(m_blob);
|
||||
}
|
||||
|
||||
void InternalBlob::create(thread_db *tdbb, Transaction &tran, dsc &desc, const UCharBuffer* bpb)
|
||||
void InternalBlob::create(thread_db* tdbb, Transaction& tran, dsc& desc, const UCharBuffer* bpb)
|
||||
{
|
||||
fb_assert(!m_blob);
|
||||
fb_assert(sizeof(m_blob_id) == desc.dsc_length);
|
||||
|
||||
Attachment *att = m_connection.getJrdAtt();
|
||||
Attachment* att = m_connection.getJrdAtt();
|
||||
jrd_tra* transaction = ((InternalTransaction&) tran).getJrdTran();
|
||||
m_blob_id.clear();
|
||||
|
||||
@ -572,7 +572,7 @@ void InternalBlob::create(thread_db *tdbb, Transaction &tran, dsc &desc, const U
|
||||
fb_assert(m_blob);
|
||||
}
|
||||
|
||||
USHORT InternalBlob::read(thread_db *tdbb, char *buff, USHORT len)
|
||||
USHORT InternalBlob::read(thread_db* tdbb, char* buff, USHORT len)
|
||||
{
|
||||
fb_assert(m_blob);
|
||||
|
||||
@ -611,7 +611,7 @@ void InternalBlob::write(thread_db* tdbb, const char* buff, USHORT len)
|
||||
}
|
||||
}
|
||||
|
||||
void InternalBlob::close(thread_db *tdbb)
|
||||
void InternalBlob::close(thread_db* tdbb)
|
||||
{
|
||||
fb_assert(m_blob);
|
||||
ISC_STATUS_ARRAY status = {0};
|
||||
@ -625,7 +625,7 @@ void InternalBlob::close(thread_db *tdbb)
|
||||
fb_assert(!m_blob);
|
||||
}
|
||||
|
||||
void InternalBlob::cancel(thread_db *tdbb)
|
||||
void InternalBlob::cancel(thread_db* tdbb)
|
||||
{
|
||||
if (!m_blob) {
|
||||
return;
|
||||
|
@ -41,8 +41,8 @@ public:
|
||||
{}
|
||||
|
||||
virtual void initialize() {}
|
||||
virtual void jrdAttachmentEnd(Jrd::thread_db *tdbb, Jrd::Attachment* att);
|
||||
virtual void getRemoteError(ISC_STATUS* status, Firebird::string &err) const;
|
||||
virtual void jrdAttachmentEnd(Jrd::thread_db* tdbb, Jrd::Attachment* att);
|
||||
virtual void getRemoteError(ISC_STATUS* status, Firebird::string& err) const;
|
||||
|
||||
protected:
|
||||
virtual Connection* doCreateConnection();
|
||||
@ -54,7 +54,7 @@ class InternalConnection : public Connection
|
||||
protected:
|
||||
friend class InternalProvider;
|
||||
|
||||
explicit InternalConnection(InternalProvider &prov) :
|
||||
explicit InternalConnection(InternalProvider& prov) :
|
||||
Connection(prov),
|
||||
m_attachment(0),
|
||||
m_isCurrent(false)
|
||||
@ -63,19 +63,19 @@ protected:
|
||||
virtual ~InternalConnection();
|
||||
|
||||
public:
|
||||
virtual void attach(Jrd::thread_db *tdbb, const Firebird::string &dbName,
|
||||
const Firebird::string &user, const Firebird::string &pwd,
|
||||
const Firebird::string &role);
|
||||
virtual void attach(Jrd::thread_db* tdbb, const Firebird::string& dbName,
|
||||
const Firebird::string& user, const Firebird::string& pwd,
|
||||
const Firebird::string& role);
|
||||
|
||||
virtual bool cancelExecution(Jrd::thread_db *tdbb);
|
||||
virtual bool cancelExecution(Jrd::thread_db* tdbb);
|
||||
|
||||
virtual bool isAvailable(Jrd::thread_db *tdbb, TraScope traScope) const;
|
||||
virtual bool isAvailable(Jrd::thread_db* tdbb, TraScope traScope) const;
|
||||
|
||||
virtual bool isConnected() const { return (m_attachment != 0); }
|
||||
|
||||
virtual bool isSameDatabase(Jrd::thread_db *tdbb, const Firebird::string &dbName,
|
||||
const Firebird::string &user, const Firebird::string &pwd,
|
||||
const Firebird::string &role) const;
|
||||
virtual bool isSameDatabase(Jrd::thread_db* tdbb, const Firebird::string& dbName,
|
||||
const Firebird::string& user, const Firebird::string& pwd,
|
||||
const Firebird::string& role) const;
|
||||
|
||||
bool isCurrent() const { return m_isCurrent; }
|
||||
|
||||
@ -86,7 +86,7 @@ public:
|
||||
protected:
|
||||
virtual Transaction* doCreateTransaction();
|
||||
virtual Statement* doCreateStatement();
|
||||
virtual void doDetach(Jrd::thread_db *tdbb);
|
||||
virtual void doDetach(Jrd::thread_db* tdbb);
|
||||
|
||||
Jrd::Attachment* m_attachment;
|
||||
bool m_isCurrent;
|
||||
@ -98,7 +98,7 @@ class InternalTransaction : public Transaction
|
||||
protected:
|
||||
friend class InternalConnection;
|
||||
|
||||
explicit InternalTransaction(InternalConnection &conn) :
|
||||
explicit InternalTransaction(InternalConnection& conn) :
|
||||
Transaction(conn),
|
||||
m_IntConnection(conn),
|
||||
m_transaction(0)
|
||||
@ -110,13 +110,13 @@ public:
|
||||
Jrd::jrd_tra* getJrdTran() { return m_transaction; }
|
||||
|
||||
protected:
|
||||
virtual void doStart(ISC_STATUS* status, Jrd::thread_db *tdbb, Firebird::ClumpletWriter &tpb);
|
||||
virtual void doPrepare(ISC_STATUS* status, Jrd::thread_db *tdbb, int info_len, const char* info);
|
||||
virtual void doCommit(ISC_STATUS* status, Jrd::thread_db *tdbb, bool retain);
|
||||
virtual void doRollback(ISC_STATUS* status, Jrd::thread_db *tdbb, bool retain);
|
||||
virtual void doStart(ISC_STATUS* status, Jrd::thread_db* tdbb, Firebird::ClumpletWriter& tpb);
|
||||
virtual void doPrepare(ISC_STATUS* status, Jrd::thread_db* tdbb, int info_len, const char* info);
|
||||
virtual void doCommit(ISC_STATUS* status, Jrd::thread_db* tdbb, bool retain);
|
||||
virtual void doRollback(ISC_STATUS* status, Jrd::thread_db* tdbb, bool retain);
|
||||
|
||||
InternalConnection &m_IntConnection;
|
||||
Jrd::jrd_tra *m_transaction;
|
||||
InternalConnection& m_IntConnection;
|
||||
Jrd::jrd_tra* m_transaction;
|
||||
};
|
||||
|
||||
|
||||
@ -125,18 +125,18 @@ class InternalStatement : public Statement
|
||||
protected:
|
||||
friend class InternalConnection;
|
||||
|
||||
explicit InternalStatement(InternalConnection &conn);
|
||||
explicit InternalStatement(InternalConnection& conn);
|
||||
~InternalStatement();
|
||||
|
||||
protected:
|
||||
virtual void doPrepare(Jrd::thread_db *tdbb, const Firebird::string &sql);
|
||||
virtual void doExecute(Jrd::thread_db *tdbb);
|
||||
virtual void doOpen(Jrd::thread_db *tdbb);
|
||||
virtual bool doFetch(Jrd::thread_db *tdbb);
|
||||
virtual void doClose(Jrd::thread_db *tdbb, bool drop);
|
||||
virtual void doPrepare(Jrd::thread_db* tdbb, const Firebird::string& sql);
|
||||
virtual void doExecute(Jrd::thread_db* tdbb);
|
||||
virtual void doOpen(Jrd::thread_db* tdbb);
|
||||
virtual bool doFetch(Jrd::thread_db* tdbb);
|
||||
virtual void doClose(Jrd::thread_db* tdbb, bool drop);
|
||||
|
||||
virtual void putExtBlob(Jrd::thread_db *tdbb, dsc &src, dsc &dst);
|
||||
virtual void getExtBlob(Jrd::thread_db *tdbb, const dsc &src, dsc &dst);
|
||||
virtual void putExtBlob(Jrd::thread_db* tdbb, dsc& src, dsc& dst);
|
||||
virtual void getExtBlob(Jrd::thread_db* tdbb, const dsc& src, dsc& dst);
|
||||
|
||||
InternalTransaction* getIntTransaction()
|
||||
{
|
||||
@ -156,21 +156,21 @@ class InternalBlob : public Blob
|
||||
{
|
||||
friend class InternalConnection;
|
||||
protected:
|
||||
explicit InternalBlob(InternalConnection &conn);
|
||||
explicit InternalBlob(InternalConnection& conn);
|
||||
|
||||
public:
|
||||
~InternalBlob();
|
||||
|
||||
public:
|
||||
virtual void open(Jrd::thread_db *tdbb, Transaction &tran, const dsc &desc, const Firebird::UCharBuffer* bpb);
|
||||
virtual void create(Jrd::thread_db *tdbb, Transaction &tran, dsc &desc, const Firebird::UCharBuffer* bpb);
|
||||
virtual USHORT read(Jrd::thread_db *tdbb, char *buff, USHORT len);
|
||||
virtual void write(Jrd::thread_db *tdbb, const char* buff, USHORT len);
|
||||
virtual void close(Jrd::thread_db *tdbb);
|
||||
virtual void cancel(Jrd::thread_db *tdbb);
|
||||
virtual void open(Jrd::thread_db* tdbb, Transaction& tran, const dsc& desc, const Firebird::UCharBuffer* bpb);
|
||||
virtual void create(Jrd::thread_db* tdbb, Transaction& tran, dsc& desc, const Firebird::UCharBuffer* bpb);
|
||||
virtual USHORT read(Jrd::thread_db* tdbb, char* buff, USHORT len);
|
||||
virtual void write(Jrd::thread_db* tdbb, const char* buff, USHORT len);
|
||||
virtual void close(Jrd::thread_db* tdbb);
|
||||
virtual void cancel(Jrd::thread_db* tdbb);
|
||||
|
||||
private:
|
||||
InternalConnection &m_connection;
|
||||
InternalConnection& m_connection;
|
||||
Jrd::blb* m_blob;
|
||||
Jrd::bid m_blob_id;
|
||||
};
|
||||
|
@ -46,7 +46,7 @@ using namespace Firebird;
|
||||
namespace EDS
|
||||
{
|
||||
|
||||
const char *FIREBIRD_PROVIDER_NAME = "Firebird";
|
||||
const char* FIREBIRD_PROVIDER_NAME = "Firebird";
|
||||
|
||||
class RegisterFBProvider
|
||||
{
|
||||
@ -61,12 +61,12 @@ public:
|
||||
static RegisterFBProvider reg;
|
||||
|
||||
static bool isConnectionBrokenError(ISC_STATUS status);
|
||||
static void parseSQLDA(XSQLDA *xsqlda, UCharBuffer &buff, Firebird::Array<dsc> &descs);
|
||||
static void parseSQLDA(XSQLDA* xsqlda, UCharBuffer& buff, Firebird::Array<dsc>& descs);
|
||||
static UCHAR sqlTypeToDscType(SSHORT sqlType);
|
||||
|
||||
// IscProvider
|
||||
|
||||
void IscProvider::getRemoteError(ISC_STATUS* status, string &err) const
|
||||
void IscProvider::getRemoteError(ISC_STATUS* status, string& err) const
|
||||
{
|
||||
err = "";
|
||||
|
||||
@ -91,7 +91,7 @@ Connection* IscProvider::doCreateConnection()
|
||||
|
||||
// IscConnection
|
||||
|
||||
IscConnection::IscConnection(IscProvider &prov) :
|
||||
IscConnection::IscConnection(IscProvider& prov) :
|
||||
Connection(prov),
|
||||
m_iscProvider(prov),
|
||||
m_handle(0)
|
||||
@ -102,8 +102,8 @@ IscConnection::~IscConnection()
|
||||
{
|
||||
}
|
||||
|
||||
void IscConnection::attach(thread_db *tdbb, const string &dbName, const string &user,
|
||||
const string &pwd, const string &role)
|
||||
void IscConnection::attach(thread_db* tdbb, const string& dbName, const string& user,
|
||||
const string& pwd, const string& role)
|
||||
{
|
||||
m_dbName = dbName;
|
||||
generateDPB(tdbb, m_dpb, user, pwd, role);
|
||||
@ -130,7 +130,7 @@ void IscConnection::attach(thread_db *tdbb, const string &dbName, const string &
|
||||
raise(status, tdbb, "isc_database_info");
|
||||
}
|
||||
|
||||
const char *p = buff, *end = buff + sizeof(buff);
|
||||
const char* p = buff, *end = buff + sizeof(buff);
|
||||
while (p < end)
|
||||
{
|
||||
const UCHAR item = *p++;
|
||||
@ -155,7 +155,7 @@ void IscConnection::attach(thread_db *tdbb, const string &dbName, const string &
|
||||
}
|
||||
}
|
||||
|
||||
void IscConnection::doDetach(thread_db *tdbb)
|
||||
void IscConnection::doDetach(thread_db* tdbb)
|
||||
{
|
||||
ISC_STATUS_ARRAY status = {0};
|
||||
if (m_handle)
|
||||
@ -194,7 +194,7 @@ bool IscConnection::cancelExecution(thread_db* /*tdbb*/)
|
||||
// b) has no active transactions or has active transaction of given
|
||||
// TraScope bound to current jrd transaction or supports many active
|
||||
// transactions
|
||||
bool IscConnection::isAvailable(thread_db *tdbb, TraScope traScope) const
|
||||
bool IscConnection::isAvailable(thread_db* tdbb, TraScope traScope) const
|
||||
{
|
||||
const int flags = m_provider.getFlags();
|
||||
if (m_used_stmts && !(flags & prvMultyStmts))
|
||||
@ -225,7 +225,7 @@ Statement* IscConnection::doCreateStatement()
|
||||
|
||||
// IscTransaction
|
||||
|
||||
void IscTransaction::doStart(ISC_STATUS* status, thread_db *tdbb, Firebird::ClumpletWriter &tpb)
|
||||
void IscTransaction::doStart(ISC_STATUS* status, thread_db* tdbb, Firebird::ClumpletWriter& tpb)
|
||||
{
|
||||
fb_assert(!m_handle);
|
||||
FB_API_HANDLE& db_handle = m_iscConnection.getAPIHandle();
|
||||
@ -239,7 +239,7 @@ void IscTransaction::doPrepare(ISC_STATUS* /*status*/, thread_db* /*tdbb*/, int
|
||||
{
|
||||
}
|
||||
|
||||
void IscTransaction::doCommit(ISC_STATUS* status, thread_db *tdbb, bool retain)
|
||||
void IscTransaction::doCommit(ISC_STATUS* status, thread_db* tdbb, bool retain)
|
||||
{
|
||||
EngineCallbackGuard guard(tdbb, *this);
|
||||
if (retain)
|
||||
@ -250,7 +250,7 @@ void IscTransaction::doCommit(ISC_STATUS* status, thread_db *tdbb, bool retain)
|
||||
fb_assert(retain && m_handle || !retain && !m_handle || status[1] && m_handle);
|
||||
}
|
||||
|
||||
void IscTransaction::doRollback(ISC_STATUS* status, thread_db *tdbb, bool retain)
|
||||
void IscTransaction::doRollback(ISC_STATUS* status, thread_db* tdbb, bool retain)
|
||||
{
|
||||
EngineCallbackGuard guard(tdbb, *this);
|
||||
if (retain)
|
||||
@ -270,7 +270,7 @@ void IscTransaction::doRollback(ISC_STATUS* status, thread_db *tdbb, bool retain
|
||||
|
||||
// IscStatement
|
||||
|
||||
IscStatement::IscStatement(IscConnection &conn) :
|
||||
IscStatement::IscStatement(IscConnection& conn) :
|
||||
Statement(conn),
|
||||
m_iscProvider(*(IscProvider*) conn.getProvider()),
|
||||
m_iscConnection(conn),
|
||||
@ -286,7 +286,7 @@ IscStatement::~IscStatement()
|
||||
delete[] (char*) m_out_xsqlda;
|
||||
}
|
||||
|
||||
void IscStatement::doPrepare(thread_db *tdbb, const string &sql)
|
||||
void IscStatement::doPrepare(thread_db* tdbb, const string& sql)
|
||||
{
|
||||
FB_API_HANDLE& h_conn = m_iscConnection.getAPIHandle();
|
||||
FB_API_HANDLE& h_tran = getIscTransaction()->getAPIHandle();
|
||||
@ -301,7 +301,7 @@ void IscStatement::doPrepare(thread_db *tdbb, const string &sql)
|
||||
m_out_xsqlda->version = 1;
|
||||
}
|
||||
|
||||
const char *sWhereError = NULL;
|
||||
const char* sWhereError = NULL;
|
||||
{
|
||||
EngineCallbackGuard guard(tdbb, *this);
|
||||
|
||||
@ -424,7 +424,7 @@ void IscStatement::doPrepare(thread_db *tdbb, const string &sql)
|
||||
}
|
||||
}
|
||||
|
||||
void IscStatement::doExecute(thread_db *tdbb)
|
||||
void IscStatement::doExecute(thread_db* tdbb)
|
||||
{
|
||||
FB_API_HANDLE& h_tran = getIscTransaction()->getAPIHandle();
|
||||
|
||||
@ -438,7 +438,7 @@ void IscStatement::doExecute(thread_db *tdbb)
|
||||
}
|
||||
}
|
||||
|
||||
void IscStatement::doOpen(thread_db *tdbb)
|
||||
void IscStatement::doOpen(thread_db* tdbb)
|
||||
{
|
||||
FB_API_HANDLE& h_tran = getIscTransaction()->getAPIHandle();
|
||||
ISC_STATUS_ARRAY status = {0};
|
||||
@ -451,7 +451,7 @@ void IscStatement::doOpen(thread_db *tdbb)
|
||||
}
|
||||
}
|
||||
|
||||
bool IscStatement::doFetch(thread_db *tdbb)
|
||||
bool IscStatement::doFetch(thread_db* tdbb)
|
||||
{
|
||||
ISC_STATUS_ARRAY status = {0};
|
||||
{
|
||||
@ -467,7 +467,7 @@ bool IscStatement::doFetch(thread_db *tdbb)
|
||||
return true;
|
||||
}
|
||||
|
||||
void IscStatement::doClose(thread_db *tdbb, bool drop)
|
||||
void IscStatement::doClose(thread_db* tdbb, bool drop)
|
||||
{
|
||||
fb_assert(m_handle);
|
||||
ISC_STATUS_ARRAY status = {0};
|
||||
@ -484,13 +484,13 @@ void IscStatement::doClose(thread_db *tdbb, bool drop)
|
||||
}
|
||||
}
|
||||
|
||||
void IscStatement::doSetInParams(thread_db *tdbb, int count, const string *const *names, jrd_nod **params)
|
||||
void IscStatement::doSetInParams(thread_db* tdbb, int count, const string* const* names, jrd_nod** params)
|
||||
{
|
||||
Statement::doSetInParams(tdbb, count, names, params);
|
||||
|
||||
if (names)
|
||||
{
|
||||
XSQLVAR *xVar = m_in_xsqlda->sqlvar;
|
||||
XSQLVAR* xVar = m_in_xsqlda->sqlvar;
|
||||
for (int i = 0; i < count; i++, xVar++)
|
||||
{
|
||||
const int max_len = sizeof(xVar->sqlname);
|
||||
@ -504,7 +504,7 @@ void IscStatement::doSetInParams(thread_db *tdbb, int count, const string *const
|
||||
|
||||
// IscBlob
|
||||
|
||||
IscBlob::IscBlob(IscConnection &conn) :
|
||||
IscBlob::IscBlob(IscConnection& conn) :
|
||||
Blob(conn),
|
||||
m_iscProvider(*(IscProvider*) conn.getProvider()),
|
||||
m_iscConnection(conn),
|
||||
@ -518,7 +518,7 @@ IscBlob::~IscBlob()
|
||||
fb_assert(!m_handle);
|
||||
}
|
||||
|
||||
void IscBlob::open(thread_db *tdbb, Transaction &tran, const dsc &desc, const UCharBuffer* bpb)
|
||||
void IscBlob::open(thread_db* tdbb, Transaction& tran, const dsc& desc, const UCharBuffer* bpb)
|
||||
{
|
||||
fb_assert(!m_handle);
|
||||
fb_assert(sizeof(m_blob_id) == desc.dsc_length);
|
||||
@ -544,7 +544,7 @@ void IscBlob::open(thread_db *tdbb, Transaction &tran, const dsc &desc, const UC
|
||||
fb_assert(m_handle);
|
||||
}
|
||||
|
||||
void IscBlob::create(thread_db *tdbb, Transaction &tran, dsc &desc, const UCharBuffer* bpb)
|
||||
void IscBlob::create(thread_db* tdbb, Transaction& tran, dsc& desc, const UCharBuffer* bpb)
|
||||
{
|
||||
fb_assert(!m_handle);
|
||||
fb_assert(sizeof(m_blob_id) == desc.dsc_length);
|
||||
@ -569,7 +569,7 @@ void IscBlob::create(thread_db *tdbb, Transaction &tran, dsc &desc, const UCharB
|
||||
fb_assert(m_handle);
|
||||
}
|
||||
|
||||
USHORT IscBlob::read(thread_db *tdbb, char *buff, USHORT len)
|
||||
USHORT IscBlob::read(thread_db* tdbb, char* buff, USHORT len)
|
||||
{
|
||||
fb_assert(m_handle);
|
||||
|
||||
@ -608,7 +608,7 @@ void IscBlob::write(thread_db* tdbb, const char* buff, USHORT len)
|
||||
}
|
||||
}
|
||||
|
||||
void IscBlob::close(thread_db *tdbb)
|
||||
void IscBlob::close(thread_db* tdbb)
|
||||
{
|
||||
fb_assert(m_handle);
|
||||
ISC_STATUS_ARRAY status = {0};
|
||||
@ -623,7 +623,7 @@ void IscBlob::close(thread_db *tdbb)
|
||||
}
|
||||
|
||||
|
||||
void IscBlob::cancel(thread_db *tdbb)
|
||||
void IscBlob::cancel(thread_db* tdbb)
|
||||
{
|
||||
if (!m_handle)
|
||||
return;
|
||||
@ -667,7 +667,7 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_array_gen_sdl(ISC_STATUS* user_status,
|
||||
return notImplemented(user_status);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_array_get_slice(ISC_STATUS *user_status,
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_array_get_slice(ISC_STATUS* user_status,
|
||||
isc_db_handle *,
|
||||
isc_tr_handle *,
|
||||
ISC_QUAD *,
|
||||
@ -678,7 +678,7 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_array_get_slice(ISC_STATUS *user_status,
|
||||
return notImplemented(user_status);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_array_lookup_bounds(ISC_STATUS *user_status,
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_array_lookup_bounds(ISC_STATUS* user_status,
|
||||
isc_db_handle *,
|
||||
isc_tr_handle *,
|
||||
const char*,
|
||||
@ -688,7 +688,7 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_array_lookup_bounds(ISC_STATUS *user_stat
|
||||
return notImplemented(user_status);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_array_lookup_desc(ISC_STATUS *user_status,
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_array_lookup_desc(ISC_STATUS* user_status,
|
||||
isc_db_handle *,
|
||||
isc_tr_handle *,
|
||||
const char*,
|
||||
@ -698,7 +698,7 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_array_lookup_desc(ISC_STATUS *user_status
|
||||
return notImplemented(user_status);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_array_set_desc(ISC_STATUS *user_status,
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_array_set_desc(ISC_STATUS* user_status,
|
||||
const char*,
|
||||
const char*,
|
||||
const short*,
|
||||
@ -709,7 +709,7 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_array_set_desc(ISC_STATUS *user_status,
|
||||
return notImplemented(user_status);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_array_put_slice(ISC_STATUS *user_status,
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_array_put_slice(ISC_STATUS* user_status,
|
||||
isc_db_handle *,
|
||||
isc_tr_handle *,
|
||||
ISC_QUAD *,
|
||||
@ -727,7 +727,7 @@ void ISC_EXPORT IscProvider::isc_blob_default_desc(ISC_BLOB_DESC *,
|
||||
return;
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_blob_gen_bpb(ISC_STATUS *user_status,
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_blob_gen_bpb(ISC_STATUS* user_status,
|
||||
const ISC_BLOB_DESC*,
|
||||
const ISC_BLOB_DESC*,
|
||||
unsigned short,
|
||||
@ -737,12 +737,12 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_blob_gen_bpb(ISC_STATUS *user_status,
|
||||
return notImplemented(user_status);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_blob_info(ISC_STATUS *user_status,
|
||||
isc_blob_handle *blob_handle,
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_blob_info(ISC_STATUS* user_status,
|
||||
isc_blob_handle* blob_handle,
|
||||
short item_length,
|
||||
const char* items,
|
||||
short buffer_length,
|
||||
char *buffer)
|
||||
char* buffer)
|
||||
{
|
||||
if (!m_api.isc_blob_info)
|
||||
return notImplemented(user_status);
|
||||
@ -751,7 +751,7 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_blob_info(ISC_STATUS *user_status,
|
||||
item_length, items, buffer_length, buffer);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_blob_lookup_desc(ISC_STATUS *user_status,
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_blob_lookup_desc(ISC_STATUS* user_status,
|
||||
isc_db_handle *,
|
||||
isc_tr_handle *,
|
||||
const unsigned char*,
|
||||
@ -762,7 +762,7 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_blob_lookup_desc(ISC_STATUS *user_status,
|
||||
return notImplemented(user_status);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_blob_set_desc(ISC_STATUS *user_status,
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_blob_set_desc(ISC_STATUS* user_status,
|
||||
const unsigned char*,
|
||||
const unsigned char*,
|
||||
short,
|
||||
@ -773,8 +773,8 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_blob_set_desc(ISC_STATUS *user_status,
|
||||
return notImplemented(user_status);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_cancel_blob(ISC_STATUS *user_status,
|
||||
isc_blob_handle *blob_handle)
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_cancel_blob(ISC_STATUS* user_status,
|
||||
isc_blob_handle* blob_handle)
|
||||
{
|
||||
if (!m_api.isc_cancel_blob)
|
||||
return notImplemented(user_status);
|
||||
@ -782,15 +782,15 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_cancel_blob(ISC_STATUS *user_status,
|
||||
return (*m_api.isc_cancel_blob) (user_status, blob_handle);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_cancel_events(ISC_STATUS *user_status,
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_cancel_events(ISC_STATUS* user_status,
|
||||
isc_db_handle *,
|
||||
ISC_LONG *)
|
||||
{
|
||||
return notImplemented(user_status);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_close_blob(ISC_STATUS *user_status,
|
||||
isc_blob_handle *blob_handle)
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_close_blob(ISC_STATUS* user_status,
|
||||
isc_blob_handle* blob_handle)
|
||||
{
|
||||
if (!m_api.isc_close_blob)
|
||||
return notImplemented(user_status);
|
||||
@ -798,8 +798,8 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_close_blob(ISC_STATUS *user_status,
|
||||
return (*m_api.isc_close_blob) (user_status, blob_handle);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_commit_retaining(ISC_STATUS *user_status,
|
||||
isc_tr_handle *tra_handle)
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_commit_retaining(ISC_STATUS* user_status,
|
||||
isc_tr_handle* tra_handle)
|
||||
{
|
||||
if (!m_api.isc_commit_retaining)
|
||||
return notImplemented(user_status);
|
||||
@ -807,8 +807,8 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_commit_retaining(ISC_STATUS *user_status,
|
||||
return (*m_api.isc_commit_retaining) (user_status, tra_handle);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_commit_transaction(ISC_STATUS *user_status,
|
||||
isc_tr_handle *tra_handle)
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_commit_transaction(ISC_STATUS* user_status,
|
||||
isc_tr_handle* tra_handle)
|
||||
{
|
||||
if (!m_api.isc_commit_transaction)
|
||||
return notImplemented(user_status);
|
||||
@ -816,11 +816,11 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_commit_transaction(ISC_STATUS *user_statu
|
||||
return (*m_api.isc_commit_transaction) (user_status, tra_handle);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_create_blob(ISC_STATUS *user_status,
|
||||
isc_db_handle *db_handle,
|
||||
isc_tr_handle *tr_handle,
|
||||
isc_blob_handle *blob_handle,
|
||||
ISC_QUAD *blob_id)
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_create_blob(ISC_STATUS* user_status,
|
||||
isc_db_handle* db_handle,
|
||||
isc_tr_handle* tr_handle,
|
||||
isc_blob_handle* blob_handle,
|
||||
ISC_QUAD* blob_id)
|
||||
{
|
||||
if (!m_api.isc_create_blob)
|
||||
return notImplemented(user_status);
|
||||
@ -829,11 +829,11 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_create_blob(ISC_STATUS *user_status,
|
||||
blob_handle, blob_id);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_create_blob2(ISC_STATUS *user_status,
|
||||
isc_db_handle *db_handle,
|
||||
isc_tr_handle *tr_handle,
|
||||
isc_blob_handle *blob_handle,
|
||||
ISC_QUAD *blob_id,
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_create_blob2(ISC_STATUS* user_status,
|
||||
isc_db_handle* db_handle,
|
||||
isc_tr_handle* tr_handle,
|
||||
isc_blob_handle* blob_handle,
|
||||
ISC_QUAD* blob_id,
|
||||
short bpb_length,
|
||||
const char* bpb)
|
||||
{
|
||||
@ -844,7 +844,7 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_create_blob2(ISC_STATUS *user_status,
|
||||
blob_handle, blob_id, bpb_length, bpb);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_create_database(ISC_STATUS *user_status,
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_create_database(ISC_STATUS* user_status,
|
||||
short,
|
||||
const char*,
|
||||
isc_db_handle *,
|
||||
@ -855,12 +855,12 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_create_database(ISC_STATUS *user_status,
|
||||
return notImplemented(user_status);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_database_info(ISC_STATUS *user_status,
|
||||
isc_db_handle *db_handle,
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_database_info(ISC_STATUS* user_status,
|
||||
isc_db_handle* db_handle,
|
||||
short info_len,
|
||||
const char* info,
|
||||
short res_len,
|
||||
char *res)
|
||||
char* res)
|
||||
{
|
||||
if (!m_api.isc_database_info)
|
||||
return notImplemented(user_status);
|
||||
@ -893,8 +893,8 @@ void ISC_EXPORT IscProvider::isc_decode_timestamp(const ISC_TIMESTAMP*,
|
||||
return;
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_detach_database(ISC_STATUS *user_status,
|
||||
isc_db_handle *public_handle)
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_detach_database(ISC_STATUS* user_status,
|
||||
isc_db_handle* public_handle)
|
||||
{
|
||||
if (!m_api.isc_detach_database)
|
||||
return notImplemented(user_status);
|
||||
@ -902,14 +902,14 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_detach_database(ISC_STATUS *user_status,
|
||||
return (*m_api.isc_detach_database) (user_status, public_handle);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_drop_database(ISC_STATUS *user_status,
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_drop_database(ISC_STATUS* user_status,
|
||||
isc_db_handle *)
|
||||
{
|
||||
return notImplemented(user_status);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_allocate_statement(ISC_STATUS *user_status,
|
||||
isc_db_handle *db_handle, isc_stmt_handle *stmt_handle)
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_allocate_statement(ISC_STATUS* user_status,
|
||||
isc_db_handle* db_handle, isc_stmt_handle* stmt_handle)
|
||||
{
|
||||
if (!m_api.isc_dsql_allocate_statement)
|
||||
return notImplemented(user_status);
|
||||
@ -917,8 +917,8 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_allocate_statement(ISC_STATUS *user_
|
||||
return (*m_api.isc_dsql_allocate_statement) (user_status, db_handle, stmt_handle);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_alloc_statement2(ISC_STATUS *user_status,
|
||||
isc_db_handle *db_handle, isc_stmt_handle *stmt_handle)
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_alloc_statement2(ISC_STATUS* user_status,
|
||||
isc_db_handle* db_handle, isc_stmt_handle* stmt_handle)
|
||||
{
|
||||
if (!m_api.isc_dsql_alloc_statement2)
|
||||
return notImplemented(user_status);
|
||||
@ -926,8 +926,8 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_alloc_statement2(ISC_STATUS *user_st
|
||||
return (*m_api.isc_dsql_alloc_statement2) (user_status, db_handle, stmt_handle);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_describe(ISC_STATUS *user_status,
|
||||
isc_stmt_handle *stmt_handle, unsigned short dialect, XSQLDA *sqlda)
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_describe(ISC_STATUS* user_status,
|
||||
isc_stmt_handle* stmt_handle, unsigned short dialect, XSQLDA* sqlda)
|
||||
{
|
||||
if (!m_api.isc_dsql_describe)
|
||||
return notImplemented(user_status);
|
||||
@ -935,8 +935,8 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_describe(ISC_STATUS *user_status,
|
||||
return (*m_api.isc_dsql_describe) (user_status, stmt_handle, dialect, sqlda);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_describe_bind(ISC_STATUS *user_status,
|
||||
isc_stmt_handle *stmt_handle, unsigned short dialect, XSQLDA *sqlda)
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_describe_bind(ISC_STATUS* user_status,
|
||||
isc_stmt_handle* stmt_handle, unsigned short dialect, XSQLDA* sqlda)
|
||||
{
|
||||
if (!m_api.isc_dsql_describe_bind)
|
||||
return notImplemented(user_status);
|
||||
@ -944,7 +944,7 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_describe_bind(ISC_STATUS *user_statu
|
||||
return (*m_api.isc_dsql_describe_bind) (user_status, stmt_handle, dialect, sqlda);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_exec_immed2(ISC_STATUS *user_status,
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_exec_immed2(ISC_STATUS* user_status,
|
||||
isc_db_handle *,
|
||||
isc_tr_handle *,
|
||||
unsigned short,
|
||||
@ -956,9 +956,9 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_exec_immed2(ISC_STATUS *user_status,
|
||||
return notImplemented(user_status);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_execute(ISC_STATUS *user_status,
|
||||
isc_tr_handle *tra_handle, isc_stmt_handle *stmt_handle, unsigned short dialect,
|
||||
const XSQLDA *sqlda)
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_execute(ISC_STATUS* user_status,
|
||||
isc_tr_handle* tra_handle, isc_stmt_handle* stmt_handle, unsigned short dialect,
|
||||
const XSQLDA* sqlda)
|
||||
{
|
||||
if (!m_api.isc_dsql_execute)
|
||||
return notImplemented(user_status);
|
||||
@ -966,9 +966,9 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_execute(ISC_STATUS *user_status,
|
||||
return (*m_api.isc_dsql_execute) (user_status, tra_handle, stmt_handle, dialect, sqlda);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_execute2(ISC_STATUS *user_status,
|
||||
isc_tr_handle *tra_handle, isc_stmt_handle *stmt_handle, unsigned short dialect,
|
||||
const XSQLDA *in_sqlda, const XSQLDA *out_sqlda)
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_execute2(ISC_STATUS* user_status,
|
||||
isc_tr_handle* tra_handle, isc_stmt_handle* stmt_handle, unsigned short dialect,
|
||||
const XSQLDA* in_sqlda, const XSQLDA* out_sqlda)
|
||||
{
|
||||
if (!m_api.isc_dsql_execute2)
|
||||
return notImplemented(user_status);
|
||||
@ -977,7 +977,7 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_execute2(ISC_STATUS *user_status,
|
||||
in_sqlda, out_sqlda);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_execute_immediate(ISC_STATUS *user_status,
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_execute_immediate(ISC_STATUS* user_status,
|
||||
isc_db_handle *,
|
||||
isc_tr_handle *,
|
||||
unsigned short,
|
||||
@ -988,8 +988,8 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_execute_immediate(ISC_STATUS *user_s
|
||||
return notImplemented(user_status);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_fetch(ISC_STATUS *user_status,
|
||||
isc_stmt_handle *stmt_handle, unsigned short da_version, const XSQLDA *sqlda)
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_fetch(ISC_STATUS* user_status,
|
||||
isc_stmt_handle* stmt_handle, unsigned short da_version, const XSQLDA* sqlda)
|
||||
{
|
||||
if (!m_api.isc_dsql_fetch)
|
||||
return notImplemented(user_status);
|
||||
@ -1002,8 +1002,8 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_finish(isc_db_handle *)
|
||||
return isc_unavailable;
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_free_statement(ISC_STATUS *user_status,
|
||||
isc_stmt_handle *stmt_handle, unsigned short option)
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_free_statement(ISC_STATUS* user_status,
|
||||
isc_stmt_handle* stmt_handle, unsigned short option)
|
||||
{
|
||||
if (!m_api.isc_dsql_free_statement)
|
||||
return notImplemented(user_status);
|
||||
@ -1011,7 +1011,7 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_free_statement(ISC_STATUS *user_stat
|
||||
return (*m_api.isc_dsql_free_statement) (user_status, stmt_handle, option);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_insert(ISC_STATUS *user_status,
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_insert(ISC_STATUS* user_status,
|
||||
isc_stmt_handle *,
|
||||
unsigned short,
|
||||
XSQLDA *)
|
||||
@ -1019,9 +1019,9 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_insert(ISC_STATUS *user_status,
|
||||
return notImplemented(user_status);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_prepare(ISC_STATUS *user_status,
|
||||
isc_tr_handle *tra_handle, isc_stmt_handle *stmt_handle, unsigned short length,
|
||||
const char* str, unsigned short dialect, XSQLDA *sqlda)
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_prepare(ISC_STATUS* user_status,
|
||||
isc_tr_handle* tra_handle, isc_stmt_handle* stmt_handle, unsigned short length,
|
||||
const char* str, unsigned short dialect, XSQLDA* sqlda)
|
||||
{
|
||||
if (!m_api.isc_dsql_prepare)
|
||||
return notImplemented(user_status);
|
||||
@ -1030,7 +1030,7 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_prepare(ISC_STATUS *user_status,
|
||||
length, str, dialect, sqlda);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_set_cursor_name(ISC_STATUS *user_status,
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_set_cursor_name(ISC_STATUS* user_status,
|
||||
isc_stmt_handle *,
|
||||
const char*,
|
||||
unsigned short)
|
||||
@ -1038,9 +1038,9 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_set_cursor_name(ISC_STATUS *user_sta
|
||||
return notImplemented(user_status);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_sql_info(ISC_STATUS *user_status,
|
||||
isc_stmt_handle *stmt_handle, short items_len, const char* items,
|
||||
short buffer_len, char *buffer)
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_dsql_sql_info(ISC_STATUS* user_status,
|
||||
isc_stmt_handle* stmt_handle, short items_len, const char* items,
|
||||
short buffer_len, char* buffer)
|
||||
{
|
||||
if (!m_api.isc_dsql_sql_info)
|
||||
return notImplemented(user_status);
|
||||
@ -1109,11 +1109,11 @@ ISC_LONG ISC_EXPORT IscProvider::isc_free(char *)
|
||||
return 0;
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_get_segment(ISC_STATUS *user_status,
|
||||
isc_blob_handle *blob_handle,
|
||||
unsigned short *length,
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_get_segment(ISC_STATUS* user_status,
|
||||
isc_blob_handle* blob_handle,
|
||||
unsigned short* length,
|
||||
unsigned short buffer_length,
|
||||
char *buffer)
|
||||
char* buffer)
|
||||
{
|
||||
if (!m_api.isc_get_segment)
|
||||
return notImplemented(user_status);
|
||||
@ -1122,7 +1122,7 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_get_segment(ISC_STATUS *user_status,
|
||||
buffer_length, buffer);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_get_slice(ISC_STATUS *user_status,
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_get_slice(ISC_STATUS* user_status,
|
||||
isc_db_handle *,
|
||||
isc_tr_handle *,
|
||||
ISC_QUAD *,
|
||||
@ -1143,11 +1143,11 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_interprete(char *,
|
||||
return isc_unavailable;
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_open_blob(ISC_STATUS *user_status,
|
||||
isc_db_handle *db_handle,
|
||||
isc_tr_handle *tr_handle,
|
||||
isc_blob_handle *blob_handle,
|
||||
ISC_QUAD *blob_id)
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_open_blob(ISC_STATUS* user_status,
|
||||
isc_db_handle* db_handle,
|
||||
isc_tr_handle* tr_handle,
|
||||
isc_blob_handle* blob_handle,
|
||||
ISC_QUAD* blob_id)
|
||||
{
|
||||
if (!m_api.isc_open_blob)
|
||||
return notImplemented(user_status);
|
||||
@ -1156,11 +1156,11 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_open_blob(ISC_STATUS *user_status,
|
||||
blob_handle, blob_id);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_open_blob2(ISC_STATUS *user_status,
|
||||
isc_db_handle *db_handle,
|
||||
isc_tr_handle *tr_handle,
|
||||
isc_blob_handle *blob_handle,
|
||||
ISC_QUAD *blob_id,
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_open_blob2(ISC_STATUS* user_status,
|
||||
isc_db_handle* db_handle,
|
||||
isc_tr_handle* tr_handle,
|
||||
isc_blob_handle* blob_handle,
|
||||
ISC_QUAD* blob_id,
|
||||
ISC_USHORT bpb_length,
|
||||
const ISC_UCHAR* bpb)
|
||||
{
|
||||
@ -1171,7 +1171,7 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_open_blob2(ISC_STATUS *user_status,
|
||||
blob_handle, blob_id, bpb_length, bpb);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_prepare_transaction2(ISC_STATUS *user_status,
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_prepare_transaction2(ISC_STATUS* user_status,
|
||||
isc_tr_handle *,
|
||||
ISC_USHORT,
|
||||
const ISC_UCHAR*)
|
||||
@ -1190,8 +1190,8 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_print_status(const ISC_STATUS*)
|
||||
return isc_unavailable;
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_put_segment(ISC_STATUS *user_status,
|
||||
isc_blob_handle *blob_handle,
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_put_segment(ISC_STATUS* user_status,
|
||||
isc_blob_handle* blob_handle,
|
||||
unsigned short buffer_length,
|
||||
const char* buffer)
|
||||
{
|
||||
@ -1202,7 +1202,7 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_put_segment(ISC_STATUS *user_status,
|
||||
buffer_length, buffer);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_put_slice(ISC_STATUS *user_status,
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_put_slice(ISC_STATUS* user_status,
|
||||
isc_db_handle *,
|
||||
isc_tr_handle *,
|
||||
ISC_QUAD *,
|
||||
@ -1216,7 +1216,7 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_put_slice(ISC_STATUS *user_status,
|
||||
return notImplemented(user_status);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_que_events(ISC_STATUS *user_status,
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_que_events(ISC_STATUS* user_status,
|
||||
isc_db_handle *,
|
||||
ISC_LONG *,
|
||||
ISC_USHORT,
|
||||
@ -1227,8 +1227,8 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_que_events(ISC_STATUS *user_status,
|
||||
return notImplemented(user_status);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_rollback_retaining(ISC_STATUS *user_status,
|
||||
isc_tr_handle *tra_handle)
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_rollback_retaining(ISC_STATUS* user_status,
|
||||
isc_tr_handle* tra_handle)
|
||||
{
|
||||
if (!m_api.isc_rollback_retaining)
|
||||
return notImplemented(user_status);
|
||||
@ -1236,8 +1236,8 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_rollback_retaining(ISC_STATUS *user_statu
|
||||
return (*m_api.isc_rollback_retaining) (user_status, tra_handle);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_rollback_transaction(ISC_STATUS *user_status,
|
||||
isc_tr_handle *tra_handle)
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_rollback_transaction(ISC_STATUS* user_status,
|
||||
isc_tr_handle* tra_handle)
|
||||
{
|
||||
if (!m_api.isc_rollback_transaction)
|
||||
return notImplemented(user_status);
|
||||
@ -1245,8 +1245,8 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_rollback_transaction(ISC_STATUS *user_sta
|
||||
return (*m_api.isc_rollback_transaction) (user_status, tra_handle);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_start_multiple(ISC_STATUS *user_status,
|
||||
isc_tr_handle *tra_handle, short count, void *vec)
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_start_multiple(ISC_STATUS* user_status,
|
||||
isc_tr_handle* tra_handle, short count, void* vec)
|
||||
{
|
||||
if (!m_api.isc_start_multiple)
|
||||
return notImplemented(user_status);
|
||||
@ -1257,13 +1257,13 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_start_multiple(ISC_STATUS *user_status,
|
||||
|
||||
struct why_teb
|
||||
{
|
||||
FB_API_HANDLE *teb_database;
|
||||
FB_API_HANDLE* teb_database;
|
||||
int teb_tpb_length;
|
||||
const UCHAR *teb_tpb;
|
||||
const UCHAR* teb_tpb;
|
||||
};
|
||||
|
||||
ISC_STATUS ISC_EXPORT_VARARG IscProvider::isc_start_transaction(ISC_STATUS *user_status,
|
||||
isc_tr_handle *tra_handle,
|
||||
ISC_STATUS ISC_EXPORT_VARARG IscProvider::isc_start_transaction(ISC_STATUS* user_status,
|
||||
isc_tr_handle* tra_handle,
|
||||
short count, ...)
|
||||
{
|
||||
if (!m_api.isc_start_multiple) // !!!
|
||||
@ -1287,7 +1287,7 @@ ISC_STATUS ISC_EXPORT_VARARG IscProvider::isc_start_transaction(ISC_STATUS *user
|
||||
return (*m_api.isc_start_multiple) (user_status, tra_handle, count, teb);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT_VARARG IscProvider::isc_reconnect_transaction(ISC_STATUS *user_status,
|
||||
ISC_STATUS ISC_EXPORT_VARARG IscProvider::isc_reconnect_transaction(ISC_STATUS* user_status,
|
||||
isc_db_handle *,
|
||||
isc_tr_handle *,
|
||||
short,
|
||||
@ -1308,7 +1308,7 @@ void ISC_EXPORT IscProvider::isc_sql_interprete(short,
|
||||
return;
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_transaction_info(ISC_STATUS *user_status,
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_transaction_info(ISC_STATUS* user_status,
|
||||
isc_tr_handle *,
|
||||
short,
|
||||
const char*,
|
||||
@ -1318,7 +1318,7 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_transaction_info(ISC_STATUS *user_status,
|
||||
return notImplemented(user_status);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_transact_request(ISC_STATUS *user_status,
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_transact_request(ISC_STATUS* user_status,
|
||||
isc_db_handle *,
|
||||
isc_tr_handle *,
|
||||
unsigned short,
|
||||
@ -1341,7 +1341,7 @@ ISC_INT64 ISC_EXPORT IscProvider::isc_portable_integer(const unsigned char* p, s
|
||||
return ::isc_portable_integer(p, len);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_seek_blob(ISC_STATUS *user_status,
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_seek_blob(ISC_STATUS* user_status,
|
||||
isc_blob_handle *,
|
||||
short,
|
||||
ISC_LONG,
|
||||
@ -1350,7 +1350,7 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_seek_blob(ISC_STATUS *user_status,
|
||||
return notImplemented(user_status);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_service_attach(ISC_STATUS *user_status,
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_service_attach(ISC_STATUS* user_status,
|
||||
unsigned short,
|
||||
const char*,
|
||||
isc_svc_handle *,
|
||||
@ -1360,13 +1360,13 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_service_attach(ISC_STATUS *user_status,
|
||||
return notImplemented(user_status);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_service_detach(ISC_STATUS *user_status,
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_service_detach(ISC_STATUS* user_status,
|
||||
isc_svc_handle *)
|
||||
{
|
||||
return notImplemented(user_status);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_service_query(ISC_STATUS *user_status,
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_service_query(ISC_STATUS* user_status,
|
||||
isc_svc_handle *,
|
||||
isc_resv_handle *,
|
||||
unsigned short,
|
||||
@ -1379,7 +1379,7 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_service_query(ISC_STATUS *user_status,
|
||||
return notImplemented(user_status);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_service_start(ISC_STATUS *user_status,
|
||||
ISC_STATUS ISC_EXPORT IscProvider::isc_service_start(ISC_STATUS* user_status,
|
||||
isc_svc_handle *,
|
||||
isc_resv_handle *,
|
||||
unsigned short,
|
||||
@ -1388,8 +1388,8 @@ ISC_STATUS ISC_EXPORT IscProvider::isc_service_start(ISC_STATUS *user_status,
|
||||
return notImplemented(user_status);
|
||||
}
|
||||
|
||||
ISC_STATUS ISC_EXPORT IscProvider::fb_cancel_operation(ISC_STATUS *user_status,
|
||||
isc_db_handle *db_handle,
|
||||
ISC_STATUS ISC_EXPORT IscProvider::fb_cancel_operation(ISC_STATUS* user_status,
|
||||
isc_db_handle* db_handle,
|
||||
USHORT option)
|
||||
{
|
||||
if (m_api.fb_cancel_operation)
|
||||
@ -1514,7 +1514,7 @@ static bool isConnectionBrokenError(ISC_STATUS status)
|
||||
}
|
||||
|
||||
|
||||
static void parseSQLDA(XSQLDA *xsqlda, UCharBuffer &buff, Firebird::Array<dsc> &descs)
|
||||
static void parseSQLDA(XSQLDA* xsqlda, UCharBuffer& buff, Firebird::Array<dsc> &descs)
|
||||
{
|
||||
size_t offset = 0;
|
||||
int i = 0;
|
||||
@ -1539,7 +1539,7 @@ static void parseSQLDA(XSQLDA *xsqlda, UCharBuffer &buff, Firebird::Array<dsc> &
|
||||
}
|
||||
|
||||
descs.resize(xsqlda->sqld * 2);
|
||||
UCHAR *p = buff.getBuffer(offset);
|
||||
UCHAR* p = buff.getBuffer(offset);
|
||||
|
||||
offset = 0;
|
||||
xVar = xsqlda->sqlvar;
|
||||
@ -1552,7 +1552,7 @@ static void parseSQLDA(XSQLDA *xsqlda, UCharBuffer &buff, Firebird::Array<dsc> &
|
||||
xVar->sqldata = (ISC_SCHAR*) (p + offset);
|
||||
|
||||
// build the src descriptor
|
||||
dsc &src = descs[i * 2];
|
||||
dsc& src = descs[i * 2];
|
||||
src.dsc_dtype = dtype;
|
||||
src.dsc_length = xVar->sqllen;
|
||||
src.dsc_scale = xVar->sqlscale;
|
||||
@ -1574,7 +1574,7 @@ static void parseSQLDA(XSQLDA *xsqlda, UCharBuffer &buff, Firebird::Array<dsc> &
|
||||
offset = FB_ALIGN(offset, type_alignments[dtype_short]);
|
||||
xVar->sqlind = (SSHORT*) (p + offset);
|
||||
|
||||
dsc &null = descs[i * 2 + 1];
|
||||
dsc& null = descs[i * 2 + 1];
|
||||
null.makeShort(0, xVar->sqlind);
|
||||
|
||||
offset += sizeof(SSHORT);
|
||||
|
@ -50,7 +50,7 @@ public:
|
||||
}
|
||||
|
||||
virtual void jrdAttachmentEnd(Jrd::thread_db* /*tdbb*/, Jrd::Attachment* /*att*/) {}
|
||||
virtual void getRemoteError(ISC_STATUS* status, Firebird::string &err) const;
|
||||
virtual void getRemoteError(ISC_STATUS* status, Firebird::string& err) const;
|
||||
|
||||
protected:
|
||||
ISC_STATUS notImplemented(ISC_STATUS*) const;
|
||||
@ -504,19 +504,19 @@ class IscConnection : public Connection
|
||||
friend class IscProvider;
|
||||
|
||||
protected:
|
||||
explicit IscConnection(IscProvider &prov);
|
||||
explicit IscConnection(IscProvider& prov);
|
||||
virtual ~IscConnection();
|
||||
|
||||
public:
|
||||
FB_API_HANDLE& getAPIHandle() { return m_handle; }
|
||||
|
||||
virtual void attach(Jrd::thread_db *tdbb, const Firebird::string &dbName,
|
||||
const Firebird::string &user, const Firebird::string &pwd,
|
||||
const Firebird::string &role);
|
||||
virtual void attach(Jrd::thread_db* tdbb, const Firebird::string& dbName,
|
||||
const Firebird::string& user, const Firebird::string& pwd,
|
||||
const Firebird::string& role);
|
||||
|
||||
virtual bool cancelExecution(Jrd::thread_db *tdbb);
|
||||
virtual bool cancelExecution(Jrd::thread_db* tdbb);
|
||||
|
||||
virtual bool isAvailable(Jrd::thread_db *tdbb, TraScope traScope) const;
|
||||
virtual bool isAvailable(Jrd::thread_db* tdbb, TraScope traScope) const;
|
||||
|
||||
virtual bool isConnected() const { return (m_handle != 0); }
|
||||
|
||||
@ -525,7 +525,7 @@ public:
|
||||
protected:
|
||||
virtual Transaction* doCreateTransaction();
|
||||
virtual Statement* doCreateStatement();
|
||||
virtual void doDetach(Jrd::thread_db *tdbb);
|
||||
virtual void doDetach(Jrd::thread_db* tdbb);
|
||||
|
||||
IscProvider& m_iscProvider;
|
||||
FB_API_HANDLE m_handle;
|
||||
@ -540,7 +540,7 @@ public:
|
||||
FB_API_HANDLE& getAPIHandle() { return m_handle; }
|
||||
|
||||
protected:
|
||||
explicit IscTransaction(IscConnection &conn) :
|
||||
explicit IscTransaction(IscConnection& conn) :
|
||||
Transaction(conn),
|
||||
m_iscProvider(*(IscProvider*) conn.getProvider()),
|
||||
m_iscConnection(conn),
|
||||
@ -549,13 +549,13 @@ protected:
|
||||
|
||||
virtual ~IscTransaction() {}
|
||||
|
||||
virtual void doStart(ISC_STATUS* status, Jrd::thread_db *tdbb, Firebird::ClumpletWriter &tpb);
|
||||
virtual void doPrepare(ISC_STATUS* status, Jrd::thread_db *tdbb, int info_len, const char* info);
|
||||
virtual void doCommit(ISC_STATUS* status, Jrd::thread_db *tdbb, bool retain);
|
||||
virtual void doRollback(ISC_STATUS* status, Jrd::thread_db *tdbb, bool retain);
|
||||
virtual void doStart(ISC_STATUS* status, Jrd::thread_db* tdbb, Firebird::ClumpletWriter& tpb);
|
||||
virtual void doPrepare(ISC_STATUS* status, Jrd::thread_db* tdbb, int info_len, const char* info);
|
||||
virtual void doCommit(ISC_STATUS* status, Jrd::thread_db* tdbb, bool retain);
|
||||
virtual void doRollback(ISC_STATUS* status, Jrd::thread_db* tdbb, bool retain);
|
||||
|
||||
IscProvider &m_iscProvider;
|
||||
IscConnection &m_iscConnection;
|
||||
IscProvider& m_iscProvider;
|
||||
IscConnection& m_iscConnection;
|
||||
FB_API_HANDLE m_handle;
|
||||
};
|
||||
|
||||
@ -568,23 +568,23 @@ public:
|
||||
FB_API_HANDLE& getAPIHandle() { return m_handle; }
|
||||
|
||||
protected:
|
||||
explicit IscStatement(IscConnection &conn);
|
||||
explicit IscStatement(IscConnection& conn);
|
||||
virtual ~IscStatement();
|
||||
|
||||
protected:
|
||||
virtual void doPrepare(Jrd::thread_db *tdbb, const Firebird::string &sql);
|
||||
virtual void doExecute(Jrd::thread_db *tdbb);
|
||||
virtual void doOpen(Jrd::thread_db *tdbb);
|
||||
virtual bool doFetch(Jrd::thread_db *tdbb);
|
||||
virtual void doClose(Jrd::thread_db *tdbb, bool drop);
|
||||
virtual void doPrepare(Jrd::thread_db* tdbb, const Firebird::string& sql);
|
||||
virtual void doExecute(Jrd::thread_db* tdbb);
|
||||
virtual void doOpen(Jrd::thread_db* tdbb);
|
||||
virtual bool doFetch(Jrd::thread_db* tdbb);
|
||||
virtual void doClose(Jrd::thread_db* tdbb, bool drop);
|
||||
|
||||
virtual void doSetInParams(Jrd::thread_db *tdbb, int count, const Firebird::string *const *names,
|
||||
Jrd::jrd_nod **params);
|
||||
virtual void doSetInParams(Jrd::thread_db* tdbb, int count, const Firebird::string* const* names,
|
||||
Jrd::jrd_nod** params);
|
||||
|
||||
IscTransaction *getIscTransaction() { return (IscTransaction*) m_transaction; }
|
||||
IscTransaction* getIscTransaction() { return (IscTransaction*) m_transaction; }
|
||||
|
||||
IscProvider &m_iscProvider;
|
||||
IscConnection &m_iscConnection;
|
||||
IscProvider& m_iscProvider;
|
||||
IscConnection& m_iscConnection;
|
||||
FB_API_HANDLE m_handle;
|
||||
XSQLDA *m_in_xsqlda;
|
||||
XSQLDA *m_out_xsqlda;
|
||||
@ -594,24 +594,24 @@ class IscBlob : public Blob
|
||||
{
|
||||
friend class IscConnection;
|
||||
protected:
|
||||
explicit IscBlob(IscConnection &conn);
|
||||
explicit IscBlob(IscConnection& conn);
|
||||
|
||||
public:
|
||||
~IscBlob();
|
||||
|
||||
public:
|
||||
virtual void open(Jrd::thread_db *tdbb, Transaction &tran, const dsc &desc,
|
||||
virtual void open(Jrd::thread_db* tdbb, Transaction& tran, const dsc& desc,
|
||||
const Firebird::UCharBuffer* bpb);
|
||||
virtual void create(Jrd::thread_db *tdbb, Transaction &tran, dsc &desc,
|
||||
virtual void create(Jrd::thread_db* tdbb, Transaction& tran, dsc& desc,
|
||||
const Firebird::UCharBuffer* bpb);
|
||||
virtual USHORT read(Jrd::thread_db *tdbb, char *buff, USHORT len);
|
||||
virtual void write(Jrd::thread_db *tdbb, const char* buff, USHORT len);
|
||||
virtual void close(Jrd::thread_db *tdbb);
|
||||
virtual void cancel(Jrd::thread_db *tdbb);
|
||||
virtual USHORT read(Jrd::thread_db* tdbb, char* buff, USHORT len);
|
||||
virtual void write(Jrd::thread_db* tdbb, const char* buff, USHORT len);
|
||||
virtual void close(Jrd::thread_db* tdbb);
|
||||
virtual void cancel(Jrd::thread_db* tdbb);
|
||||
|
||||
private:
|
||||
IscProvider &m_iscProvider;
|
||||
IscConnection &m_iscConnection;
|
||||
IscProvider& m_iscProvider;
|
||||
IscConnection& m_iscConnection;
|
||||
FB_API_HANDLE m_handle;
|
||||
ISC_QUAD m_blob_id;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user