Skip to content

Commit 8ca8208

Browse files
committed
Fix name of the macro for getting signature length trgm_gist.c
911e702 has introduced the opclass parameters including signature length for a set of GiST opclasses. Due to copy-pasting, macro for getting the signature length in trgm_gist.c was named LTREE_GET_ASIGLEN(). Fix that by renaming this macro to just GET_SIGLEN(). Backpatch-through: 13
1 parent b62e605 commit 8ca8208

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

contrib/pg_trgm/trgm_gist.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ typedef struct
1616
int siglen; /* signature length in bytes */
1717
} TrgmGistOptions;
1818

19-
#define LTREE_GET_ASIGLEN() (PG_HAS_OPCLASS_OPTIONS() ? \
19+
#define GET_SIGLEN() (PG_HAS_OPCLASS_OPTIONS() ? \
2020
((TrgmGistOptions *) PG_GET_OPCLASS_OPTIONS())->siglen : \
2121
SIGLEN_DEFAULT)
2222

@@ -108,7 +108,7 @@ Datum
108108
gtrgm_compress(PG_FUNCTION_ARGS)
109109
{
110110
GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
111-
int siglen = LTREE_GET_ASIGLEN();
111+
int siglen = GET_SIGLEN();
112112
GISTENTRY *retval = entry;
113113

114114
if (entry->leafkey)
@@ -195,7 +195,7 @@ gtrgm_consistent(PG_FUNCTION_ARGS)
195195

196196
/* Oid subtype = PG_GETARG_OID(3); */
197197
bool *recheck = (bool *) PG_GETARG_POINTER(4);
198-
int siglen = LTREE_GET_ASIGLEN();
198+
int siglen = GET_SIGLEN();
199199
TRGM *key = (TRGM *) DatumGetPointer(entry->key);
200200
TRGM *qtrg;
201201
bool res;
@@ -448,7 +448,7 @@ gtrgm_distance(PG_FUNCTION_ARGS)
448448

449449
/* Oid subtype = PG_GETARG_OID(3); */
450450
bool *recheck = (bool *) PG_GETARG_POINTER(4);
451-
int siglen = LTREE_GET_ASIGLEN();
451+
int siglen = GET_SIGLEN();
452452
TRGM *key = (TRGM *) DatumGetPointer(entry->key);
453453
TRGM *qtrg;
454454
float8 res;
@@ -557,7 +557,7 @@ gtrgm_union(PG_FUNCTION_ARGS)
557557
GistEntryVector *entryvec = (GistEntryVector *) PG_GETARG_POINTER(0);
558558
int32 len = entryvec->n;
559559
int *size = (int *) PG_GETARG_POINTER(1);
560-
int siglen = LTREE_GET_ASIGLEN();
560+
int siglen = GET_SIGLEN();
561561
int32 i;
562562
TRGM *result = gtrgm_alloc(false, siglen, NULL);
563563
BITVECP base = GETSIGN(result);
@@ -583,7 +583,7 @@ gtrgm_same(PG_FUNCTION_ARGS)
583583
TRGM *a = (TRGM *) PG_GETARG_POINTER(0);
584584
TRGM *b = (TRGM *) PG_GETARG_POINTER(1);
585585
bool *result = (bool *) PG_GETARG_POINTER(2);
586-
int siglen = LTREE_GET_ASIGLEN();
586+
int siglen = GET_SIGLEN();
587587

588588
if (ISSIGNKEY(a))
589589
{ /* then b also ISSIGNKEY */
@@ -680,7 +680,7 @@ gtrgm_penalty(PG_FUNCTION_ARGS)
680680
GISTENTRY *origentry = (GISTENTRY *) PG_GETARG_POINTER(0); /* always ISSIGNKEY */
681681
GISTENTRY *newentry = (GISTENTRY *) PG_GETARG_POINTER(1);
682682
float *penalty = (float *) PG_GETARG_POINTER(2);
683-
int siglen = LTREE_GET_ASIGLEN();
683+
int siglen = GET_SIGLEN();
684684
TRGM *origval = (TRGM *) DatumGetPointer(origentry->key);
685685
TRGM *newval = (TRGM *) DatumGetPointer(newentry->key);
686686
BITVECP orig = GETSIGN(origval);
@@ -788,7 +788,7 @@ gtrgm_picksplit(PG_FUNCTION_ARGS)
788788
GistEntryVector *entryvec = (GistEntryVector *) PG_GETARG_POINTER(0);
789789
OffsetNumber maxoff = entryvec->n - 2;
790790
GIST_SPLITVEC *v = (GIST_SPLITVEC *) PG_GETARG_POINTER(1);
791-
int siglen = LTREE_GET_ASIGLEN();
791+
int siglen = GET_SIGLEN();
792792
OffsetNumber k,
793793
j;
794794
TRGM *datum_l,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy