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

Commit65a9138

Browse files
committed
Use CallerFInfoFunctionCall with btree_gist for varlena types
Follow up to commit 393bb504d7 which did this for numeric types.
1 parent4b1c68d commit65a9138

File tree

6 files changed

+100
-97
lines changed

6 files changed

+100
-97
lines changed

‎contrib/btree_gist/btree_bit.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,47 +24,47 @@ PG_FUNCTION_INFO_V1(gbt_bit_same);
2424
/* define for comparison */
2525

2626
staticbool
27-
gbt_bitgt(constvoid*a,constvoid*b,Oidcollation)
27+
gbt_bitgt(constvoid*a,constvoid*b,Oidcollation,FmgrInfo*flinfo)
2828
{
2929
returnDatumGetBool(DirectFunctionCall2(bitgt,
3030
PointerGetDatum(a),
3131
PointerGetDatum(b)));
3232
}
3333

3434
staticbool
35-
gbt_bitge(constvoid*a,constvoid*b,Oidcollation)
35+
gbt_bitge(constvoid*a,constvoid*b,Oidcollation,FmgrInfo*flinfo)
3636
{
3737
returnDatumGetBool(DirectFunctionCall2(bitge,
3838
PointerGetDatum(a),
3939
PointerGetDatum(b)));
4040
}
4141

4242
staticbool
43-
gbt_biteq(constvoid*a,constvoid*b,Oidcollation)
43+
gbt_biteq(constvoid*a,constvoid*b,Oidcollation,FmgrInfo*flinfo)
4444
{
4545
returnDatumGetBool(DirectFunctionCall2(biteq,
4646
PointerGetDatum(a),
4747
PointerGetDatum(b)));
4848
}
4949

5050
staticbool
51-
gbt_bitle(constvoid*a,constvoid*b,Oidcollation)
51+
gbt_bitle(constvoid*a,constvoid*b,Oidcollation,FmgrInfo*flinfo)
5252
{
5353
returnDatumGetBool(DirectFunctionCall2(bitle,
5454
PointerGetDatum(a),
5555
PointerGetDatum(b)));
5656
}
5757

5858
staticbool
59-
gbt_bitlt(constvoid*a,constvoid*b,Oidcollation)
59+
gbt_bitlt(constvoid*a,constvoid*b,Oidcollation,FmgrInfo*flinfo)
6060
{
6161
returnDatumGetBool(DirectFunctionCall2(bitlt,
6262
PointerGetDatum(a),
6363
PointerGetDatum(b)));
6464
}
6565

6666
staticint32
67-
gbt_bitcmp(constvoid*a,constvoid*b,Oidcollation)
67+
gbt_bitcmp(constvoid*a,constvoid*b,Oidcollation,FmgrInfo*flinfo)
6868
{
6969
returnDatumGetInt32(DirectFunctionCall2(byteacmp,
7070
PointerGetDatum(a),
@@ -92,7 +92,7 @@ gbt_bit_xfrm(bytea *leaf)
9292

9393

9494
staticGBT_VARKEY*
95-
gbt_bit_l2n(GBT_VARKEY*leaf)
95+
gbt_bit_l2n(GBT_VARKEY*leaf,FmgrInfo*flinfo)
9696
{
9797
GBT_VARKEY*out=leaf;
9898
GBT_VARKEY_Rr=gbt_var_key_readable(leaf);
@@ -152,13 +152,13 @@ gbt_bit_consistent(PG_FUNCTION_ARGS)
152152

153153
if (GIST_LEAF(entry))
154154
retval=gbt_var_consistent(&r,query,strategy,PG_GET_COLLATION(),
155-
TRUE,&tinfo);
155+
TRUE,&tinfo,fcinfo->flinfo);
156156
else
157157
{
158158
bytea*q=gbt_bit_xfrm((bytea*)query);
159159

160160
retval=gbt_var_consistent(&r,q,strategy,PG_GET_COLLATION(),
161-
FALSE,&tinfo);
161+
FALSE,&tinfo,fcinfo->flinfo);
162162
}
163163
PG_RETURN_BOOL(retval);
164164
}
@@ -172,7 +172,7 @@ gbt_bit_union(PG_FUNCTION_ARGS)
172172
int32*size= (int*)PG_GETARG_POINTER(1);
173173

174174
PG_RETURN_POINTER(gbt_var_union(entryvec,size,PG_GET_COLLATION(),
175-
&tinfo));
175+
&tinfo,fcinfo->flinfo));
176176
}
177177

178178

@@ -183,7 +183,7 @@ gbt_bit_picksplit(PG_FUNCTION_ARGS)
183183
GIST_SPLITVEC*v= (GIST_SPLITVEC*)PG_GETARG_POINTER(1);
184184

185185
gbt_var_picksplit(entryvec,v,PG_GET_COLLATION(),
186-
&tinfo);
186+
&tinfo,fcinfo->flinfo);
187187
PG_RETURN_POINTER(v);
188188
}
189189

@@ -194,7 +194,7 @@ gbt_bit_same(PG_FUNCTION_ARGS)
194194
Datumd2=PG_GETARG_DATUM(1);
195195
bool*result= (bool*)PG_GETARG_POINTER(2);
196196

197-
*result=gbt_var_same(d1,d2,PG_GET_COLLATION(),&tinfo);
197+
*result=gbt_var_same(d1,d2,PG_GET_COLLATION(),&tinfo,fcinfo->flinfo);
198198
PG_RETURN_POINTER(result);
199199
}
200200

@@ -207,5 +207,5 @@ gbt_bit_penalty(PG_FUNCTION_ARGS)
207207
float*result= (float*)PG_GETARG_POINTER(2);
208208

209209
PG_RETURN_POINTER(gbt_var_penalty(result,o,n,PG_GET_COLLATION(),
210-
&tinfo));
210+
&tinfo,fcinfo->flinfo));
211211
}

‎contrib/btree_gist/btree_bytea.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,47 +23,47 @@ PG_FUNCTION_INFO_V1(gbt_bytea_same);
2323
/* define for comparison */
2424

2525
staticbool
26-
gbt_byteagt(constvoid*a,constvoid*b,Oidcollation)
26+
gbt_byteagt(constvoid*a,constvoid*b,Oidcollation,FmgrInfo*flinfo)
2727
{
2828
returnDatumGetBool(DirectFunctionCall2(byteagt,
2929
PointerGetDatum(a),
3030
PointerGetDatum(b)));
3131
}
3232

3333
staticbool
34-
gbt_byteage(constvoid*a,constvoid*b,Oidcollation)
34+
gbt_byteage(constvoid*a,constvoid*b,Oidcollation,FmgrInfo*flinfo)
3535
{
3636
returnDatumGetBool(DirectFunctionCall2(byteage,
3737
PointerGetDatum(a),
3838
PointerGetDatum(b)));
3939
}
4040

4141
staticbool
42-
gbt_byteaeq(constvoid*a,constvoid*b,Oidcollation)
42+
gbt_byteaeq(constvoid*a,constvoid*b,Oidcollation,FmgrInfo*flinfo)
4343
{
4444
returnDatumGetBool(DirectFunctionCall2(byteaeq,
4545
PointerGetDatum(a),
4646
PointerGetDatum(b)));
4747
}
4848

4949
staticbool
50-
gbt_byteale(constvoid*a,constvoid*b,Oidcollation)
50+
gbt_byteale(constvoid*a,constvoid*b,Oidcollation,FmgrInfo*flinfo)
5151
{
5252
returnDatumGetBool(DirectFunctionCall2(byteale,
5353
PointerGetDatum(a),
5454
PointerGetDatum(b)));
5555
}
5656

5757
staticbool
58-
gbt_bytealt(constvoid*a,constvoid*b,Oidcollation)
58+
gbt_bytealt(constvoid*a,constvoid*b,Oidcollation,FmgrInfo*flinfo)
5959
{
6060
returnDatumGetBool(DirectFunctionCall2(bytealt,
6161
PointerGetDatum(a),
6262
PointerGetDatum(b)));
6363
}
6464

