Skip to content

Commit

Permalink
Fix JSONACTION_RETURN_SUCCESS definition on pg16-
Browse files Browse the repository at this point in the history
On postgres 15 and below, pgsptokentype is defined to void rather than an
actual enum, so a lot of functions don't return anything.  But an empty
JSONACTION_RETURN_SUCCESS define doesn't exit the function as it would with
pg16+ definition, which leads to bogus behavior.  To fix, simply define
JSONACTION_RETURN_SUCCESS to "return" on pg 15 and below.
  • Loading branch information
rjuju committed Jan 19, 2025
1 parent abf9da3 commit de38dd3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pgsp_json.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#if PG_VERSION_NUM < 160000
#include "parser/gram.h"
#define JsonParseErrorType void
#define JSONACTION_RETURN_SUCCESS()
#define JSONACTION_RETURN_SUCCESS() return
#else
/* In PG16, include/scan.h was gone. Define required symbols manually.. */
/* must be in sync with src/backend/parser/gram.h */
Expand Down

0 comments on commit de38dd3

Please sign in to comment.