8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 23:23:04 +01:00
This commit is contained in:
robocop 2006-11-10 08:12:07 +00:00
parent 3434a833f2
commit 7a46dc7247
5 changed files with 39 additions and 37 deletions

View File

@ -2051,22 +2051,22 @@ trigger_active : ACTIVE
trigger_type
: trigger_type_prefix trigger_type_suffix
{ $$ = MAKE_trigger_type ($1, $2); }
{ $$ = MAKE_trigger_type ($1, $2); }
| ON trigger_db_type
{ $$ = $2; }
{ $$ = $2; }
;
trigger_db_type
: CONNECT
{ $$ = MAKE_constant ((dsql_str*) (TRIGGER_TYPE_DB | DB_TRIGGER_CONNECT), CONSTANT_SLONG); }
{ $$ = MAKE_constant ((dsql_str*) (TRIGGER_TYPE_DB | DB_TRIGGER_CONNECT), CONSTANT_SLONG); }
| DISCONNECT
{ $$ = MAKE_constant ((dsql_str*) (TRIGGER_TYPE_DB | DB_TRIGGER_DISCONNECT), CONSTANT_SLONG); }
{ $$ = MAKE_constant ((dsql_str*) (TRIGGER_TYPE_DB | DB_TRIGGER_DISCONNECT), CONSTANT_SLONG); }
| TRANSACTION START
{ $$ = MAKE_constant ((dsql_str*) (TRIGGER_TYPE_DB | DB_TRIGGER_TRANS_START), CONSTANT_SLONG); }
{ $$ = MAKE_constant ((dsql_str*) (TRIGGER_TYPE_DB | DB_TRIGGER_TRANS_START), CONSTANT_SLONG); }
| TRANSACTION COMMIT
{ $$ = MAKE_constant ((dsql_str*) (TRIGGER_TYPE_DB | DB_TRIGGER_TRANS_COMMIT), CONSTANT_SLONG); }
{ $$ = MAKE_constant ((dsql_str*) (TRIGGER_TYPE_DB | DB_TRIGGER_TRANS_COMMIT), CONSTANT_SLONG); }
| TRANSACTION ROLLBACK
{ $$ = MAKE_constant ((dsql_str*) (TRIGGER_TYPE_DB | DB_TRIGGER_TRANS_ROLLBACK), CONSTANT_SLONG); }
{ $$ = MAKE_constant ((dsql_str*) (TRIGGER_TYPE_DB | DB_TRIGGER_TRANS_ROLLBACK), CONSTANT_SLONG); }
;
trigger_type_prefix : BEFORE

View File

@ -118,8 +118,9 @@ SLONG API_ROUTINE_VARARG isc_event_block(UCHAR** event_buffer,
const char* q = va_arg(ptr, SCHAR *);
/* Strip the blanks from the ends */
const char* end;
for (end = q + strlen(q); --end >= q && *end == ' ';);
const char* end = q + strlen(q);
while (--end >= q && *end == ' ')
;
*p++ = end - q + 1;
while (q <= end)
*p++ = *q++;
@ -164,8 +165,9 @@ const int MAX_NAME_LENGTH = 31;
const TEXT* const q = *nb++;
/* Strip trailing blanks from string */
const char* end;
for (end = q + MAX_NAME_LENGTH; --end >= q && *end == ' ';);
const char* end = q + MAX_NAME_LENGTH;
while (--end >= q && *end == ' ')
;
length += end - q + 1 + 5;
}
@ -197,8 +199,9 @@ const int MAX_NAME_LENGTH = 31;
const TEXT* q = *nb++;
/* Strip trailing blanks from string */
const char* end;
for (end = q + MAX_NAME_LENGTH; --end >= q && *end == ' ';);
const char* end = q + MAX_NAME_LENGTH;
while (--end >= q && *end == ' ')
;
*p++ = end - q + 1;
while (q <= end)
*p++ = *q++;

View File

@ -2117,7 +2117,7 @@ static bool create_trigger(thread_db* tdbb, SSHORT phase, DeferredWork* work,
case 4:
{
DeferredWork* arg = work->dfw_args;
const DeferredWork* arg = work->dfw_args;
while (arg && (arg->dfw_type != dfw_arg_rel_name))
arg = arg->dfw_next;
@ -2698,7 +2698,7 @@ static bool delete_parameter( thread_db* tdbb,
case 1:
/* hvlad: temporary disable procedure parameters dependency check
until proper solution (something like dyn_mod_parameter)
will be implemented. This check was never worked properly
will be implemented. This check never worked properly
so no harm is done
if (MET_lookup_procedure_id(tdbb, work->dfw_id, false, true, 0))
@ -3255,7 +3255,7 @@ static bool delete_trigger( thread_db* tdbb,
case 4:
{
DeferredWork* arg = work->dfw_args;
const DeferredWork* arg = work->dfw_args;
while (arg && (arg->dfw_type != dfw_arg_rel_name))
arg = arg->dfw_next;
@ -3329,7 +3329,7 @@ static bool find_depend_in_dfw( thread_db* tdbb,
/* Look to see if an object of the desired type is being deleted. */
for (DeferredWork* work = transaction->tra_deferred_work; work;
for (const DeferredWork* work = transaction->tra_deferred_work; work;
work = work->dfw_next)
{
if ((work->dfw_type == dfw_type ||
@ -4339,7 +4339,7 @@ static bool modify_trigger(thread_db* tdbb, SSHORT phase, DeferredWork* work,
case 3:
{
DeferredWork* arg = work->dfw_args;
const DeferredWork* arg = work->dfw_args;
while (arg && (arg->dfw_type != dfw_arg_rel_name))
arg = arg->dfw_next;
@ -4681,8 +4681,7 @@ static void release_protect_lock(thread_db* tdbb, jrd_tra* transaction, Lock* re
vec<Lock*>* vector = transaction->tra_relation_locks;
if (vector) {
vec<Lock*>::iterator lock = vector->begin();
for (ULONG i = 0; i < vector->count();
++i, ++lock)
for (ULONG i = 0; i < vector->count(); ++i, ++lock)
{
if (*lock == relLock)
{

View File

@ -499,7 +499,7 @@ void EXE_execute_db_triggers(thread_db* tdbb,
* Execute database triggers
*
**************************************/
// do nothing if user don't want database triggers
// do nothing if user doesn't want database triggers
if (tdbb->tdbb_attachment->att_flags & ATT_no_db_triggers)
return;

View File

@ -6173,25 +6173,25 @@ static bool rollback(thread_db* tdbb,
check_database(tdbb, transaction->tra_attachment, status_vector);
try {
if (!(tdbb->tdbb_attachment->att_flags & ATT_no_db_triggers))
{
ISC_STATUS_ARRAY temp_status = {0};
tdbb->tdbb_status_vector = temp_status;
try
if (!(tdbb->tdbb_attachment->att_flags & ATT_no_db_triggers))
{
EXE_execute_db_triggers(tdbb, transaction, jrd_req::req_trigger_trans_rollback);
}
catch (const Firebird::Exception&)
{
}
}
ISC_STATUS_ARRAY temp_status = {0};
tdbb->tdbb_status_vector = temp_status;
tdbb->tdbb_status_vector = status_vector;
try
{
EXE_execute_db_triggers(tdbb, transaction, jrd_req::req_trigger_trans_rollback);
}
catch (const Firebird::Exception&)
{
}
}
TRA_rollback(tdbb, transaction, retaining_flag, false);
Database* dbb = tdbb->tdbb_database;
--dbb->dbb_use_count;
tdbb->tdbb_status_vector = status_vector;
TRA_rollback(tdbb, transaction, retaining_flag, false);
Database* dbb = tdbb->tdbb_database;
--dbb->dbb_use_count;
} // try
catch (const Firebird::Exception& ex) {