Fix dispatching of queries with record-type parameters.
This fixes the "ERROR: record type has not been registered" error, when a record-type variable is used in a query inside a PL/pgSQL function. This is essentially the same problem we battled with in Motion nodes in GPDB 5, and added the whole tuple remapper to deal with it. Only this time, the problem is with record Datums being dispatched from QD to QE, as Params, rather than with record Datums being transferred across a Motion. To fix, send the transient record type cache along with the query parameters, if there are any of the parameters are transient record types. This is a bit inefficient, as the transient record type cache can be quite large. A more fine-grained approach would be to send only those record types that are actually used in the parameters, but more code would be required to figure that out. This will do for now. Refactor the serialization and deserialization of the query parameters, to leverage the outfast/readfast functions. Backport to 5X_STABLE. This changes the wire format of query parameters, so this requires the QD and QE to be on the same minor version. But this does not change the on-disk format, or the numbering of existing Node tags. Fixes github issue #4444.
Showing
想要评论请 注册 或 登录