diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2024-03-19 16:55:00 +0100 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2024-03-19 16:56:44 +0100 |
commit | 605721f819f5b603db6bc1405ef414747d182116 (patch) | |
tree | 3d6bcb38620e4debf2ded3443aaf1a062702ea1d /src/backend/nodes | |
parent | 347758b1206364e3bec5ad6cd649b4ba9fe1be7b (diff) | |
download | postgresql-605721f819f5b603db6bc1405ef414747d182116.tar.gz postgresql-605721f819f5b603db6bc1405ef414747d182116.zip |
gen_node_support.pl: Mark location fields as type alias ParseLoc
Instead of the rather ugly type=int + name ~= location$, we now have a
marker type for offset pointers or sizes that are only relevant when a
query text is included, which decreases the complexity required in
gen_node_support.pl for handling these values.
Author: Matthias van de Meent <boekewurm+postgres@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/CAEze2WgrCiR3JZmWyB0YTc8HV7ewRdx13j0CqD6mVkYAW+SFGQ@mail.gmail.com
Diffstat (limited to 'src/backend/nodes')
-rw-r--r-- | src/backend/nodes/gen_node_support.pl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/nodes/gen_node_support.pl b/src/backend/nodes/gen_node_support.pl index 2f0a59bc874..d4244facbb3 100644 --- a/src/backend/nodes/gen_node_support.pl +++ b/src/backend/nodes/gen_node_support.pl @@ -777,7 +777,7 @@ _equal${n}(const $n *a, const $n *b) print $eff "\tCOMPARE_BITMAPSET_FIELD($f);\n" unless $equal_ignore; } - elsif ($t eq 'int' && $f =~ 'location$') + elsif ($t eq 'ParseLoc') { print $cff "\tCOPY_LOCATION_FIELD($f);\n" unless $copy_ignore; print $eff "\tCOMPARE_LOCATION_FIELD($f);\n" unless $equal_ignore; @@ -1010,7 +1010,7 @@ _read${n}(void) print $off "\tWRITE_BOOL_FIELD($f);\n"; print $rff "\tREAD_BOOL_FIELD($f);\n" unless $no_read; } - elsif ($t eq 'int' && $f =~ 'location$') + elsif ($t eq 'ParseLoc') { print $off "\tWRITE_LOCATION_FIELD($f);\n"; print $rff "\tREAD_LOCATION_FIELD($f);\n" unless $no_read; @@ -1303,7 +1303,7 @@ _jumble${n}(JumbleState *jstate, Node *node) print $jff "\tJUMBLE_NODE($f);\n" unless $query_jumble_ignore; } - elsif ($t eq 'int' && $f =~ 'location$') + elsif ($t eq 'ParseLoc') { # Track the node's location only if directly requested. if ($query_jumble_location) |