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

Commit9ab5ed4

Browse files
committed
Use factorial rather than numeric_fac in create_operator.sql.
These two SQL functions are aliases for the same C function, so thischange has no semantic effect. However, because we dropped thenumeric_fac alias in HEAD (commit 76f412ab3), operator definitionsbased on that one don't port forward, causing problems for cross-versionupgrade tests based on the regression database.Patch all active back branches to dodge the problem.Discussion:https://postgr.es/m/449144.1600439950@sss.pgh.pa.us
1 parentf083afa commit9ab5ed4

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ CREATE OPERATOR <% (
1616
);
1717
CREATE OPERATOR @#@ (
1818
rightarg = int8,-- left unary
19-
procedure =numeric_fac
19+
procedure =factorial
2020
);
2121
CREATE OPERATOR #@# (
2222
leftarg = int8,-- right unary
23-
procedure =numeric_fac
23+
procedure =factorial
2424
);
2525
CREATE OPERATOR #%# (
2626
leftarg = int8,-- right unary
27-
procedure =numeric_fac
27+
procedure =factorial
2828
);
2929
-- Test operator created above
3030
SELECT point '(1,2)' <% widget '(0,0,3)' AS t,
@@ -40,7 +40,7 @@ ERROR: operator does not exist: integer ######
4040
-- => is disallowed now
4141
CREATE OPERATOR => (
4242
leftarg = int8,-- right unary
43-
procedure =numeric_fac
43+
procedure =factorial
4444
);
4545
ERROR: syntax error at or near "=>"
4646
LINE 1: CREATE OPERATOR => (
@@ -50,7 +50,7 @@ LINE 1: CREATE OPERATOR => (
5050
-- this is legal because ! is not allowed in sql ops
5151
CREATE OPERATOR !=- (
5252
leftarg = int8,-- right unary
53-
procedure =numeric_fac
53+
procedure =factorial
5454
);
5555
SELECT 2 !=-;
5656
?column?
@@ -128,23 +128,23 @@ REVOKE USAGE ON SCHEMA schema_op1 FROM regress_rol_op1;
128128
SET ROLE regress_rol_op1;
129129
CREATE OPERATOR schema_op1.#*# (
130130
leftarg = int8,-- right unary
131-
procedure =numeric_fac
131+
procedure =factorial
132132
);
133133
ERROR: permission denied for schema schema_op1
134134
ROLLBACK;
135135
-- Should fail. SETOF type functions not allowed as argument (testing leftarg)
136136
BEGIN TRANSACTION;
137137
CREATE OPERATOR #*# (
138138
leftarg = SETOF int8,
139-
procedure =numeric_fac
139+
procedure =factorial
140140
);
141141
ERROR: SETOF type not allowed for operator argument
142142
ROLLBACK;
143143
-- Should fail. SETOF type functions not allowed as argument (testing rightarg)
144144
BEGIN TRANSACTION;
145145
CREATE OPERATOR #*# (
146146
rightarg = SETOF int8,
147-
procedure =numeric_fac
147+
procedure =factorial
148148
);
149149
ERROR: SETOF type not allowed for operator argument
150150
ROLLBACK;
@@ -168,13 +168,13 @@ ROLLBACK;
168168
-- Should fail. Invalid attribute
169169
CREATE OPERATOR #@%# (
170170
leftarg = int8,-- right unary
171-
procedure =numeric_fac,
171+
procedure =factorial,
172172
invalid_att = int8
173173
);
174174
WARNING: operator attribute "invalid_att" not recognized
175175
-- Should fail. At least leftarg or rightarg should be mandatorily specified
176176
CREATE OPERATOR #@%# (
177-
procedure =numeric_fac
177+
procedure =factorial
178178
);
179179
ERROR: at least one of leftarg or rightarg must be specified
180180
-- Should fail. Procedure should be mandatorily specified

‎src/test/regress/sql/create_operator.sql

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@ CREATE OPERATOR <% (
1919

2020
CREATE OPERATOR @#@ (
2121
rightarg= int8,-- left unary
22-
procedure=numeric_fac
22+
procedure=factorial
2323
);
2424

2525
CREATE OPERATOR#@# (
2626
leftarg= int8,-- right unary
27-
procedure=numeric_fac
27+
procedure=factorial
2828
);
2929

3030
CREATE OPERATOR#%# (
3131
leftarg= int8,-- right unary
32-
procedure=numeric_fac
32+
procedure=factorial
3333
);
3434

3535
-- Test operator created above
@@ -42,7 +42,7 @@ COMMENT ON OPERATOR ###### (int4, NONE) IS 'bad right unary';
4242
-- => is disallowed now
4343
CREATE OPERATOR=> (
4444
leftarg= int8,-- right unary
45-
procedure=numeric_fac
45+
procedure=factorial
4646
);
4747

4848
-- lexing of <=, >=, <>, != has a number of edge cases
@@ -51,7 +51,7 @@ CREATE OPERATOR => (
5151
-- this is legal because ! is not allowed in sql ops
5252
CREATE OPERATOR!=- (
5353
leftarg= int8,-- right unary
54-
procedure=numeric_fac
54+
procedure=factorial
5555
);
5656
SELECT2!=-;
5757
-- make sure lexer returns != as <> even in edge cases
@@ -85,7 +85,7 @@ REVOKE USAGE ON SCHEMA schema_op1 FROM regress_rol_op1;
8585
SET ROLE regress_rol_op1;
8686
CREATEOPERATORschema_op1.#*# (
8787
leftarg= int8,-- right unary
88-
procedure=numeric_fac
88+
procedure=factorial
8989
);
9090
ROLLBACK;
9191

@@ -94,7 +94,7 @@ ROLLBACK;
9494
BEGIN TRANSACTION;
9595
CREATE OPERATOR#*# (
9696
leftarg= SETOF int8,
97-
procedure=numeric_fac
97+
procedure=factorial
9898
);
9999
ROLLBACK;
100100

@@ -103,7 +103,7 @@ ROLLBACK;
103103
BEGIN TRANSACTION;
104104
CREATE OPERATOR#*# (
105105
rightarg= SETOF int8,
106-
procedure=numeric_fac
106+
procedure=factorial
107107
);
108108
ROLLBACK;
109109

@@ -129,13 +129,13 @@ ROLLBACK;
129129
-- Should fail. Invalid attribute
130130
CREATE OPERATOR#@%# (
131131
leftarg= int8,-- right unary
132-
procedure=numeric_fac,
132+
procedure=factorial,
133133
invalid_att= int8
134134
);
135135

136136
-- Should fail. At least leftarg or rightarg should be mandatorily specified
137137
CREATE OPERATOR#@%# (
138-
procedure=numeric_fac
138+
procedure=factorial
139139
);
140140

141141
-- Should fail. Procedure should be mandatorily specified

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp