OSDN Git Service

Fix compiling error on Solaris
[pgstoreplans/pg_store_plans.git] / pgsp_json_int.h
index eeaa0af..1273053 100644 (file)
@@ -2,10 +2,10 @@
  *
  * pgsp_json_int.h: Definitions for internal use for pgsp_json.c
  *
- * Copyright (c) 2012-2015, NIPPON TELEGRAPH AND TELEPHONE CORPORATION
+ * Copyright (c) 2012-2021, NIPPON TELEGRAPH AND TELEPHONE CORPORATION
  *
  * IDENTIFICATION
- *       pg_store_plan/pgsp_json_int.h
+ *       pg_store_plans/pgsp_json_int.h
  *
  *-------------------------------------------------------------------------
  */
@@ -25,7 +25,8 @@ typedef enum
        S_Invalid,
        S_Plain,
        S_Sorted,
-       S_Hashed
+       S_Hashed,
+       S_Mixed
 } pgsp_strategies;
 
 typedef const char *(converter_t)(const char *src, pgsp_parser_mode mode);
@@ -52,6 +53,11 @@ typedef enum
        P_Command,
        P_SortMethod,
        P_SortKey,
+       P_GroupKey,
+       P_GroupKeys,
+       P_GroupSets,
+       P_HashKeys,
+       P_HashKey,
        P_Filter,
        P_JoinFilter,
        P_HashCond,
@@ -65,6 +71,9 @@ typedef enum
        P_TriggerName,
        P_TrgRelation,
        P_ConstraintName,
+       P_Parallel,
+       P_PartialMode,
+       P_WorkersPlanned,
 
        P_FunctionCall,
        P_StartupCost,
@@ -92,6 +101,7 @@ typedef enum
        P_SortSpaceType,
        P_PeakMemoryUsage,
        P_OrgHashBatches,
+       P_OrgHashBuckets,
        P_HashBatches,
        P_HashBuckets,
        P_RowsFilterRmvd,
@@ -102,12 +112,34 @@ typedef enum
        P_ExecTime,
        P_ExactHeapBlks,
        P_LossyHeapBlks,
-       P_RowsJoinFltRemvd
+       P_RowsJoinFltRemvd,
+       P_TargetTables,
+       P_ConfRes,
+       P_ConfArbitIdx,
+       P_TuplesInserted,
+       P_ConfTuples,
+       P_SamplingMethod,
+       P_SamplingParams,
+       P_RepeatableSeed,
+       P_Workers,
+       P_WorkersLaunched,
+       P_WorkerNumber,
+       P_InnerUnique,
+       P_TableFuncName,
+       P_PresortedKey,
+       P_FullsortGroups,
+       P_SortMethodsUsed,
+       P_SortSpaceMemory,
+       P_GroupCount,
+       P_AvgSortSpcUsed,
+       P_PeakSortSpcUsed,
+       P_PreSortedGroups,
+       P_AsyncCapable
 } pgsp_prop_tags;
 
 typedef struct
 {
-       pgsp_prop_tags tag;             /* Tag to identify words */
+       int       tag;                          /* Tag to identify words */
        char *shortname;                /* Property name for short-style JSON */
        char *longname;                 /* Property name for long(normal)-style JSON */
        char *textname;                 /* Property name for Text representation */
@@ -126,7 +158,8 @@ typedef struct
        char       *org_string;         /* What to parse */
 
        /* Working variables used internally in parser */
-       int                     level;                  /* Next (indent) level */
+       int                     level;                  /* Next (indent or object) level */
+       Bitmapset  *plan_levels;        /* Level list for Plan objects */
        Bitmapset  *first;                      /* Bitmap set holds whether the first element
                                                                 * has been processed for each level */
        Bitmapset  *not_item;           /* Bitmap set holds whether the node name at
@@ -134,11 +167,17 @@ typedef struct
        bool            remove;                 /* True if the current node is not shown in
                                                                 * the result */
        bool            last_elem_is_object; /* True if the last processed element
-                                                                * was not an object */
-       pgsp_prop_tags  processing;     /* Tag of the word under processing */
+                                                                * was an object */
+       pgsp_prop_tags  section;        /* explain section under processing */
+       pgsp_prop_tags  current_list; /* current list tag that needs special treat*/
+       StringInfo work_str;            /* StringInfor for very-short term usage */
+       char       *list_fname;         /* the field name of the current_list */
        char       *fname;                      /* Field name*/
        char       *wbuf;                       /* Working buffer */
        int                     wbuflen;                /* Length of the working buffer */
+       int                     wlist_level;    /* Nest level of list for Grouping Sets */
+       grouping_set *tmp_gset; /* Working area for grouping sets */
+
        converter_t *valconverter;      /* field name converter for the current
                                                                 * element */
        setter_t    *setter;            /* value converter for the current element */
@@ -162,6 +201,7 @@ extern const char *conv_strategy(const char *src, pgsp_parser_mode mode);
 extern const char *conv_setsetopcommand(const char *src, pgsp_parser_mode mode);
 extern const char *conv_sortmethod(const char *src, pgsp_parser_mode mode);
 extern const char *conv_sortspacetype(const char *src, pgsp_parser_mode mode);
+extern const char *conv_partialmode(const char *src, pgsp_parser_mode mode);
 
 extern bool run_pg_parse_json(JsonLexContext *lex, JsonSemAction *sem);
 extern void init_parser_context(pgspParserContext *ctx, int mode,