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

Comments.

This commit is contained in:
robocop 2009-11-21 03:23:47 +00:00
parent 55011b81b9
commit 0f16326892
2 changed files with 217 additions and 221 deletions

View File

@ -130,10 +130,10 @@
#include "gen/iberror.h"
/* Pick up system relation ids */
// Pick up system relation ids
#include "../jrd/ini.h"
/* Define range of user relation ids */
// Define range of user relation ids
const int MIN_RELATION_ID = rel_MAX;
const int MAX_RELATION_ID = 32767;
@ -504,8 +504,8 @@ USHORT DFW_assign_index_type(thread_db* tdbb, const Firebird::string& name, SSHO
return idx_string;
}
/* Dynamic text cannot occur here as this is for an on-disk
index, which must be bound to a text type. */
// Dynamic text cannot occur here as this is for an on-disk
// index, which must be bound to a text type.
fb_assert(ttype != ttype_dynamic);
@ -697,7 +697,7 @@ void DFW_perform_work(thread_db* tdbb, jrd_tra* transaction)
*
**************************************/
/* If no deferred work or it's all deferred event posting don't bother */
// If no deferred work or it's all deferred event posting don't bother
if (!transaction->tra_deferred_job || !(transaction->tra_flags & TRA_deferred_meta))
{
@ -752,7 +752,7 @@ void DFW_perform_work(thread_db* tdbb, jrd_tra* transaction)
catch (const Firebird::Exception& ex) {
tdbb->tdbb_flags &= ~(TDBB_dont_post_dfw | TDBB_use_db_page_space);
/* Do any necessary cleanup */
// Do any necessary cleanup
if (!phase) {
Firebird::stuff_exception(tdbb->tdbb_status_vector, ex);
ERR_punt();
@ -766,9 +766,9 @@ void DFW_perform_work(thread_db* tdbb, jrd_tra* transaction)
} while (more);
/* Remove deferred work blocks so that system transaction and
commit retaining transactions don't re-execute them. Leave
events to be posted after commit */
// Remove deferred work blocks so that system transaction and
// commit retaining transactions don't re-execute them. Leave
// events to be posted after commit
for (DeferredWork* itr = transaction->tra_deferred_job->work; itr;)
{
@ -1101,8 +1101,8 @@ static bool add_file(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_tra*
FOR(REQUEST_HANDLE handle TRANSACTION_HANDLE transaction) X IN RDB$FILES
WITH X.RDB$FILE_NAME EQ work->dfw_name.c_str()
/* First expand the file name This has already been done
** for shadows in add_shadow ()) */
// First expand the file name This has already been done
// for shadows in add_shadow ())
if (work->dfw_type != dfw_add_shadow)
{
MODIFY X USING
@ -1111,9 +1111,9 @@ static bool add_file(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_tra*
END_MODIFY;
}
/* If there is no starting position specified, or if it is
too low a value, make a stab at assigning one based on
the indicated preference for the previous file length. */
// If there is no starting position specified, or if it is
// too low a value, make a stab at assigning one based on
// the indicated preference for the previous file length.
if ((start = X.RDB$FILE_START) < max)
{
@ -1233,9 +1233,8 @@ static bool add_shadow(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_tr
{
if (F.RDB$FILE_FLAGS & FILE_shadow)
{
/* This is the case of a bogus duplicate posted
* work when we added a multi-file shadow
*/
// This is the case of a bogus duplicate posted
// work when we added a multi-file shadow
finished = true;
}
else if (shadow->sdw_flags & (SDW_dumped))
@ -1252,9 +1251,8 @@ static bool add_shadow(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_tr
}
else
{
/* We cannot add a file to a shadow that is still
* in the process of being created.
*/
// We cannot add a file to a shadow that is still
// in the process of being created.
ERR_post(Arg::Gds(isc_no_meta_update) <<
Arg::Gds(isc_obj_in_use) << Arg::Str(dbb->dbb_filename));
}
@ -1269,14 +1267,13 @@ static bool add_shadow(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_tr
return false;
}
/* this file is part of a new shadow, so get all files for the shadow
in order of the starting page for the file */
// this file is part of a new shadow, so get all files for the shadow
// in order of the starting page for the file
/* Note that for a multi-file shadow, we have several pieces of
* work posted (one dfw_add_shadow for each file). Rather than
* trying to cancel the other pieces of work we ignore them
* when they arrive in this routine.
*/
// Note that for a multi-file shadow, we have several pieces of
// work posted (one dfw_add_shadow for each file). Rather than
// trying to cancel the other pieces of work we ignore them
// when they arrive in this routine.
sequence = 0;
min_page = 0;
@ -1288,8 +1285,8 @@ static bool add_shadow(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_tr
OVER RDB$SHADOW_NUMBER
WITH X.RDB$FILE_NAME EQ expanded_fname.c_str()
SORTED BY Y.RDB$FILE_START
/* for the first file, create a brand new shadow; for secondary
files that have a starting page specified, add a file */
// for the first file, create a brand new shadow; for secondary
// files that have a starting page specified, add a file
if (!sequence)
SDW_add(tdbb, Y.RDB$FILE_NAME, Y.RDB$SHADOW_NUMBER, Y.RDB$FILE_FLAGS);
else if (Y.RDB$FILE_START)
@ -1307,13 +1304,13 @@ static bool add_shadow(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_tr
}
if (!shadow)
BUGCHECK(203); /* msg 203 shadow block not found for extend file */
BUGCHECK(203); // msg 203 shadow block not found for extend file
min_page = MAX((min_page + 1), (ULONG) Y.RDB$FILE_START);
add_sequence = SDW_add_file(tdbb, Y.RDB$FILE_NAME, min_page, Y.RDB$SHADOW_NUMBER);
}
/* update the sequence number and bless the file entry as being good */
// update the sequence number and bless the file entry as being good
if (!sequence || (Y.RDB$FILE_START && add_sequence))
{
@ -1904,7 +1901,7 @@ static void check_dependencies(thread_db* tdbb,
if (!REQUEST(irq_ch_f_dpd))
REQUEST(irq_ch_f_dpd) = request;
/* If the found object is also being deleted, there's no dependency */
// If the found object is also being deleted, there's no dependency
if (!find_depend_in_dfw(tdbb, DEP.RDB$DEPENDENT_NAME, DEP.RDB$DEPENDENT_TYPE,
0, transaction))
@ -1930,7 +1927,7 @@ static void check_dependencies(thread_db* tdbb,
if (!REQUEST(irq_ch_dpd))
REQUEST(irq_ch_dpd) = request;
/* If the found object is also being deleted, there's no dependency */
// If the found object is also being deleted, there's no dependency
if (!find_depend_in_dfw(tdbb, DEP.RDB$DEPENDENT_NAME, DEP.RDB$DEPENDENT_TYPE,
0, transaction))
@ -1957,9 +1954,9 @@ static void check_dependencies(thread_db* tdbb,
fld_name.append(field_name);
ERR_post(Arg::Gds(isc_no_meta_update) <<
Arg::Gds(isc_no_delete) << /* Msg353: can not delete */
Arg::Gds(isc_no_delete) << // Msg353: can not delete
Arg::Gds(isc_field_name) << Arg::Str(fld_name) <<
Arg::Gds(isc_dependency) << Arg::Num(total)); /* Msg310: there are %ld dependencies */
Arg::Gds(isc_dependency) << Arg::Num(total)); // Msg310: there are %ld dependencies
}
else
{
@ -2003,9 +2000,9 @@ static void check_dependencies(thread_db* tdbb,
}
ERR_post(Arg::Gds(isc_no_meta_update) <<
Arg::Gds(isc_no_delete) << /* can not delete */
Arg::Gds(isc_no_delete) << // can not delete
Arg::Gds(obj_type) << Arg::Str(QualifiedName(dpdo_name, packageName).toString()) <<
Arg::Gds(isc_dependency) << Arg::Num(total)); /* there are %ld dependencies */
Arg::Gds(isc_dependency) << Arg::Num(total)); // there are %ld dependencies
}
}
@ -2029,7 +2026,7 @@ static void check_filename(const Firebird::string& name, bool shareExpand)
if (!valid || ISC_check_if_remote(file_name, shareExpand)) {
ERR_post(Arg::Gds(isc_no_meta_update) <<
Arg::Gds(isc_node_name_err));
/* Msg305: A node name is not permitted in a secondary, shadow, or log file name */
// Msg305: A node name is not permitted in a secondary, shadow, or log file name
}
if (!JRD_verify_database_access(file_name)) {
@ -2120,7 +2117,7 @@ static bool compute_security(thread_db* tdbb, SSHORT phase, DeferredWork* work,
case 3:
{
/* Get security class. This may return NULL if it doesn't exist */
// Get security class. This may return NULL if it doesn't exist
SecurityClass* s_class = SCL_recompute_class(tdbb, work->dfw_name.c_str());
@ -2266,11 +2263,11 @@ static bool create_index(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_
case 0:
handle = NULL;
/* Drop those indices at clean up time. */
// Drop those indices at clean up time.
FOR(REQUEST_HANDLE handle TRANSACTION_HANDLE transaction) IDXN IN RDB$INDICES CROSS
IREL IN RDB$RELATIONS OVER RDB$RELATION_NAME
WITH IDXN.RDB$INDEX_NAME EQ work->dfw_name.c_str()
/* Views do not have indices */
// Views do not have indices
if (IREL.RDB$VIEW_BLR.NULL)
{
relation = MET_lookup_relation(tdbb, IDXN.RDB$RELATION_NAME);
@ -2284,10 +2281,10 @@ static bool create_index(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_
const bool isTempIndex = (relation->rel_flags & REL_temp_conn) &&
(relPages->rel_instance_id != 0);
/* Fetch the root index page and mark MUST_WRITE, and then
delete the index. It will also clean the index slot. Note
that the previous fixed definition of MAX_IDX (64) has been
dropped in favor of a computed value saved in the Database */
// Fetch the root index page and mark MUST_WRITE, and then
// delete the index. It will also clean the index slot. Note
// that the previous fixed definition of MAX_IDX (64) has been
// dropped in favor of a computed value saved in the Database
if (relPages->rel_index_root)
{
if (work->dfw_id != dbb->dbb_max_idx)
@ -2366,7 +2363,7 @@ static bool create_index(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_
EXE_unwind(tdbb, request);
ERR_post(Arg::Gds(isc_no_meta_update) <<
Arg::Gds(isc_idx_create_err) << Arg::Str(work->dfw_name));
/* Msg308: can't create index %s */
// Msg308: can't create index %s
}
if (IDX.RDB$INDEX_ID && IDX.RDB$STATISTICS < 0.0)
{
@ -2423,13 +2420,13 @@ static bool create_index(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_
{
ERR_post(Arg::Gds(isc_no_meta_update) <<
Arg::Gds(isc_idx_seg_err) << Arg::Str(work->dfw_name));
/* Msg304: segment count of 0 defined for index %s */
// Msg304: segment count of 0 defined for index %s
}
else
{
ERR_post(Arg::Gds(isc_no_meta_update) <<
Arg::Gds(isc_idx_key_err) << Arg::Str(work->dfw_name));
/* Msg311: too many keys defined for index %s */
// Msg311: too many keys defined for index %s
}
}
if (IDX.RDB$UNIQUE_FLAG)
@ -2462,14 +2459,14 @@ static bool create_index(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_
{
ERR_post(Arg::Gds(isc_no_meta_update) <<
Arg::Gds(isc_idx_key_err) << Arg::Str(work->dfw_name));
/* Msg311: too many keys defined for index %s */
// Msg311: too many keys defined for index %s
}
else if (SEG.RDB$FIELD_POSITION > idx.idx_count)
{
fb_utils::exact_name(RFR.RDB$FIELD_NAME);
ERR_post(Arg::Gds(isc_no_meta_update) <<
Arg::Gds(isc_inval_key_posn) <<
/* Msg358: invalid key position */
// Msg358: invalid key position
Arg::Gds(isc_field_name) << Arg::Str(RFR.RDB$FIELD_NAME) <<
Arg::Gds(isc_index_name) << Arg::Str(work->dfw_name));
}
@ -2477,13 +2474,13 @@ static bool create_index(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_
{
ERR_post(Arg::Gds(isc_no_meta_update) <<
Arg::Gds(isc_blob_idx_err) << Arg::Str(work->dfw_name));
/* Msg350: attempt to index blob column in index %s */
// Msg350: attempt to index blob column in index %s
}
else
{
ERR_post(Arg::Gds(isc_no_meta_update) <<
Arg::Gds(isc_array_idx_err) << Arg::Str(work->dfw_name));
/* Msg351: attempt to index array column in index %s */
// Msg351: attempt to index array column in index %s
}
}
@ -2515,16 +2512,16 @@ static bool create_index(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_
{
ERR_post(Arg::Gds(isc_no_meta_update) <<
Arg::Gds(isc_key_field_err) << Arg::Str(work->dfw_name));
/* Msg352: too few key columns found for index %s (incorrect column name?) */
// Msg352: too few key columns found for index %s (incorrect column name?)
}
if (!relation)
{
ERR_post(Arg::Gds(isc_no_meta_update) <<
Arg::Gds(isc_idx_create_err) << Arg::Str(work->dfw_name));
/* Msg308: can't create index %s */
// Msg308: can't create index %s
}
/* Make sure the relation info is all current */
// Make sure the relation info is all current
MET_scan_relation(tdbb, relation);
@ -2532,10 +2529,10 @@ static bool create_index(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_
{
ERR_post(Arg::Gds(isc_no_meta_update) <<
Arg::Gds(isc_idx_create_err) << Arg::Str(work->dfw_name));
/* Msg308: can't create index %s */
// Msg308: can't create index %s
}
/* Actually create the index */
// Actually create the index
Lock *relationLock = NULL, *partnerLock = NULL;
bool releaseRelationLock = false, releasePartnerLock = false;
@ -2731,7 +2728,7 @@ static bool create_relation(thread_db* tdbb, SSHORT phase, DeferredWork* work, j
return true;
case 3:
/* Take a relation lock on rel id -1 before actually generating a relation id. */
// Take a relation lock on rel id -1 before actually generating a relation id.
work->dfw_lock = lock = FB_NEW_RPT(*tdbb->getDefaultPool(), sizeof(SLONG)) Lock;
lock->lck_dbb = dbb;
@ -2792,7 +2789,7 @@ static bool create_relation(thread_db* tdbb, SSHORT phase, DeferredWork* work, j
Y.RDB$DBKEY_LENGTH = 8;
else
{
/* update the dbkey length to include each of the base relations */
// update the dbkey length to include each of the base relations
handle = NULL;
Y.RDB$DBKEY_LENGTH = 0;
@ -2817,7 +2814,7 @@ static bool create_relation(thread_db* tdbb, SSHORT phase, DeferredWork* work, j
if (!REQUEST(irq_c_relation))
REQUEST(irq_c_relation) = request;
/* if this is not a view, create the relation */
// if this is not a view, create the relation
if (rel_id && blob_id.isEmpty() && !external_flag)
{
@ -2829,8 +2826,8 @@ static bool create_relation(thread_db* tdbb, SSHORT phase, DeferredWork* work, j
case 4:
/* get the relation and flag it to check for dependencies
in the view blr (if it exists) and any computed fields */
// get the relation and flag it to check for dependencies
// in the view blr (if it exists) and any computed fields
request = CMP_find_request(tdbb, irq_c_relation2, IRQ_REQUESTS);
@ -3332,7 +3329,7 @@ static bool delete_field(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_
switch (phase)
{
case 1:
/* Look up the field in RFR. If we can't find the field, go ahead with the delete. */
// Look up the field in RFR. If we can't find the field, go ahead with the delete.
handle = NULL;
field_count = 0;
@ -3342,7 +3339,7 @@ static bool delete_field(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_
REL IN RDB$RELATIONS
OVER RDB$RELATION_NAME
WITH RFR.RDB$FIELD_SOURCE EQ work->dfw_name.c_str()
/* If the rfr field is also being deleted, there's no dependency */
// If the rfr field is also being deleted, there's no dependency
if (!find_depend_in_dfw(tdbb, RFR.RDB$FIELD_NAME, obj_computed, REL.RDB$RELATION_ID,
transaction))
{
@ -3354,9 +3351,9 @@ static bool delete_field(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_
if (field_count)
{
ERR_post(Arg::Gds(isc_no_meta_update) <<
Arg::Gds(isc_no_delete) << /* Msg353: can not delete */
Arg::Gds(isc_no_delete) << // Msg353: can not delete
Arg::Gds(isc_domain_name) << Arg::Str(work->dfw_name) <<
Arg::Gds(isc_dependency) << Arg::Num(field_count)); /* Msg310: there are %ld dependencies */
Arg::Gds(isc_dependency) << Arg::Num(field_count)); // Msg310: there are %ld dependencies
}
check_dependencies(tdbb, work->dfw_name.c_str(), NULL, NULL, obj_field, transaction);
@ -3668,7 +3665,7 @@ static bool delete_index(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_
fb_assert(index->idl_count == 1);
if (!--index->idl_count)
{
/* Release index existence lock and memory. */
// Release index existence lock and memory.
for (IndexLock** ptr = &relation->rel_index_locks; *ptr; ptr = &(*ptr)->idl_next)
{
@ -3685,7 +3682,7 @@ static bool delete_index(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_
}
delete index;
/* Release index refresh lock and memory. */
// Release index refresh lock and memory.
for (IndexBlock** iptr = &relation->rel_index_blocks; *iptr; iptr = &(*iptr)->idb_next)
{
@ -3694,7 +3691,7 @@ static bool delete_index(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_
IndexBlock* index_block = *iptr;
*iptr = index_block->idb_next;
/* Lock was released in IDX_delete_index(). */
// Lock was released in IDX_delete_index().
delete index_block->idb_lock;
delete index_block;
@ -3807,8 +3804,8 @@ static bool delete_procedure(thread_db* tdbb, SSHORT phase, DeferredWork* work,
}
}
/* If we are in a multi-client server, someone else may have marked
procedure obsolete. Unmark and we will remark it later. */
// If we are in a multi-client server, someone else may have marked
// procedure obsolete. Unmark and we will remark it later.
procedure->prc_flags &= ~PRC_obsolete;
return true;
@ -3860,7 +3857,7 @@ static bool delete_procedure(thread_db* tdbb, SSHORT phase, DeferredWork* work,
procedure->prc_request = 0;
}
/* delete dependency lists */
// delete dependency lists
if (work->dfw_package.isEmpty())
MET_delete_dependencies(tdbb, work->dfw_name, obj_procedure, transaction);
@ -3949,7 +3946,7 @@ static bool delete_relation(thread_db* tdbb, SSHORT phase, DeferredWork* work, j
return false;
}
/* Let relation be deleted if only this transaction is using it */
// Let relation be deleted if only this transaction is using it
adjusted = false;
if (relation->rel_use_count == 1)
@ -3991,16 +3988,16 @@ static bool delete_relation(thread_db* tdbb, SSHORT phase, DeferredWork* work, j
return false;
}
/* Flag relation delete in progress so that active sweep or
garbage collector threads working on relation can skip over it. */
// Flag relation delete in progress so that active sweep or
// garbage collector threads working on relation can skip over it.
relation->rel_flags |= REL_deleting;
/* The sweep and garbage collector threads have no more than
a single record latency in responding to the flagged relation
deletion. Nevertheless, as a defensive programming measure,
don't wait forever if something has gone awry and the sweep
count doesn't run down. */
// The sweep and garbage collector threads have no more than
// a single record latency in responding to the flagged relation
// deletion. Nevertheless, as a defensive programming measure,
// don't wait forever if something has gone awry and the sweep
// count doesn't run down.
for (int wait = 0; wait < 60; wait++)
{
@ -4114,7 +4111,7 @@ static bool delete_rfr(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_tr
switch (phase)
{
case 1:
/* first check if there are any fields used explicitly by the view */
// first check if there are any fields used explicitly by the view
handle = NULL;
field_count = 0;
@ -4126,7 +4123,7 @@ static bool delete_rfr(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_tr
VFLD.RDB$VIEW_CONTEXT EQ VR.RDB$VIEW_CONTEXT AND
VFLD.RDB$RELATION_NAME EQ VR.RDB$VIEW_NAME AND
VFLD.RDB$BASE_FIELD EQ work->dfw_name.c_str()
/* If the view is also being deleted, there's no dependency */
// If the view is also being deleted, there's no dependency
if (!find_depend_in_dfw(tdbb, VR.RDB$VIEW_NAME, obj_view, 0, transaction))
{
f = VFLD.RDB$BASE_FIELD;
@ -4137,13 +4134,13 @@ static bool delete_rfr(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_tr
if (field_count)
ERR_post(Arg::Gds(isc_no_meta_update) <<
Arg::Gds(isc_no_delete) << /* Msg353: can not delete */
Arg::Gds(isc_no_delete) << // Msg353: can not delete
Arg::Gds(isc_field_name) << Arg::Str(f) <<
Arg::Gds(isc_dependency) << Arg::Num(field_count));
/* Msg310: there are %ld dependencies */
// Msg310: there are %ld dependencies
/* now check if there are any dependencies generated through the blr
that defines the relation */
// now check if there are any dependencies generated through the blr
// that defines the relation
if ( (relation = MET_lookup_relation_id(tdbb, work->dfw_id, false)) )
{
@ -4153,7 +4150,7 @@ static bool delete_rfr(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_tr
transaction);
}
/* see if the relation itself is being dropped */
// see if the relation itself is being dropped
handle = NULL;
rel_exists = 0;
@ -4164,7 +4161,7 @@ static bool delete_rfr(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_tr
if (handle)
CMP_release(tdbb, handle);
/* if table exists, check if this is the last column in the table */
// if table exists, check if this is the last column in the table
if (rel_exists)
{
@ -4186,7 +4183,7 @@ static bool delete_rfr(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_tr
{
ERR_post(Arg::Gds(isc_no_meta_update) <<
Arg::Gds(isc_del_last_field));
/* Msg354: last column in a relation cannot be deleted */
// Msg354: last column in a relation cannot be deleted
}
}
@ -4194,8 +4191,8 @@ static bool delete_rfr(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_tr
return true;
case 3:
/* Unlink field from data structures. Don't try to actually release field and
friends -- somebody may be pointing to them */
// Unlink field from data structures. Don't try to actually release field and
// friends -- somebody may be pointing to them
relation = MET_lookup_relation_id(tdbb, work->dfw_id, false);
if (relation)
@ -4270,7 +4267,7 @@ static bool delete_trigger(thread_db* tdbb, SSHORT phase, DeferredWork* work, jr
return true;
case 3:
/* get rid of dependencies */
// get rid of dependencies
MET_delete_dependencies(tdbb, work->dfw_name, obj_trigger, transaction);
return true;
@ -4539,12 +4536,12 @@ static void get_procedure_dependencies(DeferredWork* work, bool compile, jrd_tra
MET_verify_cache(tdbb);
#endif
/* get any dependencies now by parsing the blr */
// get any dependencies now by parsing the blr
if (procedure && !blob_id.isEmpty())
{
jrd_req* request = NULL;
/* Nickolay Samofatov: allocate statement memory pool... */
// Nickolay Samofatov: allocate statement memory pool...
MemoryPool* new_pool = dbb->createPool();
// block is used to ensure MET_verify_cache
// works in not deleted context
@ -4613,12 +4610,12 @@ static void get_trigger_dependencies(DeferredWork* work, bool compile, jrd_tra*
if (!REQUEST(irq_c_trigger))
REQUEST(irq_c_trigger) = handle;
/* get any dependencies now by parsing the blr */
// get any dependencies now by parsing the blr
if ((relation || (type & TRIGGER_TYPE_MASK) == TRIGGER_TYPE_DB) && !blob_id.isEmpty())
{
jrd_req* request = NULL;
/* Nickolay Samofatov: allocate statement memory pool... */
// Nickolay Samofatov: allocate statement memory pool...
MemoryPool* new_pool = dbb->createPool();
const USHORT par_flags = (USHORT) (type & 1) ? csb_pre_trigger : csb_post_trigger;
@ -4694,7 +4691,7 @@ static Format* make_format(thread_db* tdbb, jrd_rel* relation, USHORT* version,
SET_TDBB(tdbb);
Database* dbb = tdbb->getDatabase();
/* Figure out the highest field id and allocate a format block */
// Figure out the highest field id and allocate a format block
USHORT count = 0;
for (tfb = stack; tfb; tfb = tfb->tfb_next)
@ -4703,7 +4700,7 @@ static Format* make_format(thread_db* tdbb, jrd_rel* relation, USHORT* version,
Format* format = Format::newFormat(*dbb->dbb_permanent, count + 1);
format->fmt_version = version ? *version : 0;
/* Fill in the format block from the temporary field blocks */
// Fill in the format block from the temporary field blocks
for (tfb = stack; tfb; tfb = tfb->tfb_next)
{
@ -4731,7 +4728,7 @@ static Format* make_format(thread_db* tdbb, jrd_rel* relation, USHORT* version,
defRef.vlu_desc.dsc_address = (UCHAR*) &defRef.vlu_misc;
}
/* Compute the offsets of the various fields */
// Compute the offsets of the various fields
ULONG offset = FLAG_BYTES(count);
@ -4755,7 +4752,7 @@ static Format* make_format(thread_db* tdbb, jrd_rel* relation, USHORT* version,
format->fmt_length = (USHORT)offset;
/* Release the temporary field blocks */
// Release the temporary field blocks
while ( (tfb = stack) )
{
@ -4769,7 +4766,7 @@ static Format* make_format(thread_db* tdbb, jrd_rel* relation, USHORT* version,
ERR_post(Arg::Gds(isc_no_meta_update) <<
Arg::Gds(isc_rec_size_err) << Arg::Num(offset) <<
Arg::Gds(isc_table_name) << Arg::Str(relation->rel_name));
/* Msg361: new record size of %ld bytes is too big */
// Msg361: new record size of %ld bytes is too big
}
Format* old_format;
@ -4782,13 +4779,13 @@ static Format* make_format(thread_db* tdbb, jrd_rel* relation, USHORT* version,
return old_format;
}
/* Link the format block into the world */
// Link the format block into the world
vec<Format*>* vector = relation->rel_formats =
vec<Format*>::newVector(*dbb->dbb_permanent, relation->rel_formats, format->fmt_version + 1);
(*vector)[format->fmt_version] = format;
/* Store format in system relation */
// Store format in system relation
jrd_req* request = CMP_find_request(tdbb, irq_format3, IRQ_REQUESTS);
@ -4944,7 +4941,7 @@ static bool make_version(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_
ERR_post(Arg::Gds(isc_no_meta_update) <<
Arg::Gds(isc_table_name) << Arg::Str(work->dfw_name) <<
Arg::Gds(isc_version_err));
/* Msg357: too many versions */
// Msg357: too many versions
}
MODIFY REL USING
blb* blob = BLB_create(tdbb, transaction, &REL.RDB$RUNTIME);
@ -4956,7 +4953,7 @@ static bool make_version(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_
RFR.RDB$RELATION_NAME EQ work->dfw_name.c_str() AND
RFR.RDB$FIELD_SOURCE EQ FLD.RDB$FIELD_NAME
/* Update RFR to reflect new fields id */
// Update RFR to reflect new fields id
if (!RFR.RDB$FIELD_ID.NULL && RFR.RDB$FIELD_ID >= REL.RDB$FIELD_ID)
REL.RDB$FIELD_ID = RFR.RDB$FIELD_ID + 1;
@ -4976,11 +4973,11 @@ static bool make_version(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_
if (external_flag)
{
RFR.RDB$FIELD_ID = RFR.RDB$FIELD_POSITION;
/* RFR.RDB$FIELD_POSITION.NULL is
needed to be referenced in the
code somewhere for GPRE to include
this field in the structures that
it generates at the top of this func. */
// RFR.RDB$FIELD_POSITION.NULL is
// needed to be referenced in the
// code somewhere for GPRE to include
// this field in the structures that
// it generates at the top of this func.
RFR.RDB$FIELD_ID.NULL = RFR.RDB$FIELD_POSITION.NULL;
}
else
@ -5030,7 +5027,7 @@ static bool make_version(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_
END_MODIFY;
}
/* Store stuff in field summary */
// Store stuff in field summary
n = RFR.RDB$FIELD_ID;
put_summary_record(tdbb, blob, RSR_field_id, (UCHAR*)&n, sizeof(n));
@ -5070,7 +5067,7 @@ static bool make_version(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_
put_summary_record(tdbb, blob, RSR_security_class,
(UCHAR*) RFR.RDB$SECURITY_CLASS, n);
/* Make a temporary field block */
// Make a temporary field block
TemporaryField* tfb = FB_NEW(*tdbb->getDefaultPool()) TemporaryField;
tfb->tfb_next = stack;
@ -5137,13 +5134,13 @@ static bool make_version(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_
CMP_release(tdbb, defaultRequest);
}
/* for text data types, grab the CHARACTER_SET and
COLLATION to give the type of international text */
// for text data types, grab the CHARACTER_SET and
// COLLATION to give the type of international text
if (FLD.RDB$CHARACTER_SET_ID.NULL)
FLD.RDB$CHARACTER_SET_ID = CS_NONE;
SSHORT collation = COLLATE_NONE; /* codepoint collation */
SSHORT collation = COLLATE_NONE; // codepoint collation
if (!FLD.RDB$COLLATION_ID.NULL)
collation = FLD.RDB$COLLATION_ID;
if (!RFR.RDB$COLLATION_ID.NULL)
@ -5165,7 +5162,7 @@ static bool make_version(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_
Arg::Gds(isc_random) << Arg::Str(work->dfw_name));
}
/* Make sure the text type specified is implemented */
// Make sure the text type specified is implemented
if (!validate_text_type(tdbb, tfb))
{
EXE_unwind(tdbb, request_fmt1);
@ -5255,7 +5252,7 @@ static bool make_version(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_
if (!REQUEST(irq_format1))
REQUEST(irq_format1) = request_fmt1;
/* If we didn't find the relation, it is probably being dropped */
// If we didn't find the relation, it is probably being dropped
if (!relation) {
return false;
@ -5264,9 +5261,9 @@ static bool make_version(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_
if (!(relation->rel_flags & REL_sys_trigs_being_loaded))
load_trigs(tdbb, relation, triggers);
/* in case somebody changed the view definition or a computed
field, reset the dependencies by deleting the current ones
and setting a flag for MET_scan_relation to find the new ones */
// in case somebody changed the view definition or a computed
// field, reset the dependencies by deleting the current ones
// and setting a flag for MET_scan_relation to find the new ones
if (!null_view)
MET_delete_dependencies(tdbb, work->dfw_name, obj_view, transaction);
@ -5352,7 +5349,7 @@ static bool modify_procedure(thread_db* tdbb, SSHORT phase, DeferredWork* work,
if (procedure->prc_existence_lock)
{
/* Let procedure be deleted if only this transaction is using it */
// Let procedure be deleted if only this transaction is using it
if (!LCK_convert(tdbb, procedure->prc_existence_lock, LCK_EX, transaction->getLockWait()))
{
@ -5361,8 +5358,8 @@ static bool modify_procedure(thread_db* tdbb, SSHORT phase, DeferredWork* work,
}
}
/* If we are in a multi-client server, someone else may have marked
procedure obsolete. Unmark and we will remark it later. */
// If we are in a multi-client server, someone else may have marked
// procedure obsolete. Unmark and we will remark it later.
procedure->prc_flags &= ~PRC_obsolete;
return true;
@ -5392,7 +5389,7 @@ static bool modify_procedure(thread_db* tdbb, SSHORT phase, DeferredWork* work,
ERR_post(Arg::Gds(isc_no_meta_update) <<
Arg::Gds(isc_proc_name) << Arg::Str(name.toString()) <<
Arg::Gds(isc_version_err));
/* Msg357: too many versions */
// Msg357: too many versions
}
if (procedure->prc_existence_lock) {
@ -5417,13 +5414,13 @@ static bool modify_procedure(thread_db* tdbb, SSHORT phase, DeferredWork* work,
Arg::Gds(isc_obj_in_use) << Arg::Str(name.toString()));
}
/* release the request */
// release the request
CMP_release(tdbb, procedure->prc_request);
procedure->prc_request = 0;
}
/* delete dependency lists */
// delete dependency lists
if (work->dfw_package.isEmpty())
MET_delete_dependencies(tdbb, work->dfw_name, obj_procedure, transaction);
@ -5440,11 +5437,11 @@ static bool modify_procedure(thread_db* tdbb, SSHORT phase, DeferredWork* work,
LCK_release(tdbb, procedure->prc_existence_lock);
}
/* remove procedure from cache */
// remove procedure from cache
MET_remove_procedure(tdbb, work->dfw_id, NULL);
/* Now handle the new definition */
// Now handle the new definition
bool compile = !work->findArg(dfw_arg_check_blr);
get_procedure_dependencies(work, compile, transaction);
@ -5528,7 +5525,7 @@ static bool modify_trigger(thread_db* tdbb, SSHORT phase, DeferredWork* work, jr
{
bool compile = !work->findArg(dfw_arg_check_blr);
/* get rid of old dependencies, bring in the new */
// get rid of old dependencies, bring in the new
MET_delete_dependencies(tdbb, work->dfw_name, obj_trigger, transaction);
get_trigger_dependencies(work, compile, transaction);
}
@ -5901,7 +5898,7 @@ static blb* setup_triggers(thread_db* tdbb, jrd_rel* relation, bool null_view,
Database* dbb = tdbb->getDatabase();
/* system triggers */
// system triggers
jrd_req* request_fmtx = CMP_find_request(tdbb, irq_format4, IRQ_REQUESTS);
@ -5919,7 +5916,7 @@ static blb* setup_triggers(thread_db* tdbb, jrd_rel* relation, bool null_view,
REQUEST(irq_format4) = request_fmtx;
/* user triggers */
// user triggers
request_fmtx = CMP_find_request(tdbb, irq_format5, IRQ_REQUESTS);
@ -5945,9 +5942,9 @@ static blb* setup_triggers(thread_db* tdbb, jrd_rel* relation, bool null_view,
REQUEST(irq_format5) = request_fmtx;
/* check constraint triggers. We're looking for triggers that belong
to the table and are system triggers (i.e. system flag in (3, 4, 5))
or a user looking trigger that's involved in a check constraint */
// check constraint triggers. We're looking for triggers that belong
// to the table and are system triggers (i.e. system flag in (3, 4, 5))
// or a user looking trigger that's involved in a check constraint
request_fmtx = CMP_find_request(tdbb, irq_format6, IRQ_REQUESTS);

View File

@ -98,7 +98,7 @@
#include <ctype.h>
#endif
/* Pick up relation ids */
// Pick up relation ids
#include "../jrd/ini.h"
DATABASE DB = FILENAME "ODS.RDB";
@ -443,7 +443,7 @@ void MET_verify_cache(thread_db* tdbb)
}
}
/* Walk procedures and calculate internal dependencies */
// Walk procedures and calculate internal dependencies
for (ptr = procedures->begin(), end = procedures->end(); ptr < end; ptr++)
{
if ( (procedure = *ptr) && procedure->prc_request /*&&
@ -453,7 +453,7 @@ void MET_verify_cache(thread_db* tdbb)
}
}
/* Walk procedures again and check dependencies */
// Walk procedures again and check dependencies
for (ptr = procedures->begin(), end = procedures->end(); ptr < end; ptr++)
{
if ( (procedure = *ptr) && procedure->prc_request && /*
@ -490,7 +490,7 @@ void MET_verify_cache(thread_db* tdbb)
}
}
/* Fix back int_use_count */
// Fix back int_use_count
for (ptr = procedures->begin(), end = procedures->end(); ptr < end; ptr++)
{
if ( (procedure = *ptr) )
@ -550,7 +550,7 @@ void MET_clear_cache(thread_db* tdbb)
{
jrd_prc* procedure;
vec<jrd_prc*>::iterator ptr, end;
/* Walk procedures and calculate internal dependencies */
// Walk procedures and calculate internal dependencies
for (ptr = procedures->begin(), end = procedures->end(); ptr < end; ++ptr)
{
if ( (procedure = *ptr) && procedure->prc_request &&
@ -572,7 +572,7 @@ void MET_clear_cache(thread_db* tdbb)
}
}
/* Deallocate all used requests */
// Deallocate all used requests
for (ptr = procedures->begin(), end = procedures->end(); ptr < end; ptr++)
{
if ( (procedure = *ptr) )
@ -597,7 +597,7 @@ void MET_clear_cache(thread_db* tdbb)
}
}
/* Remove deallocated procedures from cache */
// Remove deallocated procedures from cache
for (ptr = procedures->begin(), end = procedures->end(); ptr < end; ptr++)
{
if ( (procedure = *ptr) && (procedure->prc_flags & PRC_obsolete) )
@ -658,7 +658,7 @@ bool MET_procedure_in_use(thread_db* tdbb, jrd_prc* proc)
jrd_prc* procedure;
vec<jrd_prc*>::iterator ptr, end;
/* Walk procedures and calculate internal dependencies */
// Walk procedures and calculate internal dependencies
for (ptr = procedures->begin(), end = procedures->end(); ptr < end; ++ptr)
{
if ((procedure = *ptr) && procedure->prc_request && !(procedure->prc_flags & PRC_obsolete))
@ -681,7 +681,7 @@ bool MET_procedure_in_use(thread_db* tdbb, jrd_prc* proc)
const bool result = proc->prc_use_count != proc->prc_int_use_count;
/* Fix back int_use_count */
// Fix back int_use_count
for (ptr = procedures->begin(), end = procedures->end(); ptr < end; ptr++)
{
if ( (procedure = *ptr) )
@ -715,7 +715,7 @@ void MET_activate_shadow(thread_db* tdbb)
SET_TDBB(tdbb);
Database* dbb = tdbb->getDatabase();
/* Erase any secondary files of the primary database of the shadow being activated. */
// Erase any secondary files of the primary database of the shadow being activated.
jrd_req* handle = NULL;
FOR(REQUEST_HANDLE handle) X IN RDB$FILES
@ -729,7 +729,7 @@ void MET_activate_shadow(thread_db* tdbb)
PageSpace* pageSpace = dbb->dbb_page_manager.findPageSpace(DB_PAGE_SPACE);
const char* dbb_file_name = pageSpace->file->fil_string;
/* go through files looking for any that expand to the current database name */
// go through files looking for any that expand to the current database name
SCHAR expanded_name[MAXPATHLEN];
jrd_req* handle2 = handle = NULL;
FOR(REQUEST_HANDLE handle) X IN RDB$FILES
@ -1094,7 +1094,7 @@ void MET_delete_shadow(thread_db* tdbb, USHORT shadow_number)
}
}
/* notify other processes to check for shadow deletion */
// notify other processes to check for shadow deletion
if (SDW_lck_update(tdbb, 0)) {
SDW_notify(tdbb);
}
@ -1303,7 +1303,7 @@ Format* MET_format(thread_db* tdbb, jrd_rel* relation, USHORT number)
format->fmt_version = number;
/* Link the format block into the world */
// Link the format block into the world
formats = relation->rel_formats =
vec<Format*>::newVector(*dbb->dbb_permanent, relation->rel_formats, number + 1);
@ -1345,8 +1345,8 @@ bool MET_get_char_coll_subtype(thread_db* tdbb, USHORT* id, const UCHAR* name, U
const UCHAR* const end_name = name + length;
/* Force key to uppercase, following C locale rules for uppercasing */
/* At the same time, search for the first period in the string (if any) */
// Force key to uppercase, following C locale rules for uppercasing
// At the same time, search for the first period in the string (if any)
UCHAR buffer[MAX_SQL_IDENTIFIER_SIZE]; // BASED ON RDB$COLLATION_NAME
UCHAR* p = buffer;
UCHAR* period = NULL;
@ -1359,19 +1359,19 @@ bool MET_get_char_coll_subtype(thread_db* tdbb, USHORT* id, const UCHAR* name, U
}
*p = 0;
/* Is there a period, separating collation name from character set? */
// Is there a period, separating collation name from character set?
if (period)
{
*period = 0;
return resolve_charset_and_collation(tdbb, id, period + 1, buffer);
}
/* Is it a character set name (implying charset default collation sequence) */
// Is it a character set name (implying charset default collation sequence)
bool res = resolve_charset_and_collation(tdbb, id, buffer, NULL);
if (!res)
{
/* Is it a collation name (implying implementation-default character set) */
// Is it a collation name (implying implementation-default character set)
res = resolve_charset_and_collation(tdbb, id, NULL, buffer);
}
return res;
@ -1590,9 +1590,9 @@ void MET_get_shadow_files(thread_db* tdbb, bool delete_files)
const USHORT file_flags = X.RDB$FILE_FLAGS;
SDW_start(tdbb, X.RDB$FILE_NAME, X.RDB$SHADOW_NUMBER, file_flags, delete_files);
/* if the shadow exists, mark the appropriate shadow
block as found for the purposes of this routine;
if the shadow was conditional and is no longer, note it */
// if the shadow exists, mark the appropriate shadow
// block as found for the purposes of this routine;
// if the shadow was conditional and is no longer, note it
for (Shadow* shadow = dbb->dbb_shadow; shadow; shadow = shadow->sdw_next)
{
@ -1610,8 +1610,8 @@ void MET_get_shadow_files(thread_db* tdbb, bool delete_files)
CMP_release(tdbb, handle);
/* if any current shadows were not defined in database, mark
them to be shutdown since they don't exist anymore */
// if any current shadows were not defined in database, mark
// them to be shutdown since they don't exist anymore
for (Shadow* shadow = dbb->dbb_shadow; shadow; shadow = shadow->sdw_next)
{
@ -1752,11 +1752,11 @@ void MET_load_trigger(thread_db* tdbb,
if (!REQUEST(irq_s_triggers))
REQUEST(irq_s_triggers) = trigger_request;
/* check if the trigger is to be fired without any permissions
checks. Verify such a claim */
// check if the trigger is to be fired without any permissions
// checks. Verify such a claim
USHORT trig_flags = (USHORT) TRG.RDB$FLAGS;
/* if there is an ignore permission flag, see if it is legit */
// if there is an ignore permission flag, see if it is legit
if ((TRG.RDB$FLAGS & TRG_ignore_perm) && !verify_TRG_ignore_perm(tdbb, trigger_name))
{
fb_msg_format(NULL, JRD_BUGCHK, 304, sizeof(errmsg),
@ -1895,10 +1895,10 @@ void MET_lookup_cnstrt_for_trigger(thread_db* tdbb,
jrd_req* request = CMP_find_request(tdbb, irq_l_check, IRQ_REQUESTS);
jrd_req* request2 = CMP_find_request(tdbb, irq_l_check2, IRQ_REQUESTS);
/* utilize two requests rather than one so that we
guarantee we always return the name of the relation
that the trigger is defined on, even if we don't
have a check constraint defined for that trigger */
// utilize two requests rather than one so that we
// guarantee we always return the name of the relation
// that the trigger is defined on, even if we don't
// have a check constraint defined for that trigger
FOR(REQUEST_HANDLE request)
Y IN RDB$TRIGGERS WITH
@ -1949,7 +1949,7 @@ void MET_lookup_exception(thread_db* tdbb,
SET_TDBB(tdbb);
Database* dbb = tdbb->getDatabase();
/* We need to look up exception in RDB$EXCEPTIONS */
// We need to look up exception in RDB$EXCEPTIONS
jrd_req* request = CMP_find_request(tdbb, irq_l_exception, IRQ_REQUESTS);
@ -2000,7 +2000,7 @@ SLONG MET_lookup_exception_number(thread_db* tdbb, const Firebird::MetaName& nam
SET_TDBB(tdbb);
Database* dbb = tdbb->getDatabase();
/* We need to look up exception in RDB$EXCEPTIONS */
// We need to look up exception in RDB$EXCEPTIONS
jrd_req* request = CMP_find_request(tdbb, irq_l_except_no, IRQ_REQUESTS);
@ -2046,7 +2046,7 @@ int MET_lookup_field(thread_db* tdbb,
SET_TDBB(tdbb);
Database* dbb = tdbb->getDatabase();
/* Start by checking field names that we already know */
// Start by checking field names that we already know
vec<jrd_fld*>* vector = relation->rel_fields;
if (vector)
@ -2075,7 +2075,7 @@ int MET_lookup_field(thread_db* tdbb,
}
}
/* Not found. Next, try system relations directly */
// Not found. Next, try system relations directly
int id = -1;
@ -2352,8 +2352,8 @@ bool MET_lookup_partner(thread_db* tdbb,
if (relation->rel_flags & REL_check_partners)
{
/* Prepare for rescan of foreign references on other relations'
primary keys and release stale vectors. */
// Prepare for rescan of foreign references on other relations'
// primary keys and release stale vectors.
jrd_req* request = CMP_find_request(tdbb, irq_foreign1, IRQ_REQUESTS);
frgn* references = &relation->rel_foreign_refs;
@ -2422,7 +2422,7 @@ bool MET_lookup_partner(thread_db* tdbb,
REQUEST(irq_foreign1) = request;
}
/* Prepare for rescan of primary dependencies on relation's primary key and stale vectors. */
// Prepare for rescan of primary dependencies on relation's primary key and stale vectors.
request = CMP_find_request(tdbb, irq_foreign2, IRQ_REQUESTS);
prim* dependencies = &relation->rel_primary_dpnds;
@ -2492,8 +2492,8 @@ bool MET_lookup_partner(thread_db* tdbb,
{
if (index_name)
{
/* Since primary key index names aren't being cached, do a long
hard lookup. This is only called during index create for foreign keys. */
// Since primary key index names aren't being cached, do a long
// hard lookup. This is only called during index create for foreign keys.
bool found = false;
jrd_req* request = NULL;
@ -2581,7 +2581,7 @@ jrd_prc* MET_lookup_procedure(thread_db* tdbb, const QualifiedName& name, bool n
Database* dbb = tdbb->getDatabase();
jrd_prc* check_procedure = NULL;
/* See if we already know the procedure by name */
// See if we already know the procedure by name
vec<jrd_prc*>* procedures = dbb->dbb_procedures;
if (procedures)
{
@ -2609,7 +2609,7 @@ jrd_prc* MET_lookup_procedure(thread_db* tdbb, const QualifiedName& name, bool n
}
}
/* We need to look up the procedure name in RDB$PROCEDURES */
// We need to look up the procedure name in RDB$PROCEDURES
jrd_prc* procedure = NULL;
@ -2681,7 +2681,7 @@ jrd_prc* MET_lookup_procedure_id(thread_db* tdbb, SSHORT id,
}
}
/* We need to look up the procedure name in RDB$PROCEDURES */
// We need to look up the procedure name in RDB$PROCEDURES
procedure = NULL;
@ -2730,7 +2730,7 @@ jrd_rel* MET_lookup_relation(thread_db* tdbb, const Firebird::MetaName& name)
SET_TDBB(tdbb);
Database* dbb = tdbb->getDatabase();
/* See if we already know the relation by name */
// See if we already know the relation by name
vec<jrd_rel*>* relations = dbb->dbb_relations;
jrd_rel* check_relation = NULL;
@ -2741,9 +2741,9 @@ jrd_rel* MET_lookup_relation(thread_db* tdbb, const Firebird::MetaName& name)
jrd_rel* relation = *ptr;
if (relation && !(relation->rel_flags & REL_deleted))
{
/* dimitr: for non-system relations we should also check
REL_scanned and REL_being_scanned flags. Look
at MET_lookup_procedure for example. */
// dimitr: for non-system relations we should also check
// REL_scanned and REL_being_scanned flags. Look
// at MET_lookup_procedure for example.
if (!(relation->rel_flags & REL_system) &&
(!(relation->rel_flags & REL_scanned) || (relation->rel_flags & REL_being_scanned)))
{
@ -2764,7 +2764,7 @@ jrd_rel* MET_lookup_relation(thread_db* tdbb, const Firebird::MetaName& name)
}
}
/* We need to look up the relation name in RDB$RELATIONS */
// We need to look up the relation name in RDB$RELATIONS
jrd_rel* relation = NULL;
@ -2820,7 +2820,7 @@ jrd_rel* MET_lookup_relation_id(thread_db* tdbb, SLONG id, bool return_deleted)
SET_TDBB(tdbb);
Database* dbb = tdbb->getDatabase();
/* System relations are above suspicion */
// System relations are above suspicion
if (id < (int) rel_MAX)
{
@ -2849,7 +2849,7 @@ jrd_rel* MET_lookup_relation_id(thread_db* tdbb, SLONG id, bool return_deleted)
}
}
/* We need to look up the relation id in RDB$RELATIONS */
// We need to look up the relation id in RDB$RELATIONS
relation = NULL;
@ -3562,8 +3562,8 @@ jrd_rel* MET_relation(thread_db* tdbb, USHORT id)
const USHORT major_version = dbb->dbb_ods_version;
const USHORT minor_version = dbb->dbb_minor_version;
/* From ODS 9 onwards, the first 128 relation IDS have been
reserved for system relations */
// From ODS 9 onwards, the first 128 relation IDS have been
// reserved for system relations
USHORT max_sys_rel;
if (ENCODE_ODS(major_version, minor_version) < ODS_9_0) {
max_sys_rel = USER_REL_INIT_ID_ODS8 - 1;
@ -3714,28 +3714,28 @@ void MET_remove_procedure(thread_db* tdbb, int id, jrd_prc* procedure)
if (!procedure)
{
/** If we are in here then dfw.epp/modify_procedure() called us **/
// If we are in here then dfw.epp/modify_procedure() called us
if (!(procedure = (*pvector)[id]))
return;
}
/* MET_procedure locks it. Lets unlock it now to avoid troubles later */
// MET_procedure locks it. Lets unlock it now to avoid troubles later
if (procedure->prc_existence_lock)
{
LCK_release(tdbb, procedure->prc_existence_lock);
}
/* Procedure that is being altered may have references
to it by other procedures via pointer to current meta
data structure, so don't loose the structure or the pointer. */
// Procedure that is being altered may have references
// to it by other procedures via pointer to current meta
// data structure, so don't loose the structure or the pointer.
if ((procedure == (*pvector)[id]) && !(procedure->prc_flags & PRC_being_altered))
{
(*pvector)[id] = NULL;
}
/* deallocate all structure which were allocated. The procedure
* blr is originally read into a new pool from which all request
* are allocated. That will not be freed up. */
// deallocate all structure which were allocated. The procedure
// blr is originally read into a new pool from which all request
// are allocated. That will not be freed up.
if (procedure->prc_existence_lock)
{
@ -3743,7 +3743,7 @@ void MET_remove_procedure(thread_db* tdbb, int id, jrd_prc* procedure)
procedure->prc_existence_lock = NULL;
}
/* deallocate input param structures */
// deallocate input param structures
vec<Parameter*>* vector;
if ((procedure->prc_inputs) && (vector = procedure->prc_input_fields))
{
@ -3759,7 +3759,7 @@ void MET_remove_procedure(thread_db* tdbb, int id, jrd_prc* procedure)
procedure->prc_input_fields = NULL;
}
/* deallocate output param structures */
// deallocate output param structures
if ((procedure->prc_outputs) && (vector = procedure->prc_output_fields))
{
@ -3820,7 +3820,7 @@ void MET_revoke(thread_db* tdbb,
SET_TDBB(tdbb);
Database* dbb = tdbb->getDatabase();
/* See if the revokee still has the privilege. If so, there's nothing to do */
// See if the revokee still has the privilege. If so, there's nothing to do
USHORT count = 0;
@ -3845,7 +3845,7 @@ void MET_revoke(thread_db* tdbb,
request = CMP_find_request(tdbb, irq_revoke2, IRQ_REQUESTS);
/* User lost privilege. Take it away from anybody he/she gave it to. */
// User lost privilege. Take it away from anybody he/she gave it to.
FOR(REQUEST_HANDLE request TRANSACTION_HANDLE transaction)
P IN RDB$USER_PRIVILEGES WITH
@ -3888,8 +3888,8 @@ void MET_scan_relation(thread_db* tdbb, jrd_rel* relation)
jrd_tra* depTrans = (tdbb->getTransaction() ? tdbb->getTransaction() : dbb->dbb_sys_trans);
/* If anything errors, catch it to reset the scan flag. This will
make sure that the error will be caught if the operation is tried again. */
// If anything errors, catch it to reset the scan flag. This will
// make sure that the error will be caught if the operation is tried again.
try {
@ -3909,14 +3909,14 @@ void MET_scan_relation(thread_db* tdbb, jrd_rel* relation)
triggers[itr] = NULL;
}
/* Since this can be called recursively, find an inactive clone of the request */
// Since this can be called recursively, find an inactive clone of the request
request = CMP_find_request(tdbb, irq_r_fields, IRQ_REQUESTS);
CompilerScratch* csb = NULL;
FOR(REQUEST_HANDLE request)
REL IN RDB$RELATIONS WITH REL.RDB$RELATION_ID EQ relation->rel_id
/* Pick up relation level stuff */
// Pick up relation level stuff
if (!REQUEST(irq_r_fields)) {
REQUEST(irq_r_fields) = request;
}
@ -3937,7 +3937,7 @@ void MET_scan_relation(thread_db* tdbb, jrd_rel* relation)
if (!REL.RDB$VIEW_BLR.isEmpty())
{
/* parse the view blr, getting dependencies on relations, etc. at the same time */
// parse the view blr, getting dependencies on relations, etc. at the same time
if (dependencies)
{
@ -3954,7 +3954,7 @@ void MET_scan_relation(thread_db* tdbb, jrd_rel* relation)
&REL.RDB$VIEW_BLR, &csb, NULL, false);
}
/* retrieve the view context names */
// retrieve the view context names
lookup_view_contexts(tdbb, relation);
}
@ -3965,7 +3965,7 @@ void MET_scan_relation(thread_db* tdbb, jrd_rel* relation)
EXT_file(relation, REL.RDB$EXTERNAL_FILE); //, &REL.RDB$EXTERNAL_DESCRIPTION);
}
/* Pick up field specific stuff */
// Pick up field specific stuff
blob = BLB_open(tdbb, dbb->dbb_sys_trans, &REL.RDB$RUNTIME);
Firebird::HalfStaticArray<UCHAR, 256> temp;
@ -4017,8 +4017,8 @@ void MET_scan_relation(thread_db* tdbb, jrd_rel* relation)
case RSR_field_name:
if (field)
{
/* The field exists. If its name hasn't changed, then
there's no need to copy anything. */
// The field exists. If its name hasn't changed, then
// there's no need to copy anything.
if (field->fld_name == reinterpret_cast<char*>(p))
break;
@ -4113,7 +4113,7 @@ void MET_scan_relation(thread_db* tdbb, jrd_rel* relation)
memcpy(&array->arr_desc, p, length);
break;
default: /* Shut up compiler warning */
default: // Shut up compiler warning
break;
}
}
@ -4172,20 +4172,19 @@ void MET_scan_relation(thread_db* tdbb, jrd_rel* relation)
REQUEST(irq_r_type) = sub_request;
}
/* release any triggers in case of a rescan, but not if the rescan
hapenned while system triggers were being loaded. */
// release any triggers in case of a rescan, but not if the rescan
// hapenned while system triggers were being loaded.
if (!(relation->rel_flags & REL_sys_trigs_being_loaded))
{
/* if we are scanning a system relation during loading the system
triggers, (during parsing its blr actually), we must not release the
existing system triggers; because we have already set the
relation->rel_flag to not have REL_sys_trig, so these
system triggers will not get loaded again. This fixes bug 8149. */
// if we are scanning a system relation during loading the system
// triggers, (during parsing its blr actually), we must not release the
// existing system triggers; because we have already set the
// relation->rel_flag to not have REL_sys_trig, so these
// system triggers will not get loaded again. This fixes bug 8149.
/* We have just loaded the triggers onto the local vector triggers.
Its now time to place them at their rightful place ie the relation
block. */
// We have just loaded the triggers onto the local vector triggers.
// Its now time to place them at their rightful place ie the relation block.
trig_vec* tmp_vector;
@ -4595,7 +4594,7 @@ static bool get_type(thread_db* tdbb, USHORT* id, const UCHAR* name, const TEXT*
fb_assert(name != NULL);
fb_assert(field != NULL);
/* Force key to uppercase, following C locale rules for uppercase */
// Force key to uppercase, following C locale rules for uppercase
UCHAR* p;
for (p = buffer; *name && p < buffer + sizeof(buffer) - 1; p++, name++)
{
@ -4603,7 +4602,7 @@ static bool get_type(thread_db* tdbb, USHORT* id, const UCHAR* name, const TEXT*
}
*p = 0;
/* Try for exact name match */
// Try for exact name match
bool found = false;
@ -5132,8 +5131,8 @@ static bool resolve_charset_and_collation(thread_db* tdbb,
return true;
}
/* Charset name not found in the alias table - before giving up
try the character_set table */
// Charset name not found in the alias table - before giving up
// try the character_set table
FOR(REQUEST_HANDLE handle)
FIRST 1 CS IN RDB$CHARACTER_SETS