mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 03:23:04 +01:00
Fixed CORE-4950 - Statistics for any system index can not be updated/recalculated.
This commit is contained in:
parent
4aaec01eb4
commit
9769499937
@ -9462,7 +9462,7 @@ bool SetStatisticsNode::checkPermission(thread_db* tdbb, jrd_tra* transaction)
|
||||
dsc dscName;
|
||||
dscName.makeText(relationName.length(), CS_METADATA, (UCHAR*) relationName.c_str());
|
||||
|
||||
SCL_check_relation(tdbb, &dscName, SCL_alter);
|
||||
SCL_check_relation(tdbb, &dscName, SCL_alter, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -543,10 +543,13 @@ void INI_format(const char* owner, const char* charset)
|
||||
|
||||
length = acl - buffer;
|
||||
|
||||
add_security_to_sys_rel(tdbb, ownerName, "RDB$ROLES", length, buffer);
|
||||
add_security_to_sys_rel(tdbb, ownerName, "RDB$PAGES", length, buffer);
|
||||
// DFW writes here
|
||||
add_security_to_sys_rel(tdbb, ownerName, "RDB$FORMATS", length, buffer);
|
||||
for (const int* relfld = relfields; relfld[RFLD_R_NAME]; relfld = fld + 1)
|
||||
{
|
||||
for (rdbFieldId = 0, fld = relfld + RFLD_RPT; fld[RFLD_F_NAME]; fld += RFLD_F_LENGTH)
|
||||
++rdbFieldId;
|
||||
|
||||
add_security_to_sys_rel(tdbb, ownerName, names[relfld[RFLD_R_NAME]], length, buffer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -759,7 +759,8 @@ void SCL_check_filter(thread_db* tdbb, const MetaName &name, SecurityClass::flag
|
||||
}
|
||||
|
||||
|
||||
void SCL_check_relation(thread_db* tdbb, const dsc* dsc_name, SecurityClass::flags_t mask)
|
||||
void SCL_check_relation(thread_db* tdbb, const dsc* dsc_name, SecurityClass::flags_t mask,
|
||||
bool protectSys)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -788,7 +789,7 @@ void SCL_check_relation(thread_db* tdbb, const dsc* dsc_name, SecurityClass::fla
|
||||
FOR(REQUEST_HANDLE request) REL IN RDB$RELATIONS
|
||||
WITH REL.RDB$RELATION_NAME EQ name.c_str()
|
||||
{
|
||||
if (REL.RDB$SYSTEM_FLAG == 1 && !attachment->isRWGbak())
|
||||
if (protectSys && REL.RDB$SYSTEM_FLAG == 1 && !attachment->isRWGbak())
|
||||
{
|
||||
// Someone is going to modify system table layout
|
||||
// Usually it's not good idea
|
||||
|
@ -48,7 +48,7 @@ void SCL_check_package(Jrd::thread_db* tdbb, const dsc*, Jrd::SecurityClass::fla
|
||||
void SCL_check_procedure(Jrd::thread_db* tdbb, const dsc*, Jrd::SecurityClass::flags_t);
|
||||
void SCL_check_function(Jrd::thread_db* tdbb, const dsc*, Jrd::SecurityClass::flags_t);
|
||||
void SCL_check_filter(Jrd::thread_db* tdbb, const Firebird::MetaName &name, Jrd::SecurityClass::flags_t);
|
||||
void SCL_check_relation(Jrd::thread_db* tdbb, const dsc*, Jrd::SecurityClass::flags_t);
|
||||
void SCL_check_relation(Jrd::thread_db* tdbb, const dsc*, Jrd::SecurityClass::flags_t, bool protectSys = true);
|
||||
void SCL_check_view(Jrd::thread_db* tdbb, const dsc*, Jrd::SecurityClass::flags_t);
|
||||
void SCL_check_role(Jrd::thread_db* tdbb, const Firebird::MetaName&, Jrd::SecurityClass::flags_t);
|
||||
Jrd::SecurityClass* SCL_get_class(Jrd::thread_db*, const TEXT*);
|
||||
|
@ -2758,7 +2758,7 @@ void VIO_modify(thread_db* tdbb, record_param* org_rpb, record_param* new_rpb, j
|
||||
case rel_indices:
|
||||
protect_system_table_delupd(tdbb, relation, "UPDATE");
|
||||
EVL_field(0, new_rpb->rpb_record, f_idx_relation, &desc1);
|
||||
SCL_check_relation(tdbb, &desc1, SCL_control);
|
||||
SCL_check_relation(tdbb, &desc1, SCL_control, false);
|
||||
|
||||
if (dfw_should_know(org_rpb, new_rpb, f_idx_desc, true))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user