This is an automated email from the ASF dual-hosted git repository.
chenjinbao1989 pushed a commit to branch cbdb-postgres-merge
in repository https://gitbox.apache.org/repos/asf/cloudberry.git
The following commit(s) were added to refs/heads/cbdb-postgres-merge by this
push:
new 2cf1b451fb9 Remove nodes/queryjumble.h
2cf1b451fb9 is described below
commit 2cf1b451fb9434203a846228db14fe99cea85a4b
Author: Jinbao Chen <[email protected]>
AuthorDate: Tue Dec 2 00:07:21 2025 +0800
Remove nodes/queryjumble.h
---
src/backend/parser/analyze.c | 8 ++--
src/include/nodes/queryjumble.h | 87 -----------------------------------------
2 files changed, 4 insertions(+), 91 deletions(-)
diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c
index bf4a6de1b15..cfb1abb9a3c 100644
--- a/src/backend/parser/analyze.c
+++ b/src/backend/parser/analyze.c
@@ -34,7 +34,6 @@
#include "miscadmin.h"
#include "nodes/makefuncs.h"
#include "nodes/nodeFuncs.h"
-#include "nodes/queryjumble.h"
#include "optimizer/optimizer.h"
#include "optimizer/plancat.h"
#include "optimizer/tlist.h"
@@ -57,6 +56,7 @@
#include "utils/backend_status.h"
#include "utils/builtins.h"
#include "utils/guc.h"
+#include "utils/queryjumble.h"
#include "utils/rel.h"
#include "utils/syscache.h"
@@ -173,7 +173,7 @@ parse_analyze_fixedparams(RawStmt *parseTree, const char
*sourceText,
query = transformTopLevelStmt(pstate, parseTree);
if (IsQueryIdEnabled())
- jstate = JumbleQuery(query);
+ jstate = JumbleQuery(query, sourceText);
if (post_parse_analyze_hook)
(*post_parse_analyze_hook) (pstate, query, jstate);
@@ -215,7 +215,7 @@ parse_analyze_varparams(RawStmt *parseTree, const char
*sourceText,
check_variable_parameters(pstate, query);
if (IsQueryIdEnabled())
- jstate = JumbleQuery(query);
+ jstate = JumbleQuery(query, sourceText);
if (post_parse_analyze_hook)
(*post_parse_analyze_hook) (pstate, query, jstate);
@@ -252,7 +252,7 @@ parse_analyze_withcb(RawStmt *parseTree, const char
*sourceText,
query = transformTopLevelStmt(pstate, parseTree);
if (IsQueryIdEnabled())
- jstate = JumbleQuery(query);
+ jstate = JumbleQuery(query, sourceText);
if (post_parse_analyze_hook)
(*post_parse_analyze_hook) (pstate, query, jstate);
diff --git a/src/include/nodes/queryjumble.h b/src/include/nodes/queryjumble.h
deleted file mode 100644
index a63eb809ada..00000000000
--- a/src/include/nodes/queryjumble.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*-------------------------------------------------------------------------
- *
- * queryjumble.h
- * Query normalization and fingerprinting.
- *
- * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
- * Portions Copyright (c) 1994, Regents of the University of California
- *
- * IDENTIFICATION
- * src/include/nodes/queryjumble.h
- *
- *-------------------------------------------------------------------------
- */
-#ifndef QUERYJUMBLE_H
-#define QUERYJUMBLE_H
-
-#include "nodes/parsenodes.h"
-
-/*
- * Struct for tracking locations/lengths of constants during normalization
- */
-typedef struct LocationLen
-{
- int location; /* start offset in
query text */
- int length; /* length in bytes, or
-1 to ignore */
-} LocationLen;
-
-/*
- * Working state for computing a query jumble and producing a normalized
- * query string
- */
-typedef struct JumbleState
-{
- /* Jumble of current query tree */
- unsigned char *jumble;
-
- /* Number of bytes used in jumble[] */
- Size jumble_len;
-
- /* Array of locations of constants that should be removed */
- LocationLen *clocations;
-
- /* Allocated length of clocations array */
- int clocations_buf_size;
-
- /* Current number of valid entries in clocations array */
- int clocations_count;
-
- /* highest Param id we've seen, in order to start normalization
correctly */
- int highest_extern_param_id;
-} JumbleState;
-
-/* Values for the compute_query_id GUC */
-enum ComputeQueryIdType
-{
- COMPUTE_QUERY_ID_OFF,
- COMPUTE_QUERY_ID_ON,
- COMPUTE_QUERY_ID_AUTO,
- COMPUTE_QUERY_ID_REGRESS
-};
-
-/* GUC parameters */
-extern PGDLLIMPORT int compute_query_id;
-
-
-extern const char *CleanQuerytext(const char *query, int *location, int *len);
-extern JumbleState *JumbleQuery(Query *query);
-extern JumbleState *JumbleQueryDirect(Query *query, const char *querytext);
-extern void EnableQueryId(void);
-
-extern PGDLLIMPORT bool query_id_enabled;
-
-/*
- * Returns whether query identifier computation has been enabled, either
- * directly in the GUC or by a module when the setting is 'auto'.
- */
-static inline bool
-IsQueryIdEnabled(void)
-{
- if (compute_query_id == COMPUTE_QUERY_ID_OFF)
- return false;
- if (compute_query_id == COMPUTE_QUERY_ID_ON)
- return true;
- return query_id_enabled;
-}
-
-#endif /* QUERYJUMBLE_H */
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]