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

Fixed CORE-4950 - Statistics for any system index can not be updated/recalculated.

This commit is contained in:
asfernandes 2015-10-02 17:30:09 +00:00
parent 4aaec01eb4
commit 9769499937
5 changed files with 13 additions and 9 deletions

View File

@ -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;
}

View File

@ -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);
}
}

View File

@ -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

View File

@ -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*);

View File

@ -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))
{