Read/write OID fields in SQLValueFunction node correctly.
authorPavan Deolasee <[email protected]>
Thu, 15 Jun 2017 05:25:12 +0000 (10:55 +0530)
committerPavan Deolasee <[email protected]>
Thu, 15 Jun 2017 05:25:12 +0000 (10:55 +0530)
We must convert OID into a qualified name before sending it down to the remote
datanode and do the reverse on the remote end. This is a new node type added in
PG 10 and hence support was missing.

src/backend/nodes/outfuncs.c
src/backend/nodes/readfuncs.c

index d5165ddd4eefd5a5483feebd652d2a1c87176b62..be3413436adba973bdecc047601e5bf816b718c0 100644 (file)
@@ -2524,7 +2524,10 @@ _outSQLValueFunction(StringInfo str, const SQLValueFunction *node)
        WRITE_NODE_TYPE("SQLVALUEFUNCTION");
 
        WRITE_ENUM_FIELD(op, SQLValueFunctionOp);
-       WRITE_OID_FIELD(type);
+       if (portable_output)
+               WRITE_TYPID_FIELD(type);
+       else
+               WRITE_OID_FIELD(type);
        WRITE_INT_FIELD(typmod);
        WRITE_LOCATION_FIELD(location);
 }
index ae3e66f6491d7f8084fd1a4b61f068ad3f123457..5147eaa4d3150eaec1e16713f8685d79fdc0317a 100644 (file)
@@ -1657,7 +1657,10 @@ _readSQLValueFunction(void)
        READ_LOCALS(SQLValueFunction);
 
        READ_ENUM_FIELD(op, SQLValueFunctionOp);
-       READ_OID_FIELD(type);
+       if (portable_input)
+               READ_TYPID_FIELD(type);
+       else
+               READ_OID_FIELD(type);
        READ_INT_FIELD(typmod);
        READ_LOCATION_FIELD(location);