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

Commita950fb0

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 (commit76f412a), 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 parentfcc3665 commita950fb0

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,23 +16,23 @@ 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 comments
3030
COMMENT ON OPERATOR ###### (int4, NONE) IS 'bad right unary';
3131
ERROR: operator does not exist: integer ######
3232
-- => is disallowed now
3333
CREATE OPERATOR => (
3434
leftarg = int8,-- right unary
35-
procedure =numeric_fac
35+
procedure =factorial
3636
);
3737
ERROR: syntax error at or near "=>"
3838
LINE 1: CREATE OPERATOR => (
@@ -42,7 +42,7 @@ LINE 1: CREATE OPERATOR => (
4242
-- this is legal because ! is not allowed in sql ops
4343
CREATE OPERATOR !=- (
4444
leftarg = int8,-- right unary
45-
procedure =numeric_fac
45+
procedure =factorial
4646
);
4747
SELECT 2 !=-;
4848
?column?
@@ -120,23 +120,23 @@ REVOKE USAGE ON SCHEMA schema_op1 FROM regress_rol_op1;
120120
SET ROLE regress_rol_op1;
121121
CREATE OPERATOR schema_op1.#*# (
122122
leftarg = int8,-- right unary
123-
procedure =numeric_fac
123+
procedure =factorial
124124
);
125125
ERROR: permission denied for schema schema_op1
126126
ROLLBACK;
127127
-- Should fail. SETOF type functions not allowed as argument (testing leftarg)
128128
BEGIN TRANSACTION;
129129
CREATE OPERATOR #*# (
130130
leftarg = SETOF int8,
131-
procedure =numeric_fac
131+
procedure =factorial
132132
);
133133
ERROR: SETOF type not allowed for operator argument
134134
ROLLBACK;
135135
-- Should fail. SETOF type functions not allowed as argument (testing rightarg)
136136
BEGIN TRANSACTION;
137137
CREATE OPERATOR #*# (
138138
rightarg = SETOF int8,
139-
procedure =numeric_fac
139+
procedure =factorial
140140
);
141141
ERROR: SETOF type not allowed for operator argument
142142
ROLLBACK;
@@ -160,13 +160,13 @@ ROLLBACK;
160160
-- Should fail. Invalid attribute
161161
CREATE OPERATOR #@%# (
162162
leftarg = int8,-- right unary
163-
procedure =numeric_fac,
163+
procedure =factorial,
164164
invalid_att = int8
165165
);
166166
WARNING: operator attribute "invalid_att" not recognized
167167
-- Should fail. At least leftarg or rightarg should be mandatorily specified
168168
CREATE OPERATOR #@%# (
169-
procedure =numeric_fac
169+
procedure =factorial
170170
);
171171
ERROR: at least one of leftarg or rightarg must be specified
172172
-- 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 comments
@@ -38,7 +38,7 @@ COMMENT ON OPERATOR ###### (int4, NONE) IS 'bad right unary';
3838
-- => is disallowed now
3939
CREATE OPERATOR=> (
4040
leftarg= int8,-- right unary
41-
procedure=numeric_fac
41+
procedure=factorial
4242
);
4343

4444
-- lexing of <=, >=, <>, != has a number of edge cases
@@ -47,7 +47,7 @@ CREATE OPERATOR => (
4747
-- this is legal because ! is not allowed in sql ops
4848
CREATE OPERATOR!=- (
4949
leftarg= int8,-- right unary
50-
procedure=numeric_fac
50+
procedure=factorial
5151
);
5252
SELECT2!=-;
5353
-- make sure lexer returns != as <> even in edge cases
@@ -81,7 +81,7 @@ REVOKE USAGE ON SCHEMA schema_op1 FROM regress_rol_op1;
8181
SET ROLE regress_rol_op1;
8282
CREATEOPERATORschema_op1.#*# (
8383
leftarg= int8,-- right unary
84-
procedure=numeric_fac
84+
procedure=factorial
8585
);
8686
ROLLBACK;
8787

@@ -90,7 +90,7 @@ ROLLBACK;
9090
BEGIN TRANSACTION;
9191
CREATE OPERATOR#*# (
9292
leftarg= SETOF int8,
93-
procedure=numeric_fac
93+
procedure=factorial
9494
);
9595
ROLLBACK;
9696

@@ -99,7 +99,7 @@ ROLLBACK;
9999
BEGIN TRANSACTION;
100100
CREATE OPERATOR#*# (
101101
rightarg= SETOF int8,
102-
procedure=numeric_fac
102+
procedure=factorial
103103
);
104104
ROLLBACK;
105105

@@ -125,13 +125,13 @@ ROLLBACK;
125125
-- Should fail. Invalid attribute
126126
CREATE OPERATOR#@%# (
127127
leftarg= int8,-- right unary
128-
procedure=numeric_fac,
128+
procedure=factorial,
129129
invalid_att= int8
130130
);
131131

132132
-- Should fail. At least leftarg or rightarg should be mandatorily specified
133133
CREATE OPERATOR#@%# (
134-
procedure=numeric_fac
134+
procedure=factorial
135135
);
136136

137137
-- Should fail. Procedure should be mandatorily specified

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp