Skip to content

Commit 76c0375

Browse files
authored
Merge pull request #68 from citusdata/pg17
Pg17 support
2 parents ed4b730 + 1dae376 commit 76c0375

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

topn.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,14 @@ static int32 UnionFactor = 3;
5656
#define PG_RETURN_JSONB(jsonb) PG_RETURN_JSONB_P(jsonb)
5757
#endif
5858

59-
#if PG_VERSION_NUM >= 130000
60-
#define makeJsonLexContextCstringLenCompat(json, len, encoding, need_escapes) \
59+
#if PG_VERSION_NUM >= 170000
60+
#define makeJsonLexContextCstringLenCompat(lex, json, len, encoding, need_escapes) \
61+
makeJsonLexContextCstringLen(lex, json, len, encoding, need_escapes);
62+
#elif PG_VERSION_NUM >= 130000
63+
#define makeJsonLexContextCstringLenCompat(lex, json, len, encoding, need_escapes) \
6164
makeJsonLexContextCstringLen(json, len, encoding, need_escapes);
6265
#else
63-
#define makeJsonLexContextCstringLenCompat(json, len, encoding, need_escapes) \
66+
#define makeJsonLexContextCstringLenCompat(lex, json, len, encoding, need_escapes) \
6467
makeJsonLexContextCstringLen(json, len, need_escapes);
6568
#endif
6669

@@ -1172,13 +1175,13 @@ jsonb_in_scalar(void *pstate, char *token, JsonTokenType tokentype)
11721175
static Jsonb *
11731176
jsonb_from_cstring(char *json, int len)
11741177
{
1175-
JsonLexContext *lex;
1178+
JsonLexContext *lex = NULL;
11761179
JsonbInState state;
11771180
JsonSemAction sem;
11781181

11791182
memset(&state, 0, sizeof(state));
11801183
memset(&sem, 0, sizeof(sem));
1181-
lex = makeJsonLexContextCstringLenCompat(json, len, GetDatabaseEncoding(), true);
1184+
lex = makeJsonLexContextCstringLenCompat(lex, json, len, GetDatabaseEncoding(), true);
11821185

11831186
sem.semstate = (void *) &state;
11841187

0 commit comments

Comments
 (0)