6565
staticint32
66-
gbt_byteacmp(constvoid*a,constvoid*b,Oidcollation)
66+
gbt_byteacmp(constvoid*a,constvoid*b,Oidcollation,FmgrInfo*flinfo)
6767
{
6868
returnDatumGetInt32(DirectFunctionCall2(byteacmp,
6969
PointerGetDatum(a),
@@ -118,7 +118,7 @@ gbt_bytea_consistent(PG_FUNCTION_ARGS)
118118
*recheck= false;
119119

120120
retval=gbt_var_consistent(&r,query,strategy,PG_GET_COLLATION(),
121-
GIST_LEAF(entry),&tinfo);
121+
GIST_LEAF(entry),&tinfo,fcinfo->flinfo);
122122
PG_RETURN_BOOL(retval);
123123
}
124124

@@ -131,7 +131,7 @@ gbt_bytea_union(PG_FUNCTION_ARGS)
131131
int32*size= (int*)PG_GETARG_POINTER(1);
132132

133133
PG_RETURN_POINTER(gbt_var_union(entryvec,size,PG_GET_COLLATION(),
134-
&tinfo));
134+
&tinfo,fcinfo->flinfo));
135135
}
136136

137137

@@ -142,7 +142,7 @@ gbt_bytea_picksplit(PG_FUNCTION_ARGS)
142142
GIST_SPLITVEC*v= (GIST_SPLITVEC*)PG_GETARG_POINTER(1);
143143

144144
gbt_var_picksplit(entryvec,v,PG_GET_COLLATION(),
145-
&tinfo);
145+
&tinfo,fcinfo->flinfo);
146146
PG_RETURN_POINTER(v);
147147
}
148148

@@ -153,7 +153,7 @@ gbt_bytea_same(PG_FUNCTION_ARGS)
153153
Datumd2=PG_GETARG_DATUM(1);
154154
bool*result= (bool*)PG_GETARG_POINTER(2);
155155

156-
*result=gbt_var_same(d1,d2,PG_GET_COLLATION(),&tinfo);
156+
*result=gbt_var_same(d1,d2,PG_GET_COLLATION(),&tinfo,fcinfo->flinfo);
157157
PG_RETURN_POINTER(result);
158158
}
159159

@@ -166,5 +166,5 @@ gbt_bytea_penalty(PG_FUNCTION_ARGS)
166166
float*result= (float*)PG_GETARG_POINTER(2);
167167

168168
PG_RETURN_POINTER(gbt_var_penalty(result,o,n,PG_GET_COLLATION(),
169-
&tinfo));
169+
&tinfo,fcinfo->flinfo));
170170
}

‎contrib/btree_gist/btree_numeric.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,47 +27,47 @@ PG_FUNCTION_INFO_V1(gbt_numeric_same);
2727
/* define for comparison */
2828

2929
staticbool
30-
gbt_numeric_gt(constvoid*a,constvoid*b,Oidcollation)
30+
gbt_numeric_gt(constvoid*a,constvoid*b,Oidcollation,FmgrInfo*flinfo)
3131
{
3232
returnDatumGetBool(DirectFunctionCall2(numeric_gt,
3333
PointerGetDatum(a),
3434
PointerGetDatum(b)));
3535
}
3636

3737
staticbool
38-
gbt_numeric_ge(constvoid*a,constvoid*b,Oidcollation)
38+
gbt_numeric_ge(constvoid*a,constvoid*b,Oidcollation,FmgrInfo*flinfo)
3939
{
4040
returnDatumGetBool(DirectFunctionCall2(numeric_ge,
4141
PointerGetDatum(a),
4242
PointerGetDatum(b)));
4343
}
4444

4545
staticbool
46-
gbt_numeric_eq(constvoid*a,constvoid*b,Oidcollation)
46+
gbt_numeric_eq(constvoid*a,constvoid*b,Oidcollation,FmgrInfo*flinfo)
4747
{
4848
returnDatumGetBool(DirectFunctionCall2(numeric_eq,
4949
PointerGetDatum(a),
5050
PointerGetDatum(b)));
5151
}
5252

5353
staticbool
54-
gbt_numeric_le(constvoid*a,constvoid*b,Oidcollation)
54+
gbt_numeric_le(constvoid*a,constvoid*b,Oidcollation,FmgrInfo*flinfo)
5555
{
5656
returnDatumGetBool(DirectFunctionCall2(numeric_le,
5757
PointerGetDatum(a),
5858
PointerGetDatum(b)));
5959
}
6060

6161
staticbool
62-
gbt_numeric_lt(constvoid*a,constvoid*b,Oidcollation)
62+
gbt_numeric_lt(constvoid*a,constvoid*b,Oidcollation,FmgrInfo*flinfo)
6363
{
6464
returnDatumGetBool(DirectFunctionCall2(numeric_lt,
6565
PointerGetDatum(a),
6666
PointerGetDatum(b)));
6767
}
6868

6969
staticint32
70-
gbt_numeric_cmp(constvoid*a,constvoid*b,Oidcollation)
70+
gbt_numeric_cmp(constvoid*a,constvoid*b,Oidcollation,FmgrInfo*flinfo)
7171
{
7272
returnDatumGetInt32(DirectFunctionCall2(numeric_cmp,
7373
PointerGetDatum(a),
@@ -122,7 +122,7 @@ gbt_numeric_consistent(PG_FUNCTION_ARGS)
122122
*recheck= false;
123123

124124
retval=gbt_var_consistent(&r,query,strategy,PG_GET_COLLATION(),
125-
GIST_LEAF(entry),&tinfo);
125+
GIST_LEAF(entry),&tinfo,fcinfo->flinfo);
126126
PG_RETURN_BOOL(retval);
127127
}
128128

@@ -135,7 +135,7 @@ gbt_numeric_union(PG_FUNCTION_ARGS)
135135
int32*size= (int*)PG_GETARG_POINTER(1);
136136

137137
PG_RETURN_POINTER(gbt_var_union(entryvec,size,PG_GET_COLLATION(),
138-
&tinfo));
138+
&tinfo,fcinfo->flinfo));
139139
}
140140

141141

@@ -146,7 +146,7 @@ gbt_numeric_same(PG_FUNCTION_ARGS)
146146
Datumd2=PG_GETARG_DATUM(1);
147147
bool*result= (bool*)PG_GETARG_POINTER(2);
148148

149-
*result=gbt_var_same(d1,d2,PG_GET_COLLATION(),&tinfo);
149+
*result=gbt_var_same(d1,d2,PG_GET_COLLATION(),&tinfo,fcinfo->flinfo);
150150
PG_RETURN_POINTER(result);
151151
}
152152

@@ -171,7 +171,7 @@ gbt_numeric_penalty(PG_FUNCTION_ARGS)
171171

172172
rk=gbt_var_key_readable(org);
173173
uni=PointerGetDatum(gbt_var_key_copy(&rk));
174-
gbt_var_bin_union(&uni,newe,PG_GET_COLLATION(),&tinfo);
174+
gbt_var_bin_union(&uni,newe,PG_GET_COLLATION(),&tinfo,fcinfo->flinfo);
175175
ok=gbt_var_key_readable(org);
176176
uk=gbt_var_key_readable((GBT_VARKEY*)DatumGetPointer(uni));
177177

@@ -233,6 +233,6 @@ gbt_numeric_picksplit(PG_FUNCTION_ARGS)
233233
GIST_SPLITVEC*v= (GIST_SPLITVEC*)PG_GETARG_POINTER(1);
234234

235235
gbt_var_picksplit(entryvec,v,PG_GET_COLLATION(),
236-
&tinfo);
236+
&tinfo,fcinfo->flinfo);
237237
PG_RETURN_POINTER(v);
238238
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp