]> granicus.if.org Git - postgresql/commitdiff
Add missing handling of PlannedStmt.transientPlan in copyfuncs/outfuncs.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 18 Aug 2010 15:22:15 +0000 (15:22 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 18 Aug 2010 15:22:15 +0000 (15:22 +0000)
_outPlannedStmt is only debug support, so the omission there was not very
serious, but the omission in _copyPlannedStmt is a real bug.  The consequence
would be that a copied plan tree would never be marked as a transient plan,
so that we would forget we ought to replan it after some not-yet-ready index
becomes ready for use.  This might explain some past complaints about indexes
created with CREATE INDEX CONCURRENTLY not being used right away.  Problem
spotted by Yeb Havinga.

Back-patch to 8.3, where the field was added.

src/backend/nodes/copyfuncs.c
src/backend/nodes/outfuncs.c

index f6581bbe44fc1287ce712a9b750822764f206b31..b927f41e205e9c78dc02c5ae4f548dc80bfb1747 100644 (file)
@@ -15,7 +15,7 @@
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.388.2.1 2009/04/16 20:42:27 tgl Exp $
+ *       $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.388.2.2 2010/08/18 15:22:15 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -74,6 +74,7 @@ _copyPlannedStmt(PlannedStmt *from)
 
        COPY_SCALAR_FIELD(commandType);
        COPY_SCALAR_FIELD(canSetTag);
+       COPY_SCALAR_FIELD(transientPlan);
        COPY_NODE_FIELD(planTree);
        COPY_NODE_FIELD(rtable);
        COPY_NODE_FIELD(resultRelations);
index da069b8877c0abcb759f4e16500620c3d578803d..ac0aa573bf87da7413f1f14f611037c42bc2aeb9 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.322.2.2 2009/04/16 20:42:28 tgl Exp $
+ *       $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.322.2.3 2010/08/18 15:22:15 tgl Exp $
  *
  * NOTES
  *       Every node type that can appear in stored rules' parsetrees *must*
@@ -241,6 +241,7 @@ _outPlannedStmt(StringInfo str, PlannedStmt *node)
 
        WRITE_ENUM_FIELD(commandType, CmdType);
        WRITE_BOOL_FIELD(canSetTag);
+       WRITE_BOOL_FIELD(transientPlan);
        WRITE_NODE_FIELD(planTree);
        WRITE_NODE_FIELD(rtable);
        WRITE_NODE_FIELD(resultRelations);