OSDN Git Service

Add forgot upgrade sql file
[pgstoreplans/pg_store_plans.git] / pgsp_json_text.c
index ffd1067..5002943 100644 (file)
@@ -2,7 +2,7 @@
  *
  * pgsp_json_text.h: Text plan generator for pg_store_plans.
  *
- * Copyright (c) 2012-2020, NIPPON TELEGRAPH AND TELEPHONE CORPORATION
+ * Copyright (c) 2012-2021, NIPPON TELEGRAPH AND TELEPHONE CORPORATION
  *
  * IDENTIFICATION
  *       pg_store_plans/pgsp_json_text.c
@@ -85,7 +85,7 @@ SETTERDECL(node_type)
 SETTERDECL(strategy)
 {
        word_table *p;
-       
+
        p = search_word_table(strategies, val, PGSP_JSON_TEXTIZE);
 
        if (!p)
@@ -190,6 +190,7 @@ DEFAULT_SETTER(worker_number);
 DEFAULT_SETTER(workers_planned);
 DEFAULT_SETTER(workers_launched);
 BOOL_SETTER(inner_unique);
+BOOL_SETTER(async_capable);
 DEFAULT_SETTER(table_func_name);
 LIST_SETTER(presorted_key);
 LIST_SETTER(sortmethod_used);
@@ -311,7 +312,7 @@ print_prop_if_nz(StringInfo s, char *prepstr,
                print_prop(s, prepstr, prop, level, exind);
 }
 
-static void 
+static void
 print_current_node(pgspParserContext *ctx)
 {
        node_vals *v = ctx->nodevals;
@@ -326,7 +327,7 @@ print_current_node(pgspParserContext *ctx)
         * would be named T_Worker if there were in node.h. So it needs a special
         * treat.
         */
-       
+
        if (v->node_type == T_Invalid && !HASSTRING(v->worker_number))
                return;
 
@@ -349,6 +350,9 @@ print_current_node(pgspParserContext *ctx)
        if (v->parallel_aware)
                appendStringInfoString(s, "Parallel ");
 
+       if (v->async_capable)
+               appendStringInfoString(s, "Async ");
+
        switch (v->nodetag)
        {
                case T_ModifyTable:
@@ -403,7 +407,7 @@ print_current_node(pgspParserContext *ctx)
                                appendStringInfoString(s, "Worker");
                                print_prop_if_exists(s, " ", v->worker_number, 0, 0);
 
-                               /* 
+                               /*
                                 * "Worker"s are individual JSON objects in a JSON list but
                                 * should be printed as just a property in text
                                 * representaion. Correct indent using exind here.
@@ -466,7 +470,7 @@ print_current_node(pgspParserContext *ctx)
                appendStringInfoSpaces(s, TEXT_INDENT_DETAILS(level, exind));
                appendStringInfoString(s, str);
        }
-               
+
        print_propstr_if_exists(s, "Output: ", v->output, level, exind);
        print_propstr_if_exists(s, "Group Key: ", v->group_key, level, exind);
        print_groupingsets_if_exists(s, v->grouping_sets, level, exind);
@@ -489,7 +493,7 @@ print_current_node(pgspParserContext *ctx)
                if (v->repeatable_seed)
                        appendStringInfo(s, " REPEATABLE (%s)", v->repeatable_seed);
        }
-       
+
        print_propstr_if_exists(s, "Sort Key: ", v->sort_key, level, exind);
        if (HASSTRING(v->sort_method))
        {
@@ -699,7 +703,7 @@ print_current_node(pgspParserContext *ctx)
                /* Feed a line if any of Buffers: items has been shown */
                if (comma)
                        appendStringInfoString(s, "\n");
-                       
+
                appendStringInfoSpaces(s, TEXT_INDENT_DETAILS(level, exind));
                appendStringInfoString(s, "I/O Timings: ");
 
@@ -810,7 +814,7 @@ json_text_objend(void *state)
                }
 
                /* Move working grouping set into nodevals */
-               ctx->nodevals->grouping_sets = 
+               ctx->nodevals->grouping_sets =
                        lappend(v->grouping_sets, ctx->tmp_gset);
                ctx->tmp_gset = NULL;
        }
@@ -819,7 +823,7 @@ json_text_objend(void *state)
        ctx->level--;
 }
 
-static void 
+static void
 json_text_arrstart(void *state)
 {
        pgspParserContext *ctx = (pgspParserContext *)state;
@@ -1031,7 +1035,7 @@ pgsp_json_textize(char *json)
                if (ctx.dest->len > 0 &&
                        ctx.dest->data[ctx.dest->len - 1] != '\n')
                        appendStringInfoChar(ctx.dest, '\n');
-               
+
                if (ctx.dest->len == 0)
                        appendStringInfoString(ctx.dest, "<Input was not JSON>");
                else