In c456e3911, I mistakenly thought that the deformer code would never see cstrings and that I could use pg_assume() to have the compiler omit producing code for attlen == -2 attributes. That saves bloating the deforming code a bit with the extra check and strlen() call. While this is ok to do for tuples from the heap, it's not ok to do for MinimalTuples as those *can* contain cstrings and tts_minimal_getsomeattrs() implements deforming by inlining the (slightly misleadingly named) slot_deform_heap_tuple() code. To fix, add a new parameter to the slot_deform_heap_tuple() and have the callers define which code to inline. Because this new parameter is passed as a const, the compiler can choose to emit or not emit the cstring-related code based on the parameter's value. Author: David Rowley <dgrowleyml@gmail.com> Reported-by: Tender Wang <tndrwang@gmail.com> Discussion: https://postgr.es/m/CAHewXNmSK+gKziAt_WvQoMVWt3_LRVMmRYY9dAbMPMcpPV0QmA@mail.gmail.com
PostgreSQL Database Management System
This directory contains the source code distribution of the PostgreSQL database management system.
PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, user-defined types and functions. This distribution also contains C language bindings.
Copyright and license information can be found in the file COPYRIGHT.
General documentation about this version of PostgreSQL can be found at https://www.postgresql.org/docs/devel/. In particular, information about building PostgreSQL from the source code can be found at https://www.postgresql.org/docs/devel/installation.html.
The latest version of this software, and related software, may be obtained at https://www.postgresql.org/download/. For more information look at our web site located at https://www.postgresql.org/.