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

Commit74a8af0

Browse files
committed
Please apply attached patch to contrib/intarray (7.2, 7.3).
Fixed bug with '=' operator for gist__int_ops and define '=' operator for gist__intbig_ops opclass. Now '=' operator is consistent with standard 'array' type. Thanks Achilleus Mantzios for bug report and suggestion.Oleg Bartunov
1 parent2f297a2 commit74a8af0

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

‎contrib/intarray/_int.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,17 @@ g_int_consistent(PG_FUNCTION_ARGS) {
312312
query);
313313
break;
314314
caseRTSameStrategyNumber:
315+
if (GIST_LEAF(entry) )
316+
DirectFunctionCall3(
317+
g_int_same,
318+
entry->key,
319+
PointerGetDatum(query),
320+
PointerGetDatum(&retval)
321+
);
322+
else
323+
retval=inner_int_contains((ArrayType*)DatumGetPointer(entry->key),
324+
query);
325+
break;
315326
caseRTContainsStrategyNumber:
316327
retval=inner_int_contains((ArrayType*)DatumGetPointer(entry->key),
317328
query);
@@ -1263,6 +1274,16 @@ g_intbig_consistent(PG_FUNCTION_ARGS) {
12631274
retval=_intbig_overlap((ArrayType*)DatumGetPointer(entry->key),q);
12641275
break;
12651276
caseRTSameStrategyNumber:
1277+
if (GIST_LEAF(entry) )
1278+
DirectFunctionCall3(
1279+
g_intbig_same,
1280+
entry->key,
1281+
PointerGetDatum(q),
1282+
PointerGetDatum(&retval)
1283+
);
1284+
else
1285+
retval=_intbig_contains((ArrayType*)DatumGetPointer(entry->key),q);
1286+
break;
12661287
caseRTContainsStrategyNumber:
12671288
retval=_intbig_contains((ArrayType*)DatumGetPointer(entry->key),q);
12681289
break;

‎contrib/intarray/_int.sql.in

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ INSERT INTO pg_amop (amopclaid, amopstrategy, amopreqcheck, amopopr)
179179

180180
-- _int_same
181181
INSERT INTO pg_amop (amopclaid, amopstrategy, amopreqcheck, amopopr)
182-
SELECT opcl.oid, 6,false, c.opoid
182+
SELECT opcl.oid, 6,true, c.opoid
183183
FROM pg_opclass opcl, _int_ops_tmp c
184184
WHERE
185185
opcamid = (SELECT oid FROM pg_am WHERE amname = 'gist')
@@ -354,6 +354,15 @@ INSERT INTO pg_amop (amopclaid, amopstrategy, amopreqcheck, amopopr)
354354
and opcname = 'gist__intbig_ops'
355355
and c.oprname = '~';
356356

357+
-- _int_same
358+
INSERT INTO pg_amop (amopclaid, amopstrategy, amopreqcheck, amopopr)
359+
SELECT opcl.oid, 6, true, c.opoid
360+
FROM pg_opclass opcl, _int_ops_tmp c
361+
WHERE
362+
opcamid = (SELECT oid FROM pg_am WHERE amname = 'gist')
363+
and opcname = 'gist__intbig_ops'
364+
and c.oprname = '=';
365+
357366
--boolean search
358367
INSERT INTO pg_amop (amopclaid, amopstrategy, amopreqcheck, amopopr)
359368
SELECT opcl.oid, 20, true, c.opoid

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp