diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2025-09-27 17:17:51 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2025-09-27 17:17:51 -0400 |
commit | b0fb2c6aa5a485e28210e13ae5536c1231b1261f (patch) | |
tree | 44a2f8af53ab91eef9c6df3f02ce4b13801c89b1 /contrib/auth_delay/auth_delay.c | |
parent | 7504d2be9eb45207b48476919e4539d93c389d86 (diff) |
Refactor to avoid code duplication in transformPLAssignStmt.HEADorigin/masterorigin/HEADmaster
transformPLAssignStmt contained many lines cribbed directly from
transformSelectStmt. I had supposed that we could manage to keep
the two copies in sync, but the bug just fixed in 7504d2be9 shows
that that hope was foolish. Let's refactor so there's just one copy.
The main stumbling block to doing this is that transformPLAssignStmt
has a chunk of custom code that has to run after transformTargetList
but before we potentially modify the tlist further during analysis
of ORDER BY and GROUP BY. Rather than make transformSelectStmt fully
aware of PLAssignStmt processing, I put that code into a callback
function. It still feels a little bit ugly, but it's not too awful,
and surely it's better than a hundred lines of duplicated code.
The steps involved in processing a PLAssignStmt remain exactly
the same as before, just in different places.
Author: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/31027.1758919078@sss.pgh.pa.us
Diffstat (limited to 'contrib/auth_delay/auth_delay.c')
0 files changed, 0 insertions, 0 deletions