OSDN Git Service

Fix boolean setter declaration
authorKyotaro Horiguchi <horiguchi.kyotaro@lab.ntt.co.jp>
Tue, 22 Jan 2019 08:14:21 +0000 (17:14 +0900)
committerKyotaro Horiguchi <horiguchi.kyotaro@lab.ntt.co.jp>
Tue, 22 Jan 2019 09:20:33 +0000 (18:20 +0900)
BOOL_SETTER ignores given name and always sets value to the member
"parallel_aware". When inner_uniue comes after parallel_aware, the
former overrides the latter and the latter doesn't get the right
value.  As the result the following JSON plan is wrongly converted as
"Parallel Join".

select pg_store_plans_textplan('{"Plans":[{"Node Type":"Join","Parallel Aware":false,"Inner Unique":true}]}');

Currently only "Inner Unique" hits this.

pgsp_json_text.h

index 2156084..ecee8bd 100644 (file)
@@ -119,7 +119,7 @@ typedef struct
        SETTERDECL(name) { vals->name = quote_identifier(val);}
 
 #define BOOL_SETTER(name) \
-       SETTERDECL(name) { vals->parallel_aware = (strcmp(val, "true") == 0 ? 1 : 0);}
+       SETTERDECL(name) { vals->name = (strcmp(val, "true") == 0 ? 1 : 0);}
 
 #define LIST_SETTER(name) \
        SETTERDECL(name) { \