|
PostgreSQL Source Code git master
|
#include "postgres.h"#include "access/transam.h"#include "catalog/pg_proc.h"#include "common/hashfn.h"#include "miscadmin.h"#include "nodes/nodeFuncs.h"#include "nodes/queryjumble.h"#include "utils/lsyscache.h"#include "parser/scansup.h"#include "queryjumblefuncs.funcs.c"#include "queryjumblefuncs.switch.c"
Go to the source code of this file.
Macros | |
| #define | JUMBLE_SIZE 1024 /* query serialization buffer size */ |
| #define | JUMBLE_NODE(item) _jumbleNode(jstate, (Node *) expr->item) |
| #define | JUMBLE_ELEMENTS(list, node) _jumbleElements(jstate, (List *) expr->list, node) |
| #define | JUMBLE_LOCATION(location) RecordConstLocation(jstate, false, expr->location, -1) |
| #define | JUMBLE_FIELD(item) |
| #define | JUMBLE_STRING(str) |
| #define | JUMBLE_CUSTOM(nodetype, item) _jumble##nodetype##_##item(jstate, expr, expr->item) |
Functions | |
| static JumbleState * | InitJumble (void) |
| static int64 | DoJumble (JumbleState *jstate, Node *node) |
| static void | AppendJumble (JumbleState *jstate, const unsigned char *value, Size size) |
| static void | FlushPendingNulls (JumbleState *jstate) |
| static void | RecordConstLocation (JumbleState *jstate, bool extern_param, int location, int len) |
| static void | _jumbleNode (JumbleState *jstate, Node *node) |
| static void | _jumbleList (JumbleState *jstate, Node *node) |
| static void | _jumbleElements (JumbleState *jstate, List *elements, Node *node) |
| static void | _jumbleParam (JumbleState *jstate, Node *node) |
| static void | _jumbleA_Const (JumbleState *jstate, Node *node) |
| static void | _jumbleVariableSetStmt (JumbleState *jstate, Node *node) |
| static void | _jumbleRangeTblEntry_eref (JumbleState *jstate, RangeTblEntry *rte, Alias *expr) |
| const char * | CleanQuerytext (const char *query, int *location, int *len) |
| JumbleState * | JumbleQuery (Query *query) |
| void | EnableQueryId (void) |
| static pg_attribute_always_inline void | AppendJumbleInternal (JumbleState *jstate, const unsigned char *item, Size size) |
| static pg_attribute_always_inline void | AppendJumbleNull (JumbleState *jstate) |
| static pg_noinline void | AppendJumble8 (JumbleState *jstate, const unsigned char *value) |
| static pg_noinline void | AppendJumble16 (JumbleState *jstate, const unsigned char *value) |
| static pg_noinline void | AppendJumble32 (JumbleState *jstate, const unsigned char *value) |
| static pg_noinline void | AppendJumble64 (JumbleState *jstate, const unsigned char *value) |
| static bool | IsSquashableConstant (Node *element) |
| static bool | IsSquashableConstantList (List *elements) |
Variables | |
| int | compute_query_id = COMPUTE_QUERY_ID_AUTO |
| bool | query_id_enabled = false |
| #define JUMBLE_CUSTOM | ( | nodetype, | |
| item | |||
| ) | _jumble##nodetype##_##item(jstate, expr, expr->item) |
Definition at line 555 of file queryjumblefuncs.c.
| #define JUMBLE_ELEMENTS | ( | list, | |
| node | |||
| ) | _jumbleElements(jstate, (List *) expr->list, node) |
Definition at line 530 of file queryjumblefuncs.c.
| #define JUMBLE_FIELD | ( | item | ) |
Definition at line 534 of file queryjumblefuncs.c.
| #define JUMBLE_LOCATION | ( | location | ) | RecordConstLocation(jstate, false, expr->location, -1) |
Definition at line 532 of file queryjumblefuncs.c.
| #define JUMBLE_NODE | ( | item | ) | _jumbleNode(jstate, (Node *) expr->item) |
Definition at line 528 of file queryjumblefuncs.c.
| #define JUMBLE_SIZE 1024 /* query serialization buffer size */ |
Definition at line 49 of file queryjumblefuncs.c.
| #define JUMBLE_STRING | ( | str | ) |
Definition at line 547 of file queryjumblefuncs.c.
|
static |
Definition at line 710 of file queryjumblefuncs.c.
References elog, ERROR, A_Const::isnull, JUMBLE_FIELD, JUMBLE_STRING, nodeTag, A_Const::val, and val.
|
static |
Definition at line 647 of file queryjumblefuncs.c.
References _jumbleNode(), JumbleState::has_squashed_lists, IsA, IsSquashableConstantList(), ArrayExpr::list_end, ArrayExpr::list_start, and RecordConstLocation().
|
static |
Definition at line 606 of file queryjumblefuncs.c.
References _jumbleNode(), AppendJumble32(), elog, ERROR, lfirst, lfirst_int, lfirst_oid, lfirst_xid, and List::type.
Referenced by _jumbleNode().
|
static |
Definition at line 561 of file queryjumblefuncs.c.
References _jumbleList(), AppendJumbleNull(), Assert(), check_stack_depth(), elog, JUMBLE_FIELD, nodeTag, type, and WARNING.
Referenced by _jumbleElements(), _jumbleList(), and DoJumble().
|
static |
Definition at line 680 of file queryjumblefuncs.c.
References JumbleState::highest_extern_param_id, JUMBLE_FIELD, Param::location, PARAM_EXTERN, Param::paramid, Param::paramkind, and RecordConstLocation().
|
static |
Definition at line 765 of file queryjumblefuncs.c.
References JUMBLE_FIELD, JUMBLE_STRING, and type.
|
static |
Definition at line 744 of file queryjumblefuncs.c.
References generate_unaccent_rules::args, VariableSetStmt::jumble_args, JUMBLE_FIELD, JUMBLE_LOCATION, JUMBLE_NODE, JUMBLE_STRING, and name.
|
static |
Definition at line 297 of file queryjumblefuncs.c.
References AppendJumbleInternal(), FlushPendingNulls(), JumbleState::pending_nulls, and value.
|
static |
Definition at line 334 of file queryjumblefuncs.c.
References AppendJumbleInternal(), FlushPendingNulls(), JumbleState::pending_nulls, and value.
|
static |
Definition at line 348 of file queryjumblefuncs.c.
References AppendJumbleInternal(), FlushPendingNulls(), JumbleState::pending_nulls, and value.
Referenced by _jumbleList().
|
static |
Definition at line 362 of file queryjumblefuncs.c.
References AppendJumbleInternal(), FlushPendingNulls(), JumbleState::pending_nulls, and value.
|
static |
Definition at line 320 of file queryjumblefuncs.c.
References AppendJumbleInternal(), FlushPendingNulls(), JumbleState::pending_nulls, and value.
|
static |
Definition at line 234 of file queryjumblefuncs.c.
References Assert(), DatumGetInt64(), hash_any_extended(), JumbleState::jumble, JumbleState::jumble_len, JUMBLE_SIZE, likely, Min, and unlikely.
Referenced by AppendJumble(), AppendJumble16(), AppendJumble32(), AppendJumble64(), AppendJumble8(), and FlushPendingNulls().
|
static |
Definition at line 310 of file queryjumblefuncs.c.
References JumbleState::pending_nulls.
Referenced by _jumbleNode().
| const char * CleanQuerytext | ( | const char * | query, |
| int * | location, | ||
| int * | len | ||
| ) |
Definition at line 86 of file queryjumblefuncs.c.
References Assert(), len, and scanner_isspace().
Referenced by pgss_store(), and script_error_callback().
|
static |
Definition at line 209 of file queryjumblefuncs.c.
References _jumbleNode(), DatumGetInt64(), FlushPendingNulls(), JumbleState::has_squashed_lists, hash_any_extended(), JumbleState::highest_extern_param_id, JumbleState::jumble, JumbleState::jumble_len, and JumbleState::pending_nulls.
Referenced by JumbleQuery().
| void EnableQueryId | ( | void | ) |
Definition at line 169 of file queryjumblefuncs.c.
References compute_query_id, COMPUTE_QUERY_ID_OFF, and query_id_enabled.
Referenced by _PG_init().
|
static |
Definition at line 377 of file queryjumblefuncs.c.
References AppendJumbleInternal(), Assert(), and JumbleState::pending_nulls.
Referenced by AppendJumble(), AppendJumble16(), AppendJumble32(), AppendJumble64(), AppendJumble8(), and DoJumble().
|
static |
Definition at line 180 of file queryjumblefuncs.c.
References JumbleState::clocations, JumbleState::clocations_buf_size, JumbleState::clocations_count, JumbleState::has_squashed_lists, JumbleState::highest_extern_param_id, JumbleState::jumble, JumbleState::jumble_len, JUMBLE_SIZE, palloc(), and JumbleState::pending_nulls.
Referenced by JumbleQuery().
|
static |
Definition at line 437 of file queryjumblefuncs.c.
References arg, FuncExpr::args, castNode, COERCE_EXPLICIT_CAST, COERCE_IMPLICIT_CAST, element(), FirstGenbkiObjectId, foreach_current_index, FuncExpr::funcid, IsA, IsSquashableConstant(), lfirst, nodeTag, PARAM_EXTERN, and stack_is_too_deep().
Referenced by IsSquashableConstant(), and IsSquashableConstantList().
|
static |
Definition at line 511 of file queryjumblefuncs.c.
References IsSquashableConstant(), lfirst, and list_length().
Referenced by _jumbleElements().
| JumbleState * JumbleQuery | ( | Query * | query | ) |
Definition at line 137 of file queryjumblefuncs.c.
References Assert(), DoJumble(), InitJumble(), INT64CONST, IsQueryIdEnabled(), and Query::utilityStmt.
Referenced by ExecCreateTableAs(), ExplainOneUtility(), ExplainQuery(), parse_analyze_fixedparams(), parse_analyze_varparams(), parse_analyze_withcb(), and PerformCursorOpen().
|
static |
Definition at line 398 of file queryjumblefuncs.c.
References Assert(), JumbleState::clocations, JumbleState::clocations_buf_size, JumbleState::clocations_count, LocationLen::extern_param, len, LocationLen::length, LocationLen::location, repalloc(), and LocationLen::squashed.
Referenced by _jumbleElements(), and _jumbleParam().
| int compute_query_id = COMPUTE_QUERY_ID_AUTO |
Definition at line 52 of file queryjumblefuncs.c.
Referenced by EnableQueryId(), ExplainPrintPlan(), and IsQueryIdEnabled().
| bool query_id_enabled = false |
Definition at line 61 of file queryjumblefuncs.c.
Referenced by EnableQueryId(), and IsQueryIdEnabled().