Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit605721f

Browse files
committed
gen_node_support.pl: Mark location fields as type alias ParseLoc
Instead of the rather ugly type=int + name ~= location$, we now have amarker type for offset pointers or sizes that are only relevant when aquery text is included, which decreases the complexity required ingen_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
1 parent347758b commit605721f

File tree

6 files changed

+97
-87
lines changed

6 files changed

+97
-87
lines changed

‎src/backend/nodes/gen_node_support.pl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ sub elem
777777
print$eff"\tCOMPARE_BITMAPSET_FIELD($f);\n"
778778
unless$equal_ignore;
779779
}
780-
elsif ($teq'int' &&$f =~'location$')
780+
elsif ($teq'ParseLoc')
781781
{
782782
print$cff"\tCOPY_LOCATION_FIELD($f);\n"unless$copy_ignore;
783783
print$eff"\tCOMPARE_LOCATION_FIELD($f);\n"unless$equal_ignore;
@@ -1010,7 +1010,7 @@ sub elem
10101010
print$off"\tWRITE_BOOL_FIELD($f);\n";
10111011
print$rff"\tREAD_BOOL_FIELD($f);\n"unless$no_read;
10121012
}
1013-
elsif ($teq'int' &&$f =~'location$')
1013+
elsif ($teq'ParseLoc')
10141014
{
10151015
print$off"\tWRITE_LOCATION_FIELD($f);\n";
10161016
print$rff"\tREAD_LOCATION_FIELD($f);\n"unless$no_read;
@@ -1303,7 +1303,7 @@ sub elem
13031303
print$jff"\tJUMBLE_NODE($f);\n"
13041304
unless$query_jumble_ignore;
13051305
}
1306-
elsif ($teq'int' &&$f =~'location$')
1306+
elsif ($teq'ParseLoc')
13071307
{
13081308
# Track the node's location only if directly requested.
13091309
if ($query_jumble_location)

‎src/include/nodes/nodes.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,15 @@ extern void *copyObjectImpl(const void *from);
229229
externboolequal(constvoid*a,constvoid*b);
230230

231231

232+
/*
233+
* Typedef for parse location. This is just an int, but this way
234+
* gen_node_support.pl knows which fields should get special treatment for
235+
* location values.
236+
*
237+
* -1 is used for unknown.
238+
*/
239+
typedefintParseLoc;
240+
232241
/*
233242
* Typedefs for identifying qualifier selectivities, plan costs, and row
234243
* counts as such. These are just plain "double"s, but declaring a variable

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp