OSDN Git Service

Fix compiling error on Solaris
[pghintplan/pg_hint_plan.git] / pg_stat_statements.c
index 6566d3b..b104dd6 100644 (file)
@@ -4,7 +4,7 @@
  * 
  * Part of pg_stat_statements.c in PostgreSQL 10.
  *
- * Copyright (c) 2008-2017, PostgreSQL Global Development Group
+ * Copyright (c) 2008-2019, PostgreSQL Global Development Group
  *
  *-------------------------------------------------------------------------
  */
@@ -48,8 +48,10 @@ AppendJumble(pgssJumbleState *jstate, const unsigned char *item, Size size)
 
                if (jumble_len >= JUMBLE_SIZE)
                {
-                       uint32          start_hash = hash_any(jumble, JUMBLE_SIZE);
+                       uint64          start_hash;
 
+                       start_hash = DatumGetUInt64(hash_any_extended(jumble,
+                                                                                                                 JUMBLE_SIZE, 0));
                        memcpy(jumble, &start_hash, sizeof(start_hash));
                        jumble_len = sizeof(start_hash);
                }
@@ -152,6 +154,8 @@ JumbleRangeTable(pgssJumbleState *jstate, List *rtable)
                        case RTE_NAMEDTUPLESTORE:
                                APP_JUMB_STRING(rte->enrname);
                                break;
+                       case RTE_RESULT:
+                               break;
                        default:
                                elog(ERROR, "unrecognized RTE kind: %d", (int) rte->rtekind);
                                break;
@@ -253,14 +257,14 @@ JumbleExpr(pgssJumbleState *jstate, Node *node)
                                JumbleExpr(jstate, (Node *) expr->aggfilter);
                        }
                        break;
-               case T_ArrayRef:
+               case T_SubscriptingRef:
                        {
-                               ArrayRef   *aref = (ArrayRef *) node;
+                               SubscriptingRef *sbsref = (SubscriptingRef *) node;
 
-                               JumbleExpr(jstate, (Node *) aref->refupperindexpr);
-                               JumbleExpr(jstate, (Node *) aref->reflowerindexpr);
-                               JumbleExpr(jstate, (Node *) aref->refexpr);
-                               JumbleExpr(jstate, (Node *) aref->refassgnexpr);
+                               JumbleExpr(jstate, (Node *) sbsref->refupperindexpr);
+                               JumbleExpr(jstate, (Node *) sbsref->reflowerindexpr);
+                               JumbleExpr(jstate, (Node *) sbsref->refexpr);
+                               JumbleExpr(jstate, (Node *) sbsref->refassgnexpr);
                        }
                        break;
                case T_FuncExpr:
@@ -354,6 +358,7 @@ JumbleExpr(pgssJumbleState *jstate, Node *node)
 
                                APP_JUMB(acexpr->resulttype);
                                JumbleExpr(jstate, (Node *) acexpr->arg);
+                               JumbleExpr(jstate, (Node *) acexpr->elemexpr);
                        }
                        break;
                case T_ConvertRowtypeExpr:
@@ -600,6 +605,7 @@ JumbleExpr(pgssJumbleState *jstate, Node *node)
 
                                /* we store the string name because RTE_CTE RTEs need it */
                                APP_JUMB_STRING(cte->ctename);
+                               APP_JUMB(cte->ctematerialized);
                                JumbleQuery(jstate, castNode(Query, cte->ctequery));
                        }
                        break;