Commit
9406884af19e2620a14059e64d4eb6ab430ab328 cleaned up
column-privilege related leaks in various error-message paths, but ended
up including a few more things than it should have in the back branches.
Specifically, there's no need for the GetModifiedColumns macro in
execMain.c as 9.1 and older didn't include the row in check constraint
violations. Further, the regression tests added to check those cases
aren't necessary.
This patch removes the GetModifiedColumns macro from execMain.c, removes
the comment which was added to trigger.c related to the duplicate macro
definition, and removes the check-constraint-related regression tests.
Pointed out by Robert.
Back-patched to 9.1 and 9.0.
int SessionReplicationRole = SESSION_REPLICATION_ROLE_ORIGIN;
-/*
- * Note that this macro also exists in executor/execMain.c. There does not
- * appear to be any good header to put it into, given the structures that
- * it uses, so we let them be duplicated. Be sure to update both if one needs
- * to be changed, however.
- */
#define GetModifiedColumns(relinfo, estate) \
(rt_fetch((relinfo)->ri_RangeTableIndex, (estate)->es_range_table)->modifiedCols)
static void intorel_shutdown(DestReceiver *self);
static void intorel_destroy(DestReceiver *self);
-/*
- * Note that this macro also exists in commands/trigger.c. There does not
- * appear to be any good header to put it into, given the structures that
- * it uses, so we let them be duplicated. Be sure to update both if one needs
- * to be changed, however.
- */
-#define GetModifiedColumns(relinfo, estate) \
- (rt_fetch((relinfo)->ri_RangeTableIndex, (estate)->es_range_table)->modifiedCols)
-
/* end of local decls */
ERROR: duplicate key value violates unique constraint "t1_pkey"
UPDATE t1 SET c2 = 1; -- fail, but row not shown
ERROR: duplicate key value violates unique constraint "t1_pkey"
-INSERT INTO t1 (c1, c2) VALUES (null, null); -- fail, but see columns being inserted
-ERROR: null value in column "c1" violates not-null constraint
-INSERT INTO t1 (c3) VALUES (null); -- fail, but see columns being inserted or have SELECT
-ERROR: null value in column "c1" violates not-null constraint
-INSERT INTO t1 (c1) VALUES (5); -- fail, but see columns being inserted or have SELECT
-ERROR: null value in column "c2" violates not-null constraint
-UPDATE t1 SET c3 = 10; -- fail, but see columns with SELECT rights, or being modified
-ERROR: new row for relation "t1" violates check constraint "t1_c3_check"
SET SESSION AUTHORIZATION regressuser1;
DROP TABLE t1;
-- test column-level privileges when involved with DELETE
SET SESSION AUTHORIZATION regressuser2;
INSERT INTO t1 (c1, c2) VALUES (1, 1); -- fail, but row not shown
UPDATE t1 SET c2 = 1; -- fail, but row not shown
-INSERT INTO t1 (c1, c2) VALUES (null, null); -- fail, but see columns being inserted
-INSERT INTO t1 (c3) VALUES (null); -- fail, but see columns being inserted or have SELECT
-INSERT INTO t1 (c1) VALUES (5); -- fail, but see columns being inserted or have SELECT
-UPDATE t1 SET c3 = 10; -- fail, but see columns with SELECT rights, or being modified
SET SESSION AUTHORIZATION regressuser1;
DROP TABLE t1;