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

Commitcfc14b2

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 parent64e0458 commitcfc14b2

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
@@ -60,12 +60,6 @@
6060
intSessionReplicationRole=SESSION_REPLICATION_ROLE_ORIGIN;
6161

6262

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

‎src/backend/executor/execMain.c

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

98-
/*
99-
* Note that this macro also exists in commands/trigger.c. There does not
100-
* appear to be any good header to put it into, given the structures that
101-
* it uses, so we let them be duplicated. Be sure to update both if one needs
102-
* to be changed, however.
103-
*/
104-
#defineGetModifiedColumns(relinfo,estate) \
105-
(rt_fetch((relinfo)->ri_RangeTableIndex, (estate)->es_range_table)->modifiedCols)
106-
10798
/* end of local decls */
10899

109100

‎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