]> granicus.if.org Git - postgresql/commitdiff
Clean up ill-advised attempt to invent a private set of Node tags.
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 6 Aug 2011 18:53:49 +0000 (14:53 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 6 Aug 2011 18:53:49 +0000 (14:53 -0400)
Somebody thought it'd be cute to invent a set of Node tag numbers that were
defined independently of, and indeed conflicting with, the main tag-number
list.  While this accidentally failed to fail so far, it would certainly
lead to trouble as soon as anyone wanted to, say, apply copyObject to these
node types.  Clang was already complaining about the use of makeNode on
these tags, and I think quite rightly so.  Fix by pushing these node
definitions into the mainstream, including putting replnodes.h where it
belongs.

src/backend/replication/repl_gram.y
src/backend/replication/walsender.c
src/include/nodes/nodes.h
src/include/nodes/replnodes.h [moved from src/include/replication/replnodes.h with 80% similarity]
src/include/replication/basebackup.h

index 4930ad1d097c6e8ddfee8b117cdf95c47a5505da..d99708ca8ebb3c29564e0031282b61ea9e47770e 100644 (file)
 #include "postgres.h"
 
 #include "nodes/makefuncs.h"
-#include "nodes/parsenodes.h"
-#include "replication/replnodes.h"
+#include "nodes/replnodes.h"
 #include "replication/walsender.h"
 
+
 /* Result of the parsing is returned here */
 Node *replication_parse_result;
 
index 63a63048dbb90fc4002108753f98c069a1dd1c00..7f83a32c0c4facc1fc02b98815079fa71a82e7ea 100644 (file)
 #include <signal.h>
 #include <unistd.h>
 
-#include "funcapi.h"
-#include "access/xlog_internal.h"
 #include "access/transam.h"
+#include "access/xlog_internal.h"
 #include "catalog/pg_type.h"
+#include "funcapi.h"
 #include "libpq/libpq.h"
 #include "libpq/pqformat.h"
 #include "libpq/pqsignal.h"
 #include "miscadmin.h"
+#include "nodes/replnodes.h"
 #include "replication/basebackup.h"
-#include "replication/replnodes.h"
 #include "replication/walprotocol.h"
 #include "replication/walreceiver.h"
 #include "replication/walsender.h"
index d8bc6b82143ee2d5e0030523896d2ae6506b7be7..ecf62b335b6b1b7f2d7bf202bc0d860424474cf4 100644 (file)
@@ -402,6 +402,13 @@ typedef enum NodeTag
        T_WithClause,
        T_CommonTableExpr,
 
+       /*
+        * TAGS FOR REPLICATION GRAMMAR PARSE NODES (replnodes.h)
+        */
+       T_IdentifySystemCmd,
+       T_BaseBackupCmd,
+       T_StartReplicationCmd,
+
        /*
         * TAGS FOR RANDOM OTHER STUFF
         *
similarity index 80%
rename from src/include/replication/replnodes.h
rename to src/include/nodes/replnodes.h
index e027f9203b9879227a86b3dc4d563893dfd12436..8cbd18a24c9703ef8d7084372e7702a6ccd9686a 100644 (file)
@@ -7,7 +7,7 @@
  * Portions Copyright (c) 1996-2011, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * src/include/replication/replnodes.h
+ * src/include/nodes/replnodes.h
  *
  *-------------------------------------------------------------------------
  */
 #define REPLNODES_H
 
 #include "access/xlogdefs.h"
-#include "nodes/primnodes.h"
-#include "nodes/value.h"
+#include "nodes/pg_list.h"
 
-/*
- * NodeTags for replication parser
- */
-typedef enum ReplNodeTag
-{
-       T_IdentifySystemCmd = 10,
-       T_BaseBackupCmd,
-       T_StartReplicationCmd
-}      ReplNodeTag;
 
 /* ----------------------
  *             IDENTIFY_SYSTEM command
index 831c33fb4a9329a04b50227e4ac6060696a2d802..7ce1f38372f6225f37615a14f55932970696164d 100644 (file)
@@ -5,14 +5,14 @@
  *
  * Portions Copyright (c) 2010-2011, PostgreSQL Global Development Group
  *
- * src/include/replication/walsender.h
+ * src/include/replication/basebackup.h
  *
  *-------------------------------------------------------------------------
  */
 #ifndef _BASEBACKUP_H
 #define _BASEBACKUP_H
 
-#include "replication/replnodes.h"
+#include "nodes/replnodes.h"
 
 extern void SendBaseBackup(BaseBackupCmd *cmd);