68#include "utils/fmgrprotos.h"
174 int id = entries->
count;
192 entries->
buf[entries->
count++] = entry;
272 *nentries = entries.
count;
314 pentry->keyName = keyName;
374 sizeof(node->
args[0]) * nargs);
610 return larg ? larg : rarg;
701 scalar.
val.string.len =
705 elog(
ERROR,
"invalid scalar jsonpath item type: %d",
785 *nentries = entries.
count;
843 elog(
ERROR,
"invalid jsonpath gin node type: %d", node->
type);
922 elog(
ERROR,
"unrecognized strategy number: %d", strategy);
955 for (
i = 0;
i < nkeys;
i++)
987 for (
i = 0;
i < nkeys;
i++)
1003 Assert(extra_data && extra_data[0]);
1008 elog(
ERROR,
"unrecognized strategy number: %d", strategy);
1035 for (
i = 0;
i < nkeys;
i++)
1049 for (
i = 0;
i < nkeys;
i++)
1064 Assert(extra_data && extra_data[0]);
1073 elog(
ERROR,
"unrecognized strategy number: %d", strategy);
1171 elog(
ERROR,
"invalid JsonbIteratorNext rc: %d", (
int) r);
1175 *nentries = entries.
count;
1213 elog(
ERROR,
"unrecognized strategy number: %d", strategy);
1246 for (
i = 0;
i < nkeys;
i++)
1262 Assert(extra_data && extra_data[0]);
1267 elog(
ERROR,
"unrecognized strategy number: %d", strategy);
1292 for (
i = 0;
i < nkeys;
i++)
1306 Assert(extra_data && extra_data[0]);
1315 elog(
ERROR,
"unrecognized strategy number: %d", strategy);
#define PG_GETARG_ARRAYTYPE_P(n)
void deconstruct_array_builtin(const ArrayType *array, Oid elmtype, Datum **elemsp, bool **nullsp, int *nelemsp)
char * numeric_normalize(Numeric num)
#define Assert(condition)
#define FLEXIBLE_ARRAY_MEMBER
#define palloc_object(type)
#define repalloc_array(pointer, type, count)
#define palloc_array(type, count)
#define palloc0_array(type, count)
#define PG_FREE_IF_COPY(ptr, n)
#define PG_GETARG_TEXT_PP(n)
#define DirectFunctionCall2(func, arg1, arg2)
#define PG_GETARG_POINTER(n)
#define PG_GETARG_DATUM(n)
#define PG_GETARG_UINT16(n)
#define PG_RETURN_INT32(x)
#define PG_GETARG_INT32(n)
#define PG_RETURN_POINTER(x)
#define PG_RETURN_BOOL(x)
#define PG_RETURN_GIN_TERNARY_VALUE(x)
#define GIN_SEARCH_MODE_ALL
static Datum hash_any(const unsigned char *k, int keylen)
#define PG_GETARG_JSONB_P(x)
#define JsonbContainsStrategyNumber
#define JsonbJsonpathPredicateStrategyNumber
#define JsonbExistsAllStrategyNumber
#define JsonbExistsStrategyNumber
#define JsonbExistsAnyStrategyNumber
#define JsonbJsonpathExistsStrategyNumber
#define JB_ROOT_COUNT(jbp_)
static JsonPathGinNode * extract_jsp_bool_expr(JsonPathGinContext *cxt, JsonPathGinPath path, JsonPathItem *jsp, bool not)
static JsonPathGinNode * make_jsp_entry_node_scalar(JsonbValue *scalar, bool iskey)
Datum gin_compare_jsonb(PG_FUNCTION_ARGS)
static Datum make_text_key(char flag, const char *str, int len)
static List * jsonb_path_ops__extract_nodes(JsonPathGinContext *cxt, JsonPathGinPath path, JsonbValue *scalar, List *nodes)
static GinTernaryValue execute_jsp_gin_node(JsonPathGinNode *node, void *check, bool ternary)
static JsonPathGinNode * make_jsp_expr_node_args(JsonPathGinNodeType type, List *args)
static JsonPathGinNode * extract_jsp_path_expr(JsonPathGinContext *cxt, JsonPathGinPath path, JsonPathItem *jsp, JsonbValue *scalar)
bool(* JsonPathGinAddPathItemFunc)(JsonPathGinPath *path, JsonPathItem *jsp)
static bool jsonb_ops__add_path_item(JsonPathGinPath *path, JsonPathItem *jsp)
static JsonPathGinNode * make_jsp_expr_node(JsonPathGinNodeType type, int nargs)
static Datum make_scalar_key(const JsonbValue *scalarVal, bool is_key)
static List * jsonb_ops__extract_nodes(JsonPathGinContext *cxt, JsonPathGinPath path, JsonbValue *scalar, List *nodes)
static Datum * extract_jsp_query(JsonPath *jp, StrategyNumber strat, bool pathOps, int32 *nentries, Pointer **extra_data)
Datum gin_consistent_jsonb_path(PG_FUNCTION_ARGS)
Datum gin_extract_jsonb_query(PG_FUNCTION_ARGS)
Datum gin_extract_jsonb(PG_FUNCTION_ARGS)
static List * extract_jsp_path_expr_nodes(JsonPathGinContext *cxt, JsonPathGinPath path, JsonPathItem *jsp, JsonbValue *scalar)
static void init_gin_entries(GinEntries *entries, int preallocated)
static bool jsonb_path_ops__add_path_item(JsonPathGinPath *path, JsonPathItem *jsp)
Datum gin_extract_jsonb_query_path(PG_FUNCTION_ARGS)
Datum gin_consistent_jsonb(PG_FUNCTION_ARGS)
Datum gin_extract_jsonb_path(PG_FUNCTION_ARGS)
static int add_gin_entry(GinEntries *entries, Datum entry)
List *(* JsonPathGinExtractNodesFunc)(JsonPathGinContext *cxt, JsonPathGinPath path, JsonbValue *scalar, List *nodes)
static JsonPathGinNode * make_jsp_expr_node_binary(JsonPathGinNodeType type, JsonPathGinNode *arg1, JsonPathGinNode *arg2)
Datum gin_triconsistent_jsonb_path(PG_FUNCTION_ARGS)
static JsonPathGinNode * make_jsp_entry_node(Datum entry)
static void emit_jsp_gin_entries(JsonPathGinNode *node, GinEntries *entries)
Datum gin_triconsistent_jsonb(PG_FUNCTION_ARGS)
JsonbIterator * JsonbIteratorInit(JsonbContainer *container)
void JsonbHashScalarValue(const JsonbValue *scalarVal, uint32 *hash)
JsonbIteratorToken JsonbIteratorNext(JsonbIterator **it, JsonbValue *val, bool skipNested)
void jspGetLeftArg(JsonPathItem *v, JsonPathItem *a)
void jspGetArg(JsonPathItem *v, JsonPathItem *a)
void jspInit(JsonPathItem *v, JsonPath *js)
char * jspGetString(JsonPathItem *v, int32 *len)
bool jspGetNext(JsonPathItem *v, JsonPathItem *a)
void jspGetRightArg(JsonPathItem *v, JsonPathItem *a)
#define PG_GETARG_JSONPATH_P(x)
#define jspIsScalar(type)
List * lappend(List *list, void *datum)
void pfree(void *pointer)
struct NumericData * Numeric
static int list_length(const List *l)
static uint32 DatumGetUInt32(Datum X)
static Datum PointerGetDatum(const void *X)
static Pointer DatumGetPointer(Datum X)
static Datum UInt32GetDatum(uint32 X)
static unsigned hash(unsigned *uv, int n)
void check_stack_depth(void)
JsonPathGinExtractNodesFunc extract_nodes
JsonPathGinAddPathItemFunc add_path_item
union JsonPathGinNode::@25 val
JsonPathGinNode * args[FLEXIBLE_ARRAY_MEMBER]
struct JsonPathGinPathItem * parent
struct PathHashStack * parent
JsonPathGinPathItem * items
static Size VARSIZE_ANY_EXHDR(const void *PTR)
static char * VARDATA(const void *PTR)
static char * VARDATA_ANY(const void *PTR)
static void SET_VARSIZE(void *PTR, Size len)
int varstr_cmp(const char *arg1, int len1, const char *arg2, int len2, Oid collid)