PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "funcapi.h"
#include "lib/stringinfo.h"
#include "libpq/pqformat.h"
#include "nodes/miscnodes.h"
#include "miscadmin.h"
#include "utils/builtins.h"
#include "utils/json.h"
#include "utils/jsonpath.h"
Go to the source code of this file.
Macros | |
#define | read_byte(v, b, p) |
#define | read_int32(v, b, p) |
#define | read_int32_n(v, b, p, n) |
#define read_byte | ( | v, | |
b, | |||
p | |||
) |
#define read_int32 | ( | v, | |
b, | |||
p | |||
) |
#define read_int32_n | ( | v, | |
b, | |||
p, | |||
n | |||
) |
Definition at line 860 of file jsonpath.c.
|
static |
Definition at line 471 of file jsonpath.c.
References appendStringInfoCharMacro, buf, and INTALIGN.
Referenced by flattenJsonPathParseItem().
|
static |
Definition at line 237 of file jsonpath.c.
References alignStringInfoInt(), JsonPathParseItem::anybounds, appendBinaryStringInfo(), appendStringInfoChar(), appendStringInfoSpaces(), arg, JsonPathParseItem::arg, JsonPathParseItem::args, JsonPathParseItem::array, JsonPathParseItem::boolean, buf, CHECK_FOR_INTERRUPTS, check_stack_depth(), elog(), ereturn, errcode(), errmsg(), ERROR, i, jpiAbs, jpiAdd, jpiAnd, jpiAny, jpiAnyArray, jpiAnyKey, jpiBool, jpiCeiling, jpiCurrent, jpiDatetime, jpiDiv, jpiDouble, jpiEqual, jpiExists, jpiFilter, jpiFloor, jpiGreater, jpiGreaterOrEqual, jpiIndexArray, jpiIsUnknown, jpiKey, jpiKeyValue, jpiLast, jpiLess, jpiLessOrEqual, jpiLikeRegex, jpiMinus, jpiMod, jpiMul, jpiNot, jpiNotEqual, jpiNull, jpiNumeric, jpiOr, jpiPlus, jpiRoot, jpiSize, jpiStartsWith, jpiString, jpiSub, jpiType, jpiVariable, JSONPATH_HDRSZ, JsonPathParseItem::like_regex, next, JsonPathParseItem::next, JsonPathParseItem::numeric, reserveSpaceForItemPointer(), JsonPathParseItem::string, JsonPathParseItem::type, JsonPathParseItem::value, and VARSIZE.
Referenced by jsonPathFromCstring().
Datum jsonpath_in | ( | PG_FUNCTION_ARGS | ) |
Definition at line 96 of file jsonpath.c.
References jsonPathFromCstring(), len, and PG_GETARG_CSTRING.
Datum jsonpath_out | ( | PG_FUNCTION_ARGS | ) |
Definition at line 132 of file jsonpath.c.
References jsonPathToCstring(), PG_GETARG_JSONPATH_P, PG_RETURN_CSTRING, and VARSIZE.
Datum jsonpath_recv | ( | PG_FUNCTION_ARGS | ) |
Definition at line 113 of file jsonpath.c.
References buf, elog(), ERROR, JSONPATH_VERSION, jsonPathFromCstring(), PG_GETARG_POINTER, pq_getmsgint(), pq_getmsgtext(), and generate_unaccent_rules::str.
Datum jsonpath_send | ( | PG_FUNCTION_ARGS | ) |
Definition at line 145 of file jsonpath.c.
References buf, StringInfoData::data, initStringInfo(), JSONPATH_VERSION, jsonPathToCstring(), StringInfoData::len, pfree(), PG_GETARG_JSONPATH_P, PG_RETURN_BYTEA_P, pq_begintypsend(), pq_endtypsend(), pq_sendint8(), pq_sendtext(), and VARSIZE.
Definition at line 171 of file jsonpath.c.
References appendStringInfoSpaces(), buf, enlargeStringInfo(), ereturn, errcode(), errmsg(), JsonPathParseResult::expr, flattenJsonPathParseItem(), initStringInfo(), JSONPATH_HDRSZ, JSONPATH_LAX, JSONPATH_VERSION, JsonPathParseResult::lax, len, parsejsonpath(), PG_RETURN_JSONPATH_P, res, SET_VARSIZE, and SOFT_ERROR_OCCURRED.
Referenced by jsonpath_in(), and jsonpath_recv().
|
static |
Definition at line 211 of file jsonpath.c.
References appendStringInfoString(), buf, StringInfoData::data, enlargeStringInfo(), JsonPath::header, initStringInfo(), JSONPATH_LAX, jspInit(), and printJsonPathItem().
Referenced by jsonpath_out(), and jsonpath_send().
void jspGetArg | ( | JsonPathItem * | v, |
JsonPathItem * | a | ||
) |
Definition at line 959 of file jsonpath.c.
References a, JsonPathItem::arg, Assert(), JsonPathItem::base, JsonPathItem::content, jpiDatetime, jpiExists, jpiFilter, jpiIsUnknown, jpiMinus, jpiNot, jpiPlus, jspInitByBuffer(), and JsonPathItem::type.
Referenced by executeBoolItem(), executeDateTimeMethod(), executeItemOptUnwrapTarget(), executeUnaryArithmExpr(), extract_jsp_bool_expr(), extract_jsp_path_expr_nodes(), and printJsonPathItem().
bool jspGetArraySubscript | ( | JsonPathItem * | v, |
JsonPathItem * | from, | ||
JsonPathItem * | to, | ||
int | i | ||
) |
Definition at line 1099 of file jsonpath.c.
References JsonPathItem::array, Assert(), JsonPathItem::base, JsonPathItem::content, i, jpiIndexArray, jspInitByBuffer(), and JsonPathItem::type.
Referenced by executeItemOptUnwrapTarget(), and printJsonPathItem().
bool jspGetBool | ( | JsonPathItem * | v | ) |
Definition at line 1071 of file jsonpath.c.
References Assert(), JsonPathItem::content, jpiBool, JsonPathItem::type, and JsonPathItem::value.
Referenced by getJsonPathItem(), and printJsonPathItem().
void jspGetLeftArg | ( | JsonPathItem * | v, |
JsonPathItem * | a | ||
) |
Definition at line 1029 of file jsonpath.c.
References a, JsonPathItem::args, Assert(), JsonPathItem::base, JsonPathItem::content, jpiAdd, jpiAnd, jpiDiv, jpiEqual, jpiGreater, jpiGreaterOrEqual, jpiLess, jpiLessOrEqual, jpiMod, jpiMul, jpiNotEqual, jpiOr, jpiStartsWith, jpiSub, jspInitByBuffer(), and JsonPathItem::type.
Referenced by executeBinaryArithmExpr(), executeBoolItem(), extract_jsp_bool_expr(), and printJsonPathItem().
bool jspGetNext | ( | JsonPathItem * | v, |
JsonPathItem * | a | ||
) |
Definition at line 973 of file jsonpath.c.
References a, Assert(), JsonPathItem::base, jpiAbs, jpiAdd, jpiAnd, jpiAny, jpiAnyArray, jpiAnyKey, jpiBool, jpiCeiling, jpiCurrent, jpiDatetime, jpiDiv, jpiDouble, jpiEqual, jpiExists, jpiFilter, jpiFloor, jpiGreater, jpiGreaterOrEqual, jpiIndexArray, jpiIsUnknown, jpiKey, jpiKeyValue, jpiLast, jpiLess, jpiLessOrEqual, jpiLikeRegex, jpiMinus, jpiMod, jpiMul, jpiNot, jpiNotEqual, jpiNull, jpiNumeric, jpiOr, jpiPlus, jpiRoot, jpiSize, jpiStartsWith, jpiString, jpiSub, jpiType, jpiVariable, jspHasNext, jspInitByBuffer(), JsonPathItem::nextPos, and JsonPathItem::type.
Referenced by appendBoolResult(), executeBinaryArithmExpr(), executeDateTimeMethod(), executeItemOptUnwrapTarget(), executeKeyValueMethod(), executeNextItem(), executeNumericItemMethod(), executeUnaryArithmExpr(), extract_jsp_path_expr_nodes(), and printJsonPathItem().
Numeric jspGetNumeric | ( | JsonPathItem * | v | ) |
Definition at line 1079 of file jsonpath.c.
References Assert(), JsonPathItem::content, jpiNumeric, JsonPathItem::type, and JsonPathItem::value.
Referenced by getJsonPathItem(), and printJsonPathItem().
void jspGetRightArg | ( | JsonPathItem * | v, |
JsonPathItem * | a | ||
) |
Definition at line 1050 of file jsonpath.c.
References a, JsonPathItem::args, Assert(), JsonPathItem::base, JsonPathItem::content, jpiAdd, jpiAnd, jpiDiv, jpiEqual, jpiGreater, jpiGreaterOrEqual, jpiLess, jpiLessOrEqual, jpiMod, jpiMul, jpiNotEqual, jpiOr, jpiStartsWith, jpiSub, jspInitByBuffer(), and JsonPathItem::type.
Referenced by executeBinaryArithmExpr(), executeBoolItem(), extract_jsp_bool_expr(), and printJsonPathItem().
char* jspGetString | ( | JsonPathItem * | v, |
int32 * | len | ||
) |
Definition at line 1087 of file jsonpath.c.
References Assert(), JsonPathItem::content, jpiKey, jpiString, jpiVariable, len, JsonPathItem::type, and JsonPathItem::value.
Referenced by executeDateTimeMethod(), executeItemOptUnwrapTarget(), getJsonPathItem(), getJsonPathVariable(), jsonb_ops__add_path_item(), jsonb_path_ops__add_path_item(), and printJsonPathItem().
void jspInit | ( | JsonPathItem * | v, |
JsonPath * | js | ||
) |
Definition at line 869 of file jsonpath.c.
References Assert(), JsonPath::data, JsonPath::header, JSONPATH_LAX, JSONPATH_VERSION, and jspInitByBuffer().
Referenced by executeJsonPath(), extract_jsp_query(), and jsonPathToCstring().
void jspInitByBuffer | ( | JsonPathItem * | v, |
char * | base, | ||
int32 | pos | ||
) |
Definition at line 879 of file jsonpath.c.
References JsonPathItem::anybounds, JsonPathItem::arg, JsonPathItem::args, JsonPathItem::array, JsonPathItem::base, JsonPathItem::content, elog(), ERROR, INTALIGN, jpiAbs, jpiAdd, jpiAnd, jpiAny, jpiAnyArray, jpiAnyKey, jpiBool, jpiCeiling, jpiCurrent, jpiDatetime, jpiDiv, jpiDouble, jpiEqual, jpiExists, jpiFilter, jpiFloor, jpiGreater, jpiGreaterOrEqual, jpiIndexArray, jpiIsUnknown, jpiKey, jpiKeyValue, jpiLast, jpiLess, jpiLessOrEqual, jpiLikeRegex, jpiMinus, jpiMod, jpiMul, jpiNot, jpiNotEqual, jpiNull, jpiNumeric, jpiOr, jpiPlus, jpiRoot, jpiSize, jpiStartsWith, jpiString, jpiSub, jpiType, jpiVariable, JsonPathItem::like_regex, JsonPathItem::nextPos, read_byte, read_int32, read_int32_n, JsonPathItem::type, and JsonPathItem::value.
Referenced by executeBoolItem(), jspGetArg(), jspGetArraySubscript(), jspGetLeftArg(), jspGetNext(), jspGetRightArg(), jspInit(), and printJsonPathItem().
const char* jspOperationName | ( | JsonPathItemType | type | ) |
Definition at line 754 of file jsonpath.c.
References elog(), ERROR, jpiAbs, jpiAdd, jpiAnd, jpiCeiling, jpiDatetime, jpiDiv, jpiDouble, jpiEqual, jpiFloor, jpiGreater, jpiGreaterOrEqual, jpiKeyValue, jpiLess, jpiLessOrEqual, jpiLikeRegex, jpiMinus, jpiMod, jpiMul, jpiNotEqual, jpiOr, jpiPlus, jpiSize, jpiStartsWith, jpiSub, jpiType, and type.
Referenced by executeBinaryArithmExpr(), executeDateTimeMethod(), executeItemOptUnwrapTarget(), executeKeyValueMethod(), executeNumericItemMethod(), executeUnaryArithmExpr(), and printJsonPathItem().
|
static |
Definition at line 813 of file jsonpath.c.
References jpiAdd, jpiAnd, jpiDiv, jpiEqual, jpiGreater, jpiGreaterOrEqual, jpiLess, jpiLessOrEqual, jpiMinus, jpiMod, jpiMul, jpiNotEqual, jpiOr, jpiPlus, jpiStartsWith, and jpiSub.
Referenced by printJsonPathItem().
|
static |
Definition at line 508 of file jsonpath.c.
References JsonPathItem::anybounds, appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), JsonPathItem::arg, JsonPathItem::array, Assert(), JsonPathItem::base, buf, CHECK_FOR_INTERRUPTS, check_stack_depth(), JsonPathItem::content, DatumGetCString(), DirectFunctionCall1, elog(), ERROR, escape_json(), i, jpiAbs, jpiAdd, jpiAnd, jpiAny, jpiAnyArray, jpiAnyKey, jpiBool, jpiCeiling, jpiCurrent, jpiDatetime, jpiDiv, jpiDouble, jpiEqual, jpiExists, jpiFilter, jpiFloor, jpiGreater, jpiGreaterOrEqual, jpiIndexArray, jpiIsUnknown, jpiKey, jpiKeyValue, jpiLast, jpiLess, jpiLessOrEqual, jpiLikeRegex, jpiMinus, jpiMod, jpiMul, jpiNot, jpiNotEqual, jpiNull, jpiNumeric, jpiOr, jpiPlus, jpiRoot, jpiSize, jpiStartsWith, jpiString, jpiSub, jpiType, jpiVariable, JSP_REGEX_DOTALL, JSP_REGEX_ICASE, JSP_REGEX_MLINE, JSP_REGEX_QUOTE, JSP_REGEX_WSPACE, jspGetArg(), jspGetArraySubscript(), jspGetBool(), jspGetLeftArg(), jspGetNext(), jspGetNumeric(), jspGetRightArg(), jspGetString(), jspHasNext, jspInitByBuffer(), jspOperationName(), JsonPathItem::like_regex, numeric_out(), NumericGetDatum(), operationPriority(), PG_UINT32_MAX, range(), and JsonPathItem::type.
Referenced by jsonPathToCstring().
|
static |
Definition at line 494 of file jsonpath.c.
References appendBinaryStringInfo(), and buf.
Referenced by flattenJsonPathParseItem().