mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 16:43:03 +01:00
Misc.
This commit is contained in:
parent
e280bca0f9
commit
9ece682387
@ -13,7 +13,7 @@
|
||||
# See the License for the specific language governing rights
|
||||
# and limitations under the License.
|
||||
#
|
||||
# The Original Code was created by Nickolay Samofatov
|
||||
# The Original Code was created by Adriano dos Santos Fernandes
|
||||
# for the Firebird Open Source RDBMS project.
|
||||
#
|
||||
# Copyright (c) 2015 Adriano dos Santos Fernandes <adrianosf@gmail.com>
|
||||
|
@ -3,7 +3,7 @@
|
||||
* MODULE: 01.create.cpp
|
||||
* DESCRIPTION: A sample of creating new database and new table in it.
|
||||
* Run second time (whene database already exists) to see
|
||||
* how FbException is caught and handled by thid code.
|
||||
* how FbException is caught and handled by this code.
|
||||
*
|
||||
* Example for the following interfaces:
|
||||
* IMaster - main inteface to access all the rest
|
||||
|
@ -131,7 +131,7 @@ int main()
|
||||
{
|
||||
stmt->execute(&status, tra, meta, buffer, NULL, NULL);
|
||||
}
|
||||
catch(const FbException& error)
|
||||
catch (const FbException& error)
|
||||
{
|
||||
// Handle exception raised during statement execution
|
||||
int sqlcode = isc_sqlcode(error.getStatus()->getErrors());
|
||||
@ -210,4 +210,3 @@ int get_input (char *dept_no, double *percent)
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,7 @@ int CLIB_ROUTINE main(int argc, char* argv[])
|
||||
Firebird::AutoPtr<Firebird::UtilSvc> uSvc(Firebird::UtilSvc::createStandalone(argc, argv));
|
||||
return alice(uSvc);
|
||||
}
|
||||
catch(const Firebird::Exception& ex)
|
||||
catch (const Firebird::Exception& ex)
|
||||
{
|
||||
ISC_STATUS_ARRAY st;
|
||||
ex.stuff_exception(st);
|
||||
|
@ -48,7 +48,7 @@ int CLIB_ROUTINE main( int argc, char* argv[])
|
||||
Firebird::AutoPtr<Firebird::UtilSvc> uSvc(Firebird::UtilSvc::createStandalone(argc, argv));
|
||||
return gbak(uSvc);
|
||||
}
|
||||
catch(const Firebird::Exception& ex)
|
||||
catch (const Firebird::Exception& ex)
|
||||
{
|
||||
ISC_STATUS_ARRAY st;
|
||||
ex.stuff_exception(st);
|
||||
|
@ -355,7 +355,7 @@ bool ISC_get_user(Firebird::string* name, int* id, int* group)
|
||||
p = password->pw_name;
|
||||
else
|
||||
p = "";
|
||||
#ifndef ANDROID // Why do they print silly unimplemted message for this function?
|
||||
#ifndef ANDROID // Why do they print silly unimplemented message for this function?
|
||||
endpwent();
|
||||
#endif
|
||||
|
||||
|
@ -30,8 +30,8 @@
|
||||
using namespace Firebird;
|
||||
using namespace Jrd;
|
||||
|
||||
const char* const SCRATCH = "fb_cursor_";
|
||||
const ULONG PREFETCH_SIZE = 65536; // 64 KB
|
||||
static const char* const SCRATCH = "fb_cursor_";
|
||||
static const ULONG PREFETCH_SIZE = 65536; // 64 KB
|
||||
|
||||
DsqlCursor::DsqlCursor(dsql_req* req, ULONG flags)
|
||||
: m_request(req), m_flags(flags),
|
||||
|
@ -75,4 +75,3 @@ private:
|
||||
} // namespace
|
||||
|
||||
#endif // DSQL_CURSOR_H
|
||||
|
||||
|
@ -3242,8 +3242,8 @@ static void down_grade(thread_db* tdbb, BufferDesc* bdb, int high)
|
||||
return; // false;
|
||||
|
||||
// hvlad: buffer is in use and we can't downgrade its lock. But if this
|
||||
// buffer blocks some lower precedence buffer, it is enough to just write
|
||||
// our (high) buffer to clear precedence and thus allow blocked (low)
|
||||
// buffer blocks some lower precedence buffer, it is enough to just write
|
||||
// our (high) buffer to clear precedence and thus allow blocked (low)
|
||||
// buffer to be downgraded. IO lock guarantees that there is no buffer
|
||||
// modification in progress currently and it is safe to write it right now.
|
||||
// No need to mark our buffer as blocking nor to change state of our lock.
|
||||
@ -3255,9 +3255,9 @@ static void down_grade(thread_db* tdbb, BufferDesc* bdb, int high)
|
||||
return; // true
|
||||
}
|
||||
|
||||
if (!oldBlocking) {
|
||||
if (!oldBlocking)
|
||||
bdb->bdb_ast_flags &= ~BDB_blocking;
|
||||
}
|
||||
|
||||
justWrite = true;
|
||||
}
|
||||
|
||||
@ -3397,6 +3397,7 @@ static void down_grade(thread_db* tdbb, BufferDesc* bdb, int high)
|
||||
} // syncPrec scope
|
||||
|
||||
bdb->bdb_flags &= ~BDB_not_valid;
|
||||
|
||||
if (justWrite)
|
||||
bdb->unLockIO(tdbb);
|
||||
else
|
||||
|
@ -4495,10 +4495,8 @@ JResultSet* JStatement::openCursor(CheckStatusWrapper* user_status, ITransaction
|
||||
}
|
||||
}
|
||||
|
||||
DsqlCursor* const cursor =
|
||||
DSQL_open(tdbb, &tra, getHandle(),
|
||||
inMetadata, static_cast<UCHAR*>(inBuffer),
|
||||
outMetadata, flags);
|
||||
DsqlCursor* const cursor = DSQL_open(tdbb, &tra, getHandle(),
|
||||
inMetadata, static_cast<UCHAR*>(inBuffer), outMetadata, flags);
|
||||
|
||||
rs = new JResultSet(cursor, this);
|
||||
rs->addRef();
|
||||
|
@ -1686,8 +1686,8 @@ SRQ_PTR LockManager::create_owner(Arg::StatusVector& statusVector,
|
||||
{
|
||||
TEXT bug_buffer[BUFFER_TINY];
|
||||
sprintf(bug_buffer, "inconsistent lock table type/version; found %d/%d:%d, expected %d/%d:%d",
|
||||
m_sharedMemory->getHeader()->mhb_type,
|
||||
m_sharedMemory->getHeader()->mhb_header_version,
|
||||
m_sharedMemory->getHeader()->mhb_type,
|
||||
m_sharedMemory->getHeader()->mhb_header_version,
|
||||
m_sharedMemory->getHeader()->mhb_version,
|
||||
SharedMemoryBase::SRAM_LOCK_MANAGER, MemoryHeader::HEADER_VERSION, LHB_VERSION);
|
||||
bug(&statusVector, bug_buffer);
|
||||
|
@ -762,7 +762,7 @@ int CLIB_ROUTINE main( int argc, char *argv[])
|
||||
|
||||
// if we can't read this version - admit there's nothing to say and return.
|
||||
|
||||
if (LOCK_header->mhb_header_version != MemoryHeader::HEADER_VERSION ||
|
||||
if (LOCK_header->mhb_header_version != MemoryHeader::HEADER_VERSION ||
|
||||
LOCK_header->mhb_version != LHB_VERSION)
|
||||
{
|
||||
if (LOCK_header->mhb_type == 0 && LOCK_header->mhb_header_version == 0 && LOCK_header->mhb_version == 0)
|
||||
|
@ -127,7 +127,7 @@ void Arc4::setKey(CheckStatusWrapper* status, ICryptKey* key)
|
||||
k = key->getDecryptKey(&l);
|
||||
de = createCypher(l, k);
|
||||
}
|
||||
catch(const Exception& ex)
|
||||
catch (const Exception& ex)
|
||||
{
|
||||
ex.stuffException(status);
|
||||
}
|
||||
|
@ -199,8 +199,6 @@ public:
|
||||
for (bool cont = accessor.getFirst(); cont; cont = accessor.getNext())
|
||||
accessor.current()->second->dispose();
|
||||
}
|
||||
|
||||
delete module;
|
||||
}
|
||||
|
||||
public:
|
||||
@ -265,7 +263,7 @@ public:
|
||||
|
||||
private:
|
||||
PathName moduleName;
|
||||
ModuleLoader::Module* module;
|
||||
AutoPtr<ModuleLoader::Module> module;
|
||||
|
||||
public:
|
||||
FB_BOOLEAN myUnloadFlag;
|
||||
|
@ -1676,7 +1676,8 @@ void rem_port::initCompression()
|
||||
}
|
||||
|
||||
|
||||
void InternalCryptKey::setSymmetric(Firebird::CheckStatusWrapper* status, const char* type, unsigned keyLength, const void* key)
|
||||
void InternalCryptKey::setSymmetric(Firebird::CheckStatusWrapper* status, const char* type,
|
||||
unsigned keyLength, const void* key)
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -1685,14 +1686,15 @@ void InternalCryptKey::setSymmetric(Firebird::CheckStatusWrapper* status, const
|
||||
encrypt.set(keyLength, key);
|
||||
decrypt.clear();
|
||||
}
|
||||
catch(const Firebird::Exception& ex)
|
||||
catch (const Firebird::Exception& ex)
|
||||
{
|
||||
ex.stuffException(status);
|
||||
}
|
||||
}
|
||||
|
||||
void InternalCryptKey::setAsymmetric(Firebird::CheckStatusWrapper* status, const char* type, unsigned encryptKeyLength,
|
||||
const void* encryptKey, unsigned decryptKeyLength, const void* decryptKey)
|
||||
void InternalCryptKey::setAsymmetric(Firebird::CheckStatusWrapper* status, const char* type,
|
||||
unsigned encryptKeyLength, const void* encryptKey, unsigned decryptKeyLength,
|
||||
const void* decryptKey)
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -1701,7 +1703,7 @@ void InternalCryptKey::setAsymmetric(Firebird::CheckStatusWrapper* status, const
|
||||
encrypt.set(encryptKeyLength, encryptKey);
|
||||
decrypt.set(decryptKeyLength, decryptKey);
|
||||
}
|
||||
catch(const Firebird::Exception& ex)
|
||||
catch (const Firebird::Exception& ex)
|
||||
{
|
||||
ex.stuffException(status);
|
||||
}
|
||||
|
@ -637,7 +637,8 @@ public:
|
||||
};
|
||||
|
||||
// CryptKey implementation
|
||||
class InternalCryptKey FB_FINAL : public Firebird::VersionedIface<Firebird::ICryptKeyImpl<InternalCryptKey, Firebird::CheckStatusWrapper> >,
|
||||
class InternalCryptKey FB_FINAL :
|
||||
public Firebird::VersionedIface<Firebird::ICryptKeyImpl<InternalCryptKey, Firebird::CheckStatusWrapper> >,
|
||||
public Firebird::GlobalStorage
|
||||
{
|
||||
public:
|
||||
|
@ -48,7 +48,7 @@ int CLIB_ROUTINE main(int argc, char* argv[])
|
||||
Firebird::AutoPtr<Firebird::UtilSvc> uSvc(Firebird::UtilSvc::createStandalone(argc, argv));
|
||||
return gsec(uSvc);
|
||||
}
|
||||
catch(const Firebird::Exception& ex)
|
||||
catch (const Firebird::Exception& ex)
|
||||
{
|
||||
ISC_STATUS_ARRAY st;
|
||||
ex.stuff_exception(st);
|
||||
|
@ -48,7 +48,7 @@ int CLIB_ROUTINE main(int argc, char* argv[])
|
||||
Firebird::AutoPtr<Firebird::UtilSvc> uSvc(Firebird::UtilSvc::createStandalone(argc, argv));
|
||||
return gstat(uSvc);
|
||||
}
|
||||
catch(const Firebird::Exception& ex)
|
||||
catch (const Firebird::Exception& ex)
|
||||
{
|
||||
ISC_STATUS_ARRAY st;
|
||||
ex.stuff_exception(st);
|
||||
|
@ -502,7 +502,8 @@ void DtcStart::addAttachment(CheckStatusWrapper* status, IAttachment* att)
|
||||
this->addWithTpb(status, att, 0, NULL);
|
||||
}
|
||||
|
||||
void DtcStart::addWithTpb(CheckStatusWrapper* status, IAttachment* att, unsigned length, const unsigned char* tpb)
|
||||
void DtcStart::addWithTpb(CheckStatusWrapper* status, IAttachment* att,
|
||||
unsigned length, const unsigned char* tpb)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -62,7 +62,8 @@ public:
|
||||
|
||||
// IDtcStart implementation
|
||||
void addAttachment(Firebird::CheckStatusWrapper* status, Firebird::IAttachment* att);
|
||||
void addWithTpb(Firebird::CheckStatusWrapper* status, Firebird::IAttachment* att, unsigned length, const unsigned char* tpb);
|
||||
void addWithTpb(Firebird::CheckStatusWrapper* status, Firebird::IAttachment* att,
|
||||
unsigned length, const unsigned char* tpb);
|
||||
YTransaction* start(Firebird::CheckStatusWrapper* status);
|
||||
void dispose();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user