mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-03-01 19:45:33 +08:00
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
This commit is contained in:
parent
b81737bfa8
commit
a67387b6b4
@ -312,6 +312,17 @@ g_int_consistent(PG_FUNCTION_ARGS) {
|
|||||||
query);
|
query);
|
||||||
break;
|
break;
|
||||||
case RTSameStrategyNumber:
|
case RTSameStrategyNumber:
|
||||||
|
if ( GIST_LEAF(entry) )
|
||||||
|
DirectFunctionCall3(
|
||||||
|
g_int_same,
|
||||||
|
entry->key,
|
||||||
|
PointerGetDatum(query),
|
||||||
|
PointerGetDatum(&retval)
|
||||||
|
);
|
||||||
|
else
|
||||||
|
retval = inner_int_contains((ArrayType *) DatumGetPointer(entry->key),
|
||||||
|
query);
|
||||||
|
break;
|
||||||
case RTContainsStrategyNumber:
|
case RTContainsStrategyNumber:
|
||||||
retval = inner_int_contains((ArrayType *) DatumGetPointer(entry->key),
|
retval = inner_int_contains((ArrayType *) DatumGetPointer(entry->key),
|
||||||
query);
|
query);
|
||||||
@ -1263,6 +1274,16 @@ g_intbig_consistent(PG_FUNCTION_ARGS) {
|
|||||||
retval = _intbig_overlap((ArrayType *) DatumGetPointer(entry->key), q);
|
retval = _intbig_overlap((ArrayType *) DatumGetPointer(entry->key), q);
|
||||||
break;
|
break;
|
||||||
case RTSameStrategyNumber:
|
case RTSameStrategyNumber:
|
||||||
|
if ( GIST_LEAF(entry) )
|
||||||
|
DirectFunctionCall3(
|
||||||
|
g_intbig_same,
|
||||||
|
entry->key,
|
||||||
|
PointerGetDatum(q),
|
||||||
|
PointerGetDatum(&retval)
|
||||||
|
);
|
||||||
|
else
|
||||||
|
retval = _intbig_contains((ArrayType *) DatumGetPointer(entry->key), q);
|
||||||
|
break;
|
||||||
case RTContainsStrategyNumber:
|
case RTContainsStrategyNumber:
|
||||||
retval = _intbig_contains((ArrayType *) DatumGetPointer(entry->key), q);
|
retval = _intbig_contains((ArrayType *) DatumGetPointer(entry->key), q);
|
||||||
break;
|
break;
|
||||||
|
@ -177,7 +177,7 @@ INSERT INTO pg_amop (amopclaid, amopstrategy, amopreqcheck, amopopr)
|
|||||||
|
|
||||||
-- _int_same
|
-- _int_same
|
||||||
INSERT INTO pg_amop (amopclaid, amopstrategy, amopreqcheck, amopopr)
|
INSERT INTO pg_amop (amopclaid, amopstrategy, amopreqcheck, amopopr)
|
||||||
SELECT opcl.oid, 6, false, c.opoid
|
SELECT opcl.oid, 6, true, c.opoid
|
||||||
FROM pg_opclass opcl, _int_ops_tmp c
|
FROM pg_opclass opcl, _int_ops_tmp c
|
||||||
WHERE
|
WHERE
|
||||||
opcamid = (SELECT oid FROM pg_am WHERE amname = 'gist')
|
opcamid = (SELECT oid FROM pg_am WHERE amname = 'gist')
|
||||||
@ -350,6 +350,15 @@ INSERT INTO pg_amop (amopclaid, amopstrategy, amopreqcheck, amopopr)
|
|||||||
and opcname = 'gist__intbig_ops'
|
and opcname = 'gist__intbig_ops'
|
||||||
and c.oprname = '~';
|
and c.oprname = '~';
|
||||||
|
|
||||||
|
-- _int_same
|
||||||
|
INSERT INTO pg_amop (amopclaid, amopstrategy, amopreqcheck, amopopr)
|
||||||
|
SELECT opcl.oid, 6, true, c.opoid
|
||||||
|
FROM pg_opclass opcl, _int_ops_tmp c
|
||||||
|
WHERE
|
||||||
|
opcamid = (SELECT oid FROM pg_am WHERE amname = 'gist')
|
||||||
|
and opcname = 'gist__intbig_ops'
|
||||||
|
and c.oprname = '=';
|
||||||
|
|
||||||
--boolean search
|
--boolean search
|
||||||
INSERT INTO pg_amop (amopclaid, amopstrategy, amopreqcheck, amopopr)
|
INSERT INTO pg_amop (amopclaid, amopstrategy, amopreqcheck, amopopr)
|
||||||
SELECT opcl.oid, 20, true, c.opoid
|
SELECT opcl.oid, 20, true, c.opoid
|
||||||
|
Loading…
Reference in New Issue
Block a user