Minor cleanup of column-level priv fix

Commit 9406884af1 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.
This commit is contained in:
Stephen Frost 2015-02-17 15:36:51 -05:00
parent e48ce4f33d
commit 2ed7ef9219
4 changed files with 0 additions and 27 deletions

View File

@ -58,12 +58,6 @@
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)

View File

@ -85,15 +85,6 @@ static void intorel_receive(TupleTableSlot *slot, DestReceiver *self);
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 */

View File

@ -380,14 +380,6 @@ INSERT INTO t1 (c1, c2) VALUES (1, 1); -- fail, but row not shown
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

View File

@ -255,10 +255,6 @@ INSERT INTO t1 VALUES (3, 1, 3);
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;