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) _jumbleElements(jstate, (List *) expr->list) |
#define | JUMBLE_LOCATION(location) RecordConstLocation(jstate, expr->location, false) |
#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 uint64 | 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, int location, bool squashed) |
static void | _jumbleNode (JumbleState *jstate, Node *node) |
static void | _jumbleElements (JumbleState *jstate, List *elements) |
static void | _jumbleA_Const (JumbleState *jstate, Node *node) |
static void | _jumbleList (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 | IsSquashableConst (Node *element) |
static bool | IsSquashableConstList (List *elements, Node **firstExpr, Node **lastExpr) |
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 514 of file queryjumblefuncs.c.
#define JUMBLE_ELEMENTS | ( | list | ) | _jumbleElements(jstate, (List *) expr->list) |
Definition at line 489 of file queryjumblefuncs.c.
#define JUMBLE_FIELD | ( | item | ) |
Definition at line 493 of file queryjumblefuncs.c.
#define JUMBLE_LOCATION | ( | location | ) | RecordConstLocation(jstate, expr->location, false) |
Definition at line 491 of file queryjumblefuncs.c.
#define JUMBLE_NODE | ( | item | ) | _jumbleNode(jstate, (Node *) expr->item) |
Definition at line 487 of file queryjumblefuncs.c.
#define JUMBLE_SIZE 1024 /* query serialization buffer size */ |
Definition at line 44 of file queryjumblefuncs.c.
#define JUMBLE_STRING | ( | str | ) |
Definition at line 506 of file queryjumblefuncs.c.
|
static |
Definition at line 652 of file queryjumblefuncs.c.
References elog, ERROR, A_Const::isnull, JUMBLE_FIELD, JUMBLE_STRING, nodeTag, A_Const::val, and val.
|
static |
Definition at line 526 of file queryjumblefuncs.c.
References _jumbleNode(), exprLocation(), IsSquashableConstList(), and RecordConstLocation().
|
static |
Definition at line 621 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 556 of file queryjumblefuncs.c.
References _jumbleList(), AppendJumbleNull(), Assert(), check_stack_depth(), elog, JumbleState::highest_extern_param_id, JUMBLE_FIELD, nodeTag, PARAM_EXTERN, Param::paramid, Param::paramkind, type, and WARNING.
Referenced by _jumbleElements(), _jumbleList(), and DoJumble().
|
static |
Definition at line 707 of file queryjumblefuncs.c.
References JUMBLE_FIELD, JUMBLE_STRING, and type.
|
static |
Definition at line 686 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 285 of file queryjumblefuncs.c.
References AppendJumbleInternal(), FlushPendingNulls(), JumbleState::pending_nulls, and value.
|
static |
Definition at line 322 of file queryjumblefuncs.c.
References AppendJumbleInternal(), FlushPendingNulls(), JumbleState::pending_nulls, and value.
|
static |
Definition at line 336 of file queryjumblefuncs.c.
References AppendJumbleInternal(), FlushPendingNulls(), JumbleState::pending_nulls, and value.
Referenced by _jumbleList().
|
static |
Definition at line 350 of file queryjumblefuncs.c.
References AppendJumbleInternal(), FlushPendingNulls(), JumbleState::pending_nulls, and value.
|
static |
Definition at line 308 of file queryjumblefuncs.c.
References AppendJumbleInternal(), FlushPendingNulls(), JumbleState::pending_nulls, and value.
|
static |
Definition at line 222 of file queryjumblefuncs.c.
References Assert(), DatumGetUInt64(), 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 298 of file queryjumblefuncs.c.
References JumbleState::pending_nulls.
Referenced by _jumbleNode().
const char * CleanQuerytext | ( | const char * | query, |
int * | location, | ||
int * | len | ||
) |
Definition at line 79 of file queryjumblefuncs.c.
References Assert(), len, and scanner_isspace().
Referenced by pgss_store(), and script_error_callback().
|
static |
Definition at line 201 of file queryjumblefuncs.c.
References _jumbleNode(), DatumGetUInt64(), FlushPendingNulls(), hash_any_extended(), JumbleState::jumble, JumbleState::jumble_len, and JumbleState::pending_nulls.
Referenced by JumbleQuery().
void EnableQueryId | ( | void | ) |
Definition at line 162 of file queryjumblefuncs.c.
References compute_query_id, COMPUTE_QUERY_ID_OFF, and query_id_enabled.
Referenced by _PG_init().
|
static |
Definition at line 365 of file queryjumblefuncs.c.
References AppendJumbleInternal(), Assert(), and JumbleState::pending_nulls.
Referenced by AppendJumble(), AppendJumble16(), AppendJumble32(), AppendJumble64(), AppendJumble8(), and DoJumble().
|
static |
Definition at line 173 of file queryjumblefuncs.c.
References JumbleState::clocations, JumbleState::clocations_buf_size, JumbleState::clocations_count, JumbleState::highest_extern_param_id, JumbleState::jumble, JumbleState::jumble_len, JUMBLE_SIZE, palloc(), and JumbleState::pending_nulls.
Referenced by JumbleQuery().
|
static |
Definition at line 416 of file queryjumblefuncs.c.
References arg, FuncExpr::args, COERCE_EXPLICIT_CAST, COERCE_IMPLICIT_CAST, element(), FirstGenbkiObjectId, FuncExpr::funcid, IsA, and lfirst.
Referenced by IsSquashableConstList().
Definition at line 464 of file queryjumblefuncs.c.
References IsSquashableConst(), lfirst, linitial, list_length(), and llast.
Referenced by _jumbleElements().
JumbleState * JumbleQuery | ( | Query * | query | ) |
Definition at line 130 of file queryjumblefuncs.c.
References Assert(), DoJumble(), InitJumble(), IsQueryIdEnabled(), UINT64CONST, and Query::utilityStmt.
Referenced by ExecCreateTableAs(), ExplainOneUtility(), ExplainQuery(), parse_analyze_fixedparams(), parse_analyze_varparams(), parse_analyze_withcb(), and PerformCursorOpen().
|
static |
Definition at line 384 of file queryjumblefuncs.c.
References JumbleState::clocations, JumbleState::clocations_buf_size, JumbleState::clocations_count, LocationLen::length, LocationLen::location, repalloc(), and LocationLen::squashed.
Referenced by _jumbleElements().
int compute_query_id = COMPUTE_QUERY_ID_AUTO |
Definition at line 47 of file queryjumblefuncs.c.
Referenced by EnableQueryId(), ExplainPrintPlan(), and IsQueryIdEnabled().
bool query_id_enabled = false |
Definition at line 56 of file queryjumblefuncs.c.
Referenced by EnableQueryId(), and IsQueryIdEnabled().