diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/nodes/queryjumblefuncs.c | 35 | ||||
-rw-r--r-- | src/include/nodes/parsenodes.h | 2 |
2 files changed, 36 insertions, 1 deletions
diff --git a/src/backend/nodes/queryjumblefuncs.c b/src/backend/nodes/queryjumblefuncs.c index 223d1bc8262..d7fd72d70f2 100644 --- a/src/backend/nodes/queryjumblefuncs.c +++ b/src/backend/nodes/queryjumblefuncs.c @@ -49,6 +49,7 @@ 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); @@ -314,6 +315,40 @@ _jumbleList(JumbleState *jstate, Node *node) } static void +_jumbleA_Const(JumbleState *jstate, Node *node) +{ + A_Const *expr = (A_Const *) node; + + JUMBLE_FIELD(isnull); + if (!expr->isnull) + { + JUMBLE_FIELD(val.node.type); + switch (nodeTag(&expr->val)) + { + case T_Integer: + JUMBLE_FIELD(val.ival.ival); + break; + case T_Float: + JUMBLE_STRING(val.fval.fval); + break; + case T_Boolean: + JUMBLE_FIELD(val.boolval.boolval); + break; + case T_String: + JUMBLE_STRING(val.sval.sval); + break; + case T_BitString: + JUMBLE_STRING(val.bsval.bsval); + break; + default: + elog(ERROR, "unrecognized node type: %d", + (int) nodeTag(&expr->val)); + break; + } + } +} + +static void _jumbleRangeTblEntry(JumbleState *jstate, Node *node) { RangeTblEntry *expr = (RangeTblEntry *) node; diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h index 3d67787e7af..855da99ec02 100644 --- a/src/include/nodes/parsenodes.h +++ b/src/include/nodes/parsenodes.h @@ -355,7 +355,7 @@ union ValUnion typedef struct A_Const { - pg_node_attr(custom_copy_equal, custom_read_write) + pg_node_attr(custom_copy_equal, custom_read_write, custom_query_jumble) NodeTag type; union ValUnion val; |