int cflags;
} JsonLikeRegexContext;
+#define EmptyJsonLikeRegexContext {NULL, 0}
+
/* Result of jsonpath predicate evaluation */
typedef enum JsonPathBool
{
List *list;
} JsonValueList;
+#define EmptyJsonValueList {NULL, NIL}
+
typedef struct JsonValueListIterator
{
JsonbValue *value;
Jsonb *jb = PG_GETARG_JSONB_P(0);
JsonPath *jp = PG_GETARG_JSONPATH_P(1);
JsonbValue *jbv;
- JsonValueList found = {0};
+ JsonValueList found = EmptyJsonValueList;
Jsonb *vars = NULL;
bool silent = true;
MemoryContext oldcontext;
Jsonb *vars;
bool silent;
- JsonValueList found = {0};
+ JsonValueList found = EmptyJsonValueList;
funcctx = SRF_FIRSTCALL_INIT();
oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
{
Jsonb *jb = PG_GETARG_JSONB_P(0);
JsonPath *jp = PG_GETARG_JSONPATH_P(1);
- JsonValueList found = {0};
+ JsonValueList found = EmptyJsonValueList;
Jsonb *vars = PG_GETARG_JSONB_P(2);
bool silent = PG_GETARG_BOOL(3);
{
Jsonb *jb = PG_GETARG_JSONB_P(0);
JsonPath *jp = PG_GETARG_JSONPATH_P(1);
- JsonValueList found = {0};
+ JsonValueList found = EmptyJsonValueList;
Jsonb *vars = PG_GETARG_JSONB_P(2);
bool silent = PG_GETARG_BOOL(3);
* In strict mode we must get a complete list of values to check that
* there are no errors at all.
*/
- JsonValueList vals = {0};
+ JsonValueList vals = EmptyJsonValueList;
res = executeItem(&cxt, &jsp, &jbv, &vals);
{
if (unwrap && jspAutoUnwrap(cxt))
{
- JsonValueList seq = {0};
+ JsonValueList seq = EmptyJsonValueList;
JsonValueListIterator it;
JsonPathExecResult res = executeItem(cxt, jsp, jb, &seq);
JsonbValue *item;
* regexes, but we use Postgres regexes here. 'flags' is a
* string literal converted to integer flags at compile-time.
*/
- JsonLikeRegexContext lrcxt = {0};
+ JsonLikeRegexContext lrcxt = EmptyJsonLikeRegexContext;
jspInitByBuffer(&larg, jsp->base,
jsp->content.like_regex.expr);
* In strict mode we must get a complete list of values to
* check that there are no errors at all.
*/
- JsonValueList vals = {0};
+ JsonValueList vals = EmptyJsonValueList;
JsonPathExecResult res =
executeItemOptUnwrapResultNoThrow(cxt, &larg, jb,
false, &vals);
{
JsonPathExecResult res;
JsonValueListIterator lseqit;
- JsonValueList lseq = {0};
- JsonValueList rseq = {0};
+ JsonValueList lseq = EmptyJsonValueList;
+ JsonValueList rseq = EmptyJsonValueList;
JsonbValue *lval;
bool error = false;
bool found = false;
{
JsonPathExecResult jper;
JsonPathItem elem;
- JsonValueList lseq = {0};
- JsonValueList rseq = {0};
+ JsonValueList lseq = EmptyJsonValueList;
+ JsonValueList rseq = EmptyJsonValueList;
JsonbValue *lval;
JsonbValue *rval;
Numeric res;
JsonPathExecResult jper;
JsonPathExecResult jper2;
JsonPathItem elem;
- JsonValueList seq = {0};
+ JsonValueList seq = EmptyJsonValueList;
JsonValueListIterator it;
JsonbValue *val;
bool hasNext;
int32 *index)
{
JsonbValue *jbv;
- JsonValueList found = {0};
+ JsonValueList found = EmptyJsonValueList;
JsonPathExecResult res = executeItem(cxt, jsp, jb, &found);
Datum numeric_index;
bool have_error = false;