mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 10:03:03 +01:00
Restored the old alter-in-use logic upon customer requests.
This commit is contained in:
parent
eb8bcb8d32
commit
9d2b718bba
@ -2798,10 +2798,23 @@ static bool delete_procedure( thread_db* tdbb,
|
|||||||
|
|
||||||
// Do not allow to drop procedure used by user requests
|
// Do not allow to drop procedure used by user requests
|
||||||
if (procedure->prc_use_count && MET_procedure_in_use(tdbb, procedure))
|
if (procedure->prc_use_count && MET_procedure_in_use(tdbb, procedure))
|
||||||
|
{
|
||||||
|
/*
|
||||||
ERR_post(isc_no_meta_update,
|
ERR_post(isc_no_meta_update,
|
||||||
isc_arg_gds, isc_obj_in_use,
|
isc_arg_gds, isc_obj_in_use,
|
||||||
isc_arg_string, ERR_cstring(work->dfw_name),
|
isc_arg_string, ERR_cstring(work->dfw_name),
|
||||||
0);
|
0);
|
||||||
|
*/
|
||||||
|
gds__log("Deleting procedure %s which is currently in use by active user requests",
|
||||||
|
work->dfw_name);
|
||||||
|
MET_delete_dependencies(tdbb, work->dfw_name, obj_procedure);
|
||||||
|
|
||||||
|
if (procedure->prc_existence_lock) {
|
||||||
|
LCK_release(tdbb, procedure->prc_existence_lock);
|
||||||
|
}
|
||||||
|
(*tdbb->tdbb_database->dbb_procedures)[procedure->prc_id] = NULL;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
old_flags = procedure->prc_flags;
|
old_flags = procedure->prc_flags;
|
||||||
procedure->prc_flags |= PRC_obsolete;
|
procedure->prc_flags |= PRC_obsolete;
|
||||||
@ -4200,10 +4213,45 @@ static bool modify_procedure( thread_db* tdbb,
|
|||||||
#endif /* SUPERSERVER */
|
#endif /* SUPERSERVER */
|
||||||
// Do not allow to modify procedure used by user requests
|
// Do not allow to modify procedure used by user requests
|
||||||
if (procedure->prc_use_count && MET_procedure_in_use(tdbb, procedure))
|
if (procedure->prc_use_count && MET_procedure_in_use(tdbb, procedure))
|
||||||
|
{
|
||||||
|
/*
|
||||||
ERR_post(isc_no_meta_update,
|
ERR_post(isc_no_meta_update,
|
||||||
isc_arg_gds, isc_obj_in_use,
|
isc_arg_gds, isc_obj_in_use,
|
||||||
isc_arg_string, ERR_cstring(work->dfw_name),
|
isc_arg_string, ERR_cstring(work->dfw_name),
|
||||||
0);
|
0);
|
||||||
|
*/
|
||||||
|
gds__log("Modifying procedure %s which is currently in use by active user requests",
|
||||||
|
work->dfw_name);
|
||||||
|
|
||||||
|
USHORT prc_alter_count = procedure->prc_alter_count;
|
||||||
|
if (prc_alter_count > MAX_PROC_ALTER)
|
||||||
|
{
|
||||||
|
ERR_post(isc_no_meta_update,
|
||||||
|
isc_arg_gds, isc_proc_name,
|
||||||
|
isc_arg_string, ERR_cstring(work->dfw_name),
|
||||||
|
isc_arg_gds, isc_version_err,
|
||||||
|
0);
|
||||||
|
/* Msg357: too many versions */
|
||||||
|
}
|
||||||
|
|
||||||
|
if (procedure->prc_existence_lock) {
|
||||||
|
LCK_release(tdbb, procedure->prc_existence_lock);
|
||||||
|
}
|
||||||
|
(*tdbb->tdbb_database->dbb_procedures)[procedure->prc_id] = NULL;
|
||||||
|
|
||||||
|
if (!(procedure = MET_lookup_procedure_id(tdbb,
|
||||||
|
work->dfw_id,
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
PRC_being_altered)))
|
||||||
|
{
|
||||||
|
#ifdef SUPERSERVER
|
||||||
|
THD_rec_mutex_unlock(&tdbb->tdbb_database->dbb_sp_rec_mutex);
|
||||||
|
#endif
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
procedure->prc_alter_count = ++prc_alter_count;
|
||||||
|
}
|
||||||
|
|
||||||
procedure->prc_flags |= PRC_being_altered;
|
procedure->prc_flags |= PRC_being_altered;
|
||||||
if (procedure->prc_request)
|
if (procedure->prc_request)
|
||||||
|
@ -631,9 +631,7 @@ public:
|
|||||||
Lock* prc_existence_lock; // existence lock, if any
|
Lock* prc_existence_lock; // existence lock, if any
|
||||||
Firebird::MetaName prc_security_name; // security class name for procedure
|
Firebird::MetaName prc_security_name; // security class name for procedure
|
||||||
Firebird::MetaName prc_name; // ascic name
|
Firebird::MetaName prc_name; // ascic name
|
||||||
// No. of times the procedure was altered
|
USHORT prc_alter_count; // No. of times the procedure was altered
|
||||||
// It's shown in internal debug code in jrd.cpp but it's never incremented.
|
|
||||||
//USHORT prc_alter_count;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit jrd_prc(MemoryPool& p) : prc_security_name(p), prc_name(p) {}
|
explicit jrd_prc(MemoryPool& p) : prc_security_name(p), prc_name(p) {}
|
||||||
@ -654,7 +652,7 @@ const USHORT PRC_being_altered = 64; // Procedure is getting altered
|
|||||||
// invalidating procedure pointers from other parts of metadata cache
|
// invalidating procedure pointers from other parts of metadata cache
|
||||||
const USHORT PRC_check_existence = 128; // Existence lock released
|
const USHORT PRC_check_existence = 128; // Existence lock released
|
||||||
|
|
||||||
//const USHORT MAX_PROC_ALTER = 64; // No. of times an in-cache procedure can be altered
|
const USHORT MAX_PROC_ALTER = 64; // No. of times an in-cache procedure can be altered
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user