Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2ed7ef9

Browse files
committed
Minor cleanup of column-level priv fix
Commit9406884 cleaned upcolumn-privilege related leaks in various error-message paths, but endedup including a few more things than it should have in the back branches.Specifically, there's no need for the GetModifiedColumns macro inexecMain.c as 9.1 and older didn't include the row in check constraintviolations. Further, the regression tests added to check those casesaren't necessary.This patch removes the GetModifiedColumns macro from execMain.c, removesthe comment which was added to trigger.c related to the duplicate macrodefinition, and removes the check-constraint-related regression tests.Pointed out by Robert.Back-patched to 9.1 and 9.0.
1 parente48ce4f commit2ed7ef9

File tree

4 files changed

+0
-27
lines changed

4 files changed

+0
-27
lines changed

‎src/backend/commands/trigger.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,6 @@
5858
intSessionReplicationRole=SESSION_REPLICATION_ROLE_ORIGIN;
5959

6060

61-
/*
62-
* Note that this macro also exists in executor/execMain.c. There does not
63-
* appear to be any good header to put it into, given the structures that
64-
* it uses, so we let them be duplicated. Be sure to update both if one needs
65-
* to be changed, however.
66-
*/
6761
#defineGetModifiedColumns(relinfo,estate) \
6862
(rt_fetch((relinfo)->ri_RangeTableIndex, (estate)->es_range_table)->modifiedCols)
6963

‎src/backend/executor/execMain.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,6 @@ static void intorel_receive(TupleTableSlot *slot, DestReceiver *self);
8585
staticvoidintorel_shutdown(DestReceiver*self);
8686
staticvoidintorel_destroy(DestReceiver*self);
8787

88-
/*
89-
* Note that this macro also exists in commands/trigger.c. There does not
90-
* appear to be any good header to put it into, given the structures that
91-
* it uses, so we let them be duplicated. Be sure to update both if one needs
92-
* to be changed, however.
93-
*/
94-
#defineGetModifiedColumns(relinfo,estate) \
95-
(rt_fetch((relinfo)->ri_RangeTableIndex, (estate)->es_range_table)->modifiedCols)
96-
9788
/* end of local decls */
9889

9990

‎src/test/regress/expected/privileges.out

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -380,14 +380,6 @@ INSERT INTO t1 (c1, c2) VALUES (1, 1); -- fail, but row not shown
380380
ERROR: duplicate key value violates unique constraint "t1_pkey"
381381
UPDATE t1 SET c2 = 1; -- fail, but row not shown
382382
ERROR: duplicate key value violates unique constraint "t1_pkey"
383-
INSERT INTO t1 (c1, c2) VALUES (null, null); -- fail, but see columns being inserted
384-
ERROR: null value in column "c1" violates not-null constraint
385-
INSERT INTO t1 (c3) VALUES (null); -- fail, but see columns being inserted or have SELECT
386-
ERROR: null value in column "c1" violates not-null constraint
387-
INSERT INTO t1 (c1) VALUES (5); -- fail, but see columns being inserted or have SELECT
388-
ERROR: null value in column "c2" violates not-null constraint
389-
UPDATE t1 SET c3 = 10; -- fail, but see columns with SELECT rights, or being modified
390-
ERROR: new row for relation "t1" violates check constraint "t1_c3_check"
391383
SET SESSION AUTHORIZATION regressuser1;
392384
DROP TABLE t1;
393385
-- test column-level privileges when involved with DELETE

‎src/test/regress/sql/privileges.sql

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,6 @@ INSERT INTO t1 VALUES (3, 1, 3);
255255
SET SESSION AUTHORIZATION regressuser2;
256256
INSERT INTO t1 (c1, c2)VALUES (1,1);-- fail, but row not shown
257257
UPDATE t1SET c2=1;-- fail, but row not shown
258-
INSERT INTO t1 (c1, c2)VALUES (null,null);-- fail, but see columns being inserted
259-
INSERT INTO t1 (c3)VALUES (null);-- fail, but see columns being inserted or have SELECT
260-
INSERT INTO t1 (c1)VALUES (5);-- fail, but see columns being inserted or have SELECT
261-
UPDATE t1SET c3=10;-- fail, but see columns with SELECT rights, or being modified
262258

263259
SET SESSION AUTHORIZATION regressuser1;
264260
DROPTABLE t1;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp