@@ -195,11 +195,11 @@ ResetUnloggedRelationsInDbspaceDir(const char *dbspacedirname, int op)
195195 while ((de = ReadDir (dbspace_dir , dbspacedirname )) != NULL )
196196 {
197197 ForkNumber forkNum ;
198- int oidchars ;
198+ int relnumchars ;
199199 unlogged_relation_entry ent ;
200200
201201 /* Skip anything that doesn't look like a relation data file. */
202- if (!parse_filename_for_nontemp_relation (de -> d_name , & oidchars ,
202+ if (!parse_filename_for_nontemp_relation (de -> d_name , & relnumchars ,
203203 & forkNum ))
204204 continue ;
205205
@@ -235,11 +235,11 @@ ResetUnloggedRelationsInDbspaceDir(const char *dbspacedirname, int op)
235235 while ((de = ReadDir (dbspace_dir , dbspacedirname )) != NULL )
236236 {
237237 ForkNumber forkNum ;
238- int oidchars ;
238+ int relnumchars ;
239239 unlogged_relation_entry ent ;
240240
241241 /* Skip anything that doesn't look like a relation data file. */
242- if (!parse_filename_for_nontemp_relation (de -> d_name , & oidchars ,
242+ if (!parse_filename_for_nontemp_relation (de -> d_name , & relnumchars ,
243243 & forkNum ))
244244 continue ;
245245
@@ -285,13 +285,13 @@ ResetUnloggedRelationsInDbspaceDir(const char *dbspacedirname, int op)
285285 while ((de = ReadDir (dbspace_dir , dbspacedirname )) != NULL )
286286 {
287287 ForkNumber forkNum ;
288- int oidchars ;
289- char oidbuf [OIDCHARS + 1 ];
288+ int relnumchars ;
289+ char relnumbuf [OIDCHARS + 1 ];
290290 char srcpath [MAXPGPATH * 2 ];
291291 char dstpath [MAXPGPATH ];
292292
293293 /* Skip anything that doesn't look like a relation data file. */
294- if (!parse_filename_for_nontemp_relation (de -> d_name , & oidchars ,
294+ if (!parse_filename_for_nontemp_relation (de -> d_name , & relnumchars ,
295295 & forkNum ))
296296 continue ;
297297
@@ -304,10 +304,10 @@ ResetUnloggedRelationsInDbspaceDir(const char *dbspacedirname, int op)
304304 dbspacedirname , de -> d_name );
305305
306306 /* Construct destination pathname. */
307- memcpy (oidbuf , de -> d_name , oidchars );
308- oidbuf [ oidchars ] = '\0' ;
307+ memcpy (relnumbuf , de -> d_name , relnumchars );
308+ relnumbuf [ relnumchars ] = '\0' ;
309309 snprintf (dstpath , sizeof (dstpath ), "%s/%s%s" ,
310- dbspacedirname , oidbuf , de -> d_name + oidchars + 1 +
310+ dbspacedirname , relnumbuf , de -> d_name + relnumchars + 1 +
311311 strlen (forkNames [INIT_FORKNUM ]));
312312
313313 /* OK, we're ready to perform the actual copy. */
@@ -328,12 +328,12 @@ ResetUnloggedRelationsInDbspaceDir(const char *dbspacedirname, int op)
328328 while ((de = ReadDir (dbspace_dir , dbspacedirname )) != NULL )
329329 {
330330 ForkNumber forkNum ;
331- int oidchars ;
332- char oidbuf [OIDCHARS + 1 ];
331+ int relnumchars ;
332+ char relnumbuf [OIDCHARS + 1 ];
333333 char mainpath [MAXPGPATH ];
334334
335335 /* Skip anything that doesn't look like a relation data file. */
336- if (!parse_filename_for_nontemp_relation (de -> d_name , & oidchars ,
336+ if (!parse_filename_for_nontemp_relation (de -> d_name , & relnumchars ,
337337 & forkNum ))
338338 continue ;
339339
@@ -342,10 +342,10 @@ ResetUnloggedRelationsInDbspaceDir(const char *dbspacedirname, int op)
342342 continue ;
343343
344344 /* Construct main fork pathname. */
345- memcpy (oidbuf , de -> d_name , oidchars );
346- oidbuf [ oidchars ] = '\0' ;
345+ memcpy (relnumbuf , de -> d_name , relnumchars );
346+ relnumbuf [ relnumchars ] = '\0' ;
347347 snprintf (mainpath , sizeof (mainpath ), "%s/%s%s" ,
348- dbspacedirname , oidbuf , de -> d_name + oidchars + 1 +
348+ dbspacedirname , relnumbuf , de -> d_name + relnumchars + 1 +
349349 strlen (forkNames [INIT_FORKNUM ]));
350350
351351 fsync_fname (mainpath , false);
@@ -372,13 +372,13 @@ ResetUnloggedRelationsInDbspaceDir(const char *dbspacedirname, int op)
372372 * for a non-temporary relation and false otherwise.
373373 *
374374 * NB: If this function returns true, the caller is entitled to assume that
375- * *oidchars has been set to the a value no more than OIDCHARS, and thus
376- * that a buffer of OIDCHARS+1 characters is sufficient to hold the OID
377- * portion of the filename. This is critical to protect against a possible
378- * buffer overrun.
375+ * *relnumchars has been set to a value no more than OIDCHARS, and thus
376+ * that a buffer of OIDCHARS+1 characters is sufficient to hold the
377+ * RelFileNumber portion of the filename. This is critical to protect against
378+ * a possible buffer overrun.
379379 */
380380bool
381- parse_filename_for_nontemp_relation (const char * name , int * oidchars ,
381+ parse_filename_for_nontemp_relation (const char * name , int * relnumchars ,
382382 ForkNumber * fork )
383383{
384384 int pos ;
@@ -388,7 +388,7 @@ parse_filename_for_nontemp_relation(const char *name, int *oidchars,
388388 ;
389389 if (pos == 0 || pos > OIDCHARS )
390390 return false;
391- * oidchars = pos ;
391+ * relnumchars = pos ;
392392
393393 /* Check for a fork name. */
394394 if (name [pos ] != '_' )
0 commit comments