pgsql: Fix new tuple deforming code so it can support cstrings again
pgsql: Fix new tuple deforming code so it can support cstrings again
От:
David Rowley <drowley@postgresql.org>
Дата:
Fix new tuple deforming code so it can support cstrings again 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 Reported-by: Tender Wang Discussion: https://postgr.es/m/CAHewXNmSK+gKziAt_WvQoMVWt3_LRVMmRYY9dAbMPMcpPV0QmA@mail.gmail.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/07d5bffe75d05b9c84803ea1ffaf5ce729f0e717 Modified Files -------------- src/backend/executor/execTuples.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-)