PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "common/hashfn.h"
#include "miscadmin.h"
#include "nodes/queryjumble.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_LOCATION(location) RecordConstLocation(jstate, expr->location) |
#define | JUMBLE_FIELD(item) AppendJumble(jstate, (const unsigned char *) &(expr->item), sizeof(expr->item)) |
#define | JUMBLE_FIELD_SINGLE(item) AppendJumble(jstate, (const unsigned char *) &(item), sizeof(item)) |
#define | JUMBLE_STRING(str) |
Functions | |
static void | AppendJumble (JumbleState *jstate, const unsigned char *item, Size size) |
static void | RecordConstLocation (JumbleState *jstate, int location) |
static void | _jumbleNode (JumbleState *jstate, Node *node) |
static void | _jumbleA_Const (JumbleState *jstate, Node *node) |
static void | _jumbleList (JumbleState *jstate, Node *node) |
static void | _jumbleRangeTblEntry (JumbleState *jstate, Node *node) |
const char * | CleanQuerytext (const char *query, int *location, int *len) |
JumbleState * | JumbleQuery (Query *query, const char *querytext) |
void | EnableQueryId (void) |
Variables | |
int | compute_query_id = COMPUTE_QUERY_ID_AUTO |
bool | query_id_enabled = false |
#define JUMBLE_FIELD | ( | item | ) | AppendJumble(jstate, (const unsigned char *) &(expr->item), sizeof(expr->item)) |
Definition at line 218 of file queryjumblefuncs.c.
#define JUMBLE_FIELD_SINGLE | ( | item | ) | AppendJumble(jstate, (const unsigned char *) &(item), sizeof(item)) |
Definition at line 220 of file queryjumblefuncs.c.
#define JUMBLE_LOCATION | ( | location | ) | RecordConstLocation(jstate, expr->location) |
Definition at line 216 of file queryjumblefuncs.c.
#define JUMBLE_NODE | ( | item | ) | _jumbleNode(jstate, (Node *) expr->item) |
Definition at line 214 of file queryjumblefuncs.c.
#define JUMBLE_SIZE 1024 /* query serialization buffer size */ |
Definition at line 40 of file queryjumblefuncs.c.
#define JUMBLE_STRING | ( | str | ) |
Definition at line 222 of file queryjumblefuncs.c.
|
static |
Definition at line 318 of file queryjumblefuncs.c.
References elog(), ERROR, A_Const::isnull, JUMBLE_FIELD, JUMBLE_STRING, nodeTag, A_Const::val, and val.
|
static |
Definition at line 287 of file queryjumblefuncs.c.
References _jumbleNode(), elog(), ERROR, JUMBLE_FIELD_SINGLE, lfirst, lfirst_int, lfirst_oid, lfirst_xid, and List::type.
Referenced by _jumbleNode().
|
static |
Definition at line 231 of file queryjumblefuncs.c.
References _jumbleList(), check_stack_depth(), elog(), JumbleState::highest_extern_param_id, JUMBLE_FIELD, nodeTag, PARAM_EXTERN, Param::paramid, Param::paramkind, generate_unaccent_rules::type, and WARNING.
Referenced by _jumbleList(), and JumbleQuery().
|
static |
Definition at line 352 of file queryjumblefuncs.c.
References elog(), ERROR, functions, JUMBLE_FIELD, JUMBLE_NODE, JUMBLE_STRING, RTE_CTE, RTE_FUNCTION, RTE_JOIN, RTE_NAMEDTUPLESTORE, RTE_RELATION, RTE_RESULT, RTE_SUBQUERY, RTE_TABLEFUNC, RTE_VALUES, and RangeTblEntry::rtekind.
|
static |
Definition at line 156 of file queryjumblefuncs.c.
References DatumGetUInt64(), hash_any_extended(), JumbleState::jumble, JumbleState::jumble_len, JUMBLE_SIZE, and Min.
const char* CleanQuerytext | ( | const char * | query, |
int * | location, | ||
int * | len | ||
) |
Definition at line 61 of file queryjumblefuncs.c.
References Assert(), len, and scanner_isspace().
Referenced by pgss_store().
void EnableQueryId | ( | void | ) |
Definition at line 145 of file queryjumblefuncs.c.
References compute_query_id, COMPUTE_QUERY_ID_OFF, and query_id_enabled.
Referenced by _PG_init().
JumbleState* JumbleQuery | ( | Query * | query, |
const char * | querytext | ||
) |
Definition at line 100 of file queryjumblefuncs.c.
References _jumbleNode(), Assert(), JumbleState::clocations, JumbleState::clocations_buf_size, JumbleState::clocations_count, DatumGetUInt64(), hash_any_extended(), JumbleState::highest_extern_param_id, IsQueryIdEnabled(), JumbleState::jumble, JumbleState::jumble_len, JUMBLE_SIZE, palloc(), and Query::utilityStmt.
Referenced by ExplainQuery(), parse_analyze_fixedparams(), parse_analyze_varparams(), and parse_analyze_withcb().
|
static |
Definition at line 193 of file queryjumblefuncs.c.
References JumbleState::clocations, JumbleState::clocations_buf_size, JumbleState::clocations_count, LocationLen::length, LocationLen::location, and repalloc().
int compute_query_id = COMPUTE_QUERY_ID_AUTO |
Definition at line 43 of file queryjumblefuncs.c.
Referenced by EnableQueryId(), ExplainPrintPlan(), and IsQueryIdEnabled().
Definition at line 46 of file queryjumblefuncs.c.
Referenced by EnableQueryId(), and IsQueryIdEnabled().