!3614 修复缺陷:执行grant select (prosrc) on pg_proc to test后,数据库宕机
Merge pull request !3614 from 午月/fix_bug
This commit is contained in:
@ -6095,6 +6095,15 @@ void simple_heap_update(Relation relation, ItemPointer otid, HeapTuple tup)
|
||||
errmsg("All built-in functions are hard coded, and they should not be updated.")));
|
||||
}
|
||||
|
||||
/* All attribute of system table columns are hard coded, and thus they should not be updated */
|
||||
if (u_sess->attr.attr_common.IsInplaceUpgrade == false && IsAttributeRelation(relation)) {
|
||||
Oid attrelid = ((Form_pg_attribute)GETSTRUCT(tup))->attrelid;
|
||||
if (IsSystemObjOid(attrelid)) {
|
||||
ereport(ERROR, (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
|
||||
errmsg("All attribute of system table columns are hard coded, and they should not be updated.")));
|
||||
}
|
||||
}
|
||||
|
||||
result = heap_update(relation,
|
||||
NULL,
|
||||
otid,
|
||||
|
||||
@ -1134,3 +1134,8 @@ DROP TABLE gtest1;
|
||||
DROP TABLE gtest2;
|
||||
DROP TABLE gtest3;
|
||||
DROP TABLE gtest10;
|
||||
CREATE USER grant_attr_user1 PASSWORD 'gauss@123';
|
||||
GRANT select (prosrc) on pg_proc to grant_attr_user1;
|
||||
ERROR: All attribute of system table columns are hard coded, and they should not be updated.
|
||||
revoke select (prosrc) on pg_proc from grant_attr_user1;
|
||||
drop user grant_attr_user1 cascade;
|
||||
|
||||
@ -669,3 +669,8 @@ DROP TABLE gtest2;
|
||||
DROP TABLE gtest3;
|
||||
DROP TABLE gtest10;
|
||||
|
||||
|
||||
CREATE USER grant_attr_user1 PASSWORD 'gauss@123';
|
||||
GRANT select (prosrc) on pg_proc to grant_attr_user1;
|
||||
revoke select (prosrc) on pg_proc from grant_attr_user1;
|
||||
drop user grant_attr_user1 cascade;
|
||||
Reference in New Issue
Block a